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来将文件中的图形转成点阵,这个是由于文件大太或者文件图形过多而引起的异常,所以我在转换的过程时加入了文件的大小的判断,当文件过大时,就加入这个参数,不然就直接转,因为我测试的时候,不加入这个参数时,转换的速度快一点。
评论前必须登录!
注册