pdf2swf fails to transform with the default options when the pdf are too large,

if the pdf contains too many images / shapes, pdf2swf will fail with this error :

ERROR This file is too complex to render- SWF only supports 65536 shapes at once

There is a very simple fix : add "-s poly2bitmap" to the options given to the transformer's commandMap in swf-transform-context.xml

The issue is also discussed in
ETHREEOH-3023 , and it can be easily reproduced with the pdf attached to ETHREEOH-3023 .
With the added options "-s poly2bitmap" (which means converts pdf graphics to bitmaps) allows the transformation to complete successfully, so maybe we could add this option by default.

Cheers,
Romain


上面是在使用swftools工具时,转换大文件时发生了一个怪现象:我先将大文件word转为pdf,再将pdf转为swf,由pdf转换为swf过程中,竟然没有输入转换后的swf文件,后来用命令行来转换一下,才知道那个pdf文件太大了,所以转换时发生了异常:

ERROR This file is too complex to render- SWF only supports 65536 shapes at once 

处理这个问题可以按上面的方法,在转换时加入参数-s poly2bitmap来将文件中的图形转成点阵,这个是由于文件大太或者文件图形过多而引起的异常,所以我在转换的过程时加入了文件的大小的判断,当文件过大时,就加入这个参数,不然就直接转,因为我测试的时候,不加入这个参数时,转换的速度快一点。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值