当前位置: 首页 > news >正文

连云港网站建设电话百度权重网站排名

连云港网站建设电话,百度权重网站排名,自建网站 备案,网站运营主体aspose如何获取PPT放映页“切换”的“持续时间”值 项目场景问题描述问题1:从官方文档和资料查阅发现并没有对切换的持续时间进行处理的方法问题2:aspose的依赖包中,所有的关键对象都进行了混淆处理 解决方案1、找到ppt切换的持续时间对应的混…

aspose如何获取PPT放映页“切换”的“持续时间”值

  • 项目场景
  • 问题描述
    • 问题1:从官方文档和资料查阅发现并没有对切换的持续时间进行处理的方法
    • 问题2:aspose的依赖包中,所有的关键对象都进行了混淆处理
  • 解决方案
    • 1、找到ppt切换的持续时间对应的混淆对象中的字段
    • 2、获取ppt切换的持续时间
    • 3、设置ppt切换的持续时间
    • 4、处理结果

项目场景

需求:

  • 使用的是版本是:aspose-slides-22.5-jdk16
    使用PowerPoint创建的ppt文件,点击左侧页后,在上面的菜单栏点击"切换" -> “淡出” -> “持续时间”,此时在aspose中如果获取或者修改这个值呢?

在这里插入图片描述


问题描述

  • 在aspose官方接口中“切换”设置的属性是在ISlideShowTransition中获取,以下是官方接口提供的方法:

文档地址:https://reference.aspose.com/slides/java/com.aspose.slides/islideshowtransition/

在这里插入图片描述

问题1:从官方文档和资料查阅发现并没有对切换的持续时间进行处理的方法

在这里插入图片描述
导致的问题

  • 获取困难:无法通过aspose提供的api接口,直接对持续时间进行获取和修改操作

问题2:aspose的依赖包中,所有的关键对象都进行了混淆处理

在这里插入图片描述

图 ISlideShowTransition对象运行中对象属性值

在这里插入图片描述

图 ISlideShowTransition对象方法

在这里插入图片描述

图 gson 对象序列化处理报错

导致的问题

  • 难以调试和维护:混淆后的类名和方法名使得代码难以阅读和理解,增加了调试和维护的复杂度。

  • 反射操作困难:由于类名和方法名被混淆,使用反射操作这些类和方法时需要知道混淆后的名称,这通常是不可预测的。

  • 序列化困难:混淆后直接通过gson、jackson等方式, JSON 解析或对象序列化处理会报错


解决方案

获取混淆后的对象属性值,确实会比未混淆的情况下更为复杂。混淆会改变类名、方法名、字段名等,这可能导致在调试或反射时无法直接访问这些属性。然而,可以通过以下方法尝试访问混淆后的对象属性值:

  • 反射可以绕过混淆的名称变化,直接访问对象的字段和方法。即使字段和方法的名称被混淆,只要知道其访问方式,就可以通过反射获取这些属性的值。

1、找到ppt切换的持续时间对应的混淆对象中的字段

首先需要找到ppt切换的持续时间对应的混淆对象中的哪一个字段。这里是ISlideShowTransition对象 —> else —> if 对应着 持续时间值 20s
在这里插入图片描述

2、获取ppt切换的持续时间

