Render Flash (SWF) frame as image (PDF,PNG,JPG)

后端 未结 3 1945
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-09 05:20

I would like to write a python script that takes a bunch of swf files and renders them to individual image files.

Each swf file has just one frame (text, pictures etc.)

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-09 06:24

    I'm sorry to answer my own question, but I found an undocumented feature of swfrender (part of the swftools) by browsing through the sources.

    swfrender path/to/my.swf -X -Y
    -o
    

    As you might have guessed the X option lets you determine the width (in pixels) of the output and Y does the same for the height. If you just set one parameter, then the other one is chosen in relation to the original height-width-ratio (pretty useful)

    That does the trick for me but as Zarate offered a solution that might be even better (I'm thinking of swf to PDF conversion) he deserves the credits.

    Cheers

提交回复
热议问题