1. 程式人生 > >pdf2swf 轉換時報錯。This file is too complex to render- SWF only supports 65536 shapes at once

pdf2swf 轉換時報錯。This file is too complex to render- SWF only supports 65536 shapes at once

在使用swftools轉換pdf 到swf的時候報錯,

查詢 baidai 了一下。
有如下說明:
if the pdf contains too many images / shapes, pdf2swf will fail with this error :
ERROR Thisfileistoocomplextorender-SWFonly 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


問題描述:線上瀏覽的時候報【轉換後的檔案不存在】,檢視後臺是swf 檔案轉換失敗導致的。
SWF轉換問題: ERROR Thisfileistoocomplextorender-SWFonly supports 65536 shapes at once 
經查詢是,是後臺的程式沒有做判斷及新增相應的引數進行處理。
目前(20120319)後臺的處理命令為:
 pdf2swf 1.pdf -o 1.swf -f -T 9 -G

需要新增引數  ,下面列出三種轉換的優先順序,因為和轉換的速度有關係,所以不要都用下面的啦
 pdf2swf

 1.pdf -o 1.swf -f -T 9 -G -s poly2bitmap    只對檔案中的圖形轉成點陣
 pdf2swf 1.pdf -o 1.swf -f -T 9 -G -s bitmap    對everything 轉成點陣
pdf2swf 1.pdf -o 1.swf -f -T 9 -G -s enablezlib  bitmap    對everything 轉成點陣,並通過enablezlib壓縮

處理這個問題可以按上面的方法,在轉換時加入引數-s poly2bitmap 或者其他的來將檔案中的圖形轉成點陣,這個是由於檔案大太或者檔案圖形過多而引起的異常,所以建議在轉換的過程時加入了檔案的大小的判斷,當檔案過大時,就加入這個引數,不然就直接轉,因為我測試的時候,不加入這個引數時,轉換的速度快一點。