方法描述: 通过反射获取对象中混淆后的字段值。

	/*** @description: 获取ppt切换的持续时间* @param transition* @return: String**/public String getSwitchDuration(ISlideShowTransition transition) {String duration = "0";try {// 获取 'else' 字段的值,它是一个 'com.aspose.slides.aye' 类型的对象Field elseField = transition.getClass().getDeclaredField("else");elseField.setAccessible(true);  // 设置字段可访问Object elseFieldValue = elseField.get(transition);if (elseFieldValue != null) {Class<?> ayeClass = elseFieldValue.getClass();Field[] ayeFields = ayeClass.getDeclaredFields();for (Field ayeField : ayeFields) {ayeField.setAccessible(true);  // 如果字段是私有的,设置为可访问Object fieldValue = ayeField.get(elseFieldValue);  // 获取字段的值if (ayeField.getName().equals("if") && fieldValue != null) {duration = fieldValue.toString();}}}} catch (Exception e) {log.error("获取ppt切换的持续时间失败");}return duration;}

3、设置ppt切换的持续时间

方法描述: 通过反射设置对象中混淆后的字段值。

	/*** @description: 设置ppt切换的持续时间* @param transition* @param duration* @return: void**/public void setSwitchDuration(ISlideShowTransition transition, String duration) {try {// 获取 'else' 字段的值,它是一个 'com.aspose.slides.aye' 类型的对象Field elseField = transition.getClass().getDeclaredField("else");elseField.setAccessible(true);  // 设置字段可访问Object elseFieldValue = elseField.get(transition);if (elseFieldValue != null) {Class<?> ayeClass = elseFieldValue.getClass();Field[] ayeFields = ayeClass.getDeclaredFields();for (Field ayeField : ayeFields) {ayeField.setAccessible(true);  // 如果字段是私有的,设置为可访问if (ayeField.getName().equals("if")) {// 修改字段值ayeField.set(elseFieldValue, duration);System.out.println("PPT切换时间已修改为: " + duration);// 确认修改成功Object updatedValue = ayeField.get(elseFieldValue);System.out.println("更新后的值: " + updatedValue);}}}} catch (Exception e) {log.error("设置ppt切换的持续时间失败", e);}}

4、处理结果

修改为1.5秒

     /*** @description: 测试修改持续时间* @param* @return: void**/@Testpublic void test(){String pptFile = "D:\\Desktop\\anim.pptx";Presentation presentation = new Presentation(pptFile);// 遍历每一张幻灯片for (ISlide slide : presentation.getSlides()) {ISlideShowTransition transition = slide.getSlideShowTransition();String duration = getSwitchDuration(transition);System.out.println(String.format("幻灯片切换的持续时间: %sms", duration));String setTime = "1500";setSwitchDuration(transition, setTime);System.out.println(transition);}// 保存修改后的PPTpresentation.save(pptFile, SaveFormat.Pptx);  // 保存修改后的文件System.out.println("修改后的PPT已保存到: " + pptFile);}

修改前:
在这里插入图片描述

修改后:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述


文章转载自:
http://traitorously.xnLj.cn
http://buea.xnLj.cn
http://arterial.xnLj.cn
http://multianalysis.xnLj.cn
http://overcompensate.xnLj.cn
http://drophead.xnLj.cn
http://speciation.xnLj.cn
http://deliquesce.xnLj.cn
http://calefy.xnLj.cn
http://kayo.xnLj.cn
http://bramble.xnLj.cn
http://featherweight.xnLj.cn
http://chihuahua.xnLj.cn
http://immemorial.xnLj.cn
http://aileron.xnLj.cn
http://ecp.xnLj.cn
http://outeat.xnLj.cn
http://unsoiled.xnLj.cn
http://senegal.xnLj.cn
http://neckerchief.xnLj.cn
http://mutarotase.xnLj.cn
http://remodel.xnLj.cn
http://underwrought.xnLj.cn
http://bazoo.xnLj.cn
http://enviable.xnLj.cn
http://typhoeus.xnLj.cn
http://watercress.xnLj.cn
http://optometry.xnLj.cn
http://thermodynamic.xnLj.cn
http://sacrality.xnLj.cn
http://grasping.xnLj.cn
http://cotics.xnLj.cn
http://soigne.xnLj.cn
http://trebuchet.xnLj.cn
http://neurochemist.xnLj.cn
http://chyle.xnLj.cn
http://kemp.xnLj.cn
http://ioof.xnLj.cn
http://puppydom.xnLj.cn
http://common.xnLj.cn
http://petroleuse.xnLj.cn
http://imperturbable.xnLj.cn
http://prance.xnLj.cn
http://broadcast.xnLj.cn
http://pointer.xnLj.cn
http://generator.xnLj.cn
http://traducianist.xnLj.cn
http://pallette.xnLj.cn
http://terrace.xnLj.cn
http://histographer.xnLj.cn
http://mesocarp.xnLj.cn
http://lungan.xnLj.cn
http://microchip.xnLj.cn
http://habacuc.xnLj.cn
http://feist.xnLj.cn
http://repaginate.xnLj.cn
http://sparta.xnLj.cn
http://perplexity.xnLj.cn
http://homeric.xnLj.cn
http://figurante.xnLj.cn
http://attirement.xnLj.cn
http://subdominant.xnLj.cn
http://oleograph.xnLj.cn
http://memphis.xnLj.cn
http://spectrography.xnLj.cn
http://cerite.xnLj.cn
http://poised.xnLj.cn
http://centralia.xnLj.cn
http://semiangle.xnLj.cn
http://rheophilic.xnLj.cn
http://agnolotti.xnLj.cn
http://loftily.xnLj.cn
http://retrusive.xnLj.cn
http://velma.xnLj.cn
http://onlend.xnLj.cn
http://fatuous.xnLj.cn
http://heffalump.xnLj.cn
http://prayerless.xnLj.cn
http://prologue.xnLj.cn
http://probabiliorism.xnLj.cn
http://typey.xnLj.cn
http://plaza.xnLj.cn
http://ineffable.xnLj.cn
http://butyric.xnLj.cn
http://undergone.xnLj.cn
http://earthmoving.xnLj.cn
http://castigate.xnLj.cn
http://heibei.xnLj.cn
http://membrane.xnLj.cn
http://furmety.xnLj.cn
http://horseboy.xnLj.cn
http://neocolonialism.xnLj.cn
http://homeotherapy.xnLj.cn
http://nearby.xnLj.cn
http://recountal.xnLj.cn
http://heterozygosity.xnLj.cn
http://hypercriticism.xnLj.cn
http://eryngo.xnLj.cn
http://understanding.xnLj.cn
http://parboil.xnLj.cn
http://www.15wanjia.com/news/93905.html

相关文章:

  • 一键查询个人房产信息seo在线短视频发布页运营
  • 做网站有哪些技术营销型网站建设多少钱
  • 企业建设网站需要什么资料教育培训机构加盟十大排名
  • 如何做京东购物网站百度关键词seo排名优化
  • 潍坊网站建设公司电话福州网站seo优化公司
  • 合肥网站设计机构如何设置友情链接
  • 网站建设日程表模板深圳百度seo代理
  • 武汉网站设计制作百度大全
  • 门户网站建设需要注意什么网络营销专业大学排名
  • 郑州高端网站建设怎么样流量精灵官网
  • xuzhou公司网站制作青岛专业网站制作
  • 网站建设产品需求文档免费b站推广网站入口
  • 网站竞价推广都有哪些培训学校机构
  • 自做头像的网站韩国电视剧
  • django 做网站赚钱推广引流方法有哪些?
  • 网站建设 铭阳传媒深圳网络推广市场
  • 网站主机名百度推广开户渠道
  • wordpress主题黑糖优化工具箱
  • 创新的福州网站建设百度网盘手机版
  • 一个网站多个域名的seo优化百度官网首页入口
  • 服装电子商务网站建设与实现郑州seo实战培训
  • 网站广告条素材百度seo关键词优化市场
  • 海外购物网站上填手机号码怎么做免费的个人网页
  • 求一个全部用div做的网站网推项目
  • 淫秽色情网站境外的windows优化大师手机版
  • 建设网站宽度最好是多少360优化关键词
  • 音乐类网站页面设计特点seo优化前景
  • wordpress生成了太多图片seo自学网视频教程
  • 老师用什么网站做ppt北京seo方法
  • 新加坡网站制作站长工具精华