RunasSudo / gfx2gfx-pdftext

A fork of SWFTools' gfx2gfx which preserves text, rather than converting to shapes.
GNU General Public License v2.0
9 stars 5 forks source link

gfx2gfx: errors in converting swf to pdf #7

Open SergeGardien opened 7 years ago

SergeGardien commented 7 years ago

Hi, I've succesfully compiled the gfx2gfx-pdftext v0.9.2 build 8d5a70b code (and the same is true for SWFTools v0.9.2) under Mac OS X 10.11.6 but I had to fix the jpeg.c file (as I described in the thread https://github.com/matthiaskramm/swftools/issues/37) given that I had some compiling errors.

In particular I've compiled gfx2gfx without errors but if I use it with the command: gfx2gfx test.swf -o test.pdf I get the following errors (swf file zipped and attached test.swf.zip): Error: ID 142 unknown Error: ID 145 unknown Error: ID 148 unknown Error: ID 151 unknown Error: ID 154 unknown Error: ID 157 unknown Error: ID 160 unknown Error: ID 163 unknown Error: ID 166 unknown Error: ID 169 unknown Error: ID 172 unknown Error: ID 175 unknown Error: ID 178 unknown Error: ID 181 unknown Error: ID 184 unknown Error: ID 187 unknown Error: ID 190 unknown Error: ID 193 unknown Error: ID 196 unknown Error: ID 199 unknown Error: ID 202 unknown Error: ID 205 unknown Error: ID 208 unknown Error: ID 211 unknown Error: ID 214 unknown Error: ID 217 unknown Error: ID 220 unknown Error: ID 223 unknown Error: ID 226 unknown Error: ID 229 unknown Error: ID 232 unknown Error: ID 235 unknown Error: ID 238 unknown Error: ID 241 unknown Error: ID 244 unknown Error: ID 247 unknown Error: ID 250 unknown Error: ID 253 unknown Error: ID 256 unknown Error: ID 259 unknown Error: ID 262 unknown Error: ID 265 unknown Error: ID 268 unknown Error: ID 271 unknown Error: ID 274 unknown Error: ID 277 unknown Error: ID 280 unknown Error: ID 283 unknown Error: ID 286 unknown Error: ID 289 unknown Error: ID 292 unknown Error: ID 295 unknown Error: ID 298 unknown

Do you have any idea what this is? How can I fix it?

TonyStark commented 6 years ago

Just avoid that error. you can still generate pdf.

SergeGardien commented 6 years ago

Thanks TonyStark. In the end I've taken another way to convert from swf to pdf.

Loewe1000 commented 4 years ago

Thanks TonyStark. In the end I've taken another way to convert from swf to pdf.

Which way do you use?

SergeGardien commented 4 years ago

Hi Loewe1000, it has been a while I did this but, lucky you, I have written a guide at the time. I have uploaded the mentioned Python swf2pdf.py on my page: https://github.com/SergeGardien/Scripts/blob/master/swf2pdf.py

Here are the possibilities:

Iey4iej3 commented 4 years ago

I looked at the error in question. In fact, it does not affect anything. After decompiled with swfmill, you get <DefineButton objectID="142">...</DefineButton>. The error is just saying that Button is not supported. I don't think that it is essential.

nissansz commented 4 years ago

Hi Loewe1000, it has been a while I did this but, lucky you, I have written a guide at the time. I have uploaded the mentioned Python swf2pdf.py on my page: https://github.com/SergeGardien/Scripts/blob/master/swf2pdf.py

Here are the possibilities:

  • SOLUTION 1 (TESTED - OK) => BEST PDF QUALITY

    • Use reaConverter Pro (by ReaSoft Development) under Windows
    • You cannot specify the "Page Size" hence you need to convert it to your desired one with cpdf (pdf => pdf)
  • SOLUTION 2 (TESTED - OK)

    • Use Python script (with pywinauto library) under Windows

    • Download script: https://github.com/SergeGardien/Scripts/blob/master/swf2pdf.py

    • Required components/Tools:

    • Firefox

      • Use 32bit version because the 64bit version has problems in printing from Adobe Flash (right-click + print from SWF file)
    • Adobe Flash Player (for Firefox)

    • Python

      • Use 32bit because the 64bit doesn't work with Firefox 32bit
      • 64Bit: C:\Users\username\AppData\Local\Programs\Python\Python36\python.exe
      • 32Bit: C:\Users\usernameAppData\Local\Programs\Python\Python36-32\python.exe
    • PDF Virtual Printer

      • I need a PDF virtual printer which bypass the "Save As" window dialog so I can avoid to dealing with it in pywinauto

      • Possible softwares:

      • PDFCreator (free) => Tested, it works fine

      • novaPDF Lite (or above editions)

      • Cannot use the following:

      • CutePDF => no possibility to bypass "Save As" window dialog

      • Adobe PDF => can bypass "Save As" window dialog but overwrites files (cannot use sequential names)

    • Steps

    1. Start Windows 8
    2. Put all SWF files and pywinauto script "swf2pdf.py" in the same folder (/Users/username/Workspace/# Various Scripts-Code/pywinauto scripts (SWF to PDF)/swf2pdf.py)
    3. If not already done, set default applications:

      1. for python scripts (.py) set default as python 32bit, right click on .py file and give "C:\Users\username\AppData\Local\Programs\Python\Python36-32\python.exe"
      2. for SWF files set default as Firefox 32bit
    4. Open Firefox (32bit)
    5. Double click on swf2pdf.py
  • SOLUTION 3 (TESTED - KO)

    • use gfx2gfx (swftools component)
    • Some compiling issue (jpeg stuffs compilation conflicting with swftools)
    • I have various errors when I execute the swf to pdf conversion: check folder "gfx2gfx (swf-to-pdf)" in Firefox bookmarks

Do you have method to convert files which pops out PDFlib exception (fatal): [2600] PDF_load_image: Couldn't find encoding 'cp936'? I can conver swf to text-copyable pdf with several steps. It is time consuming. Any fast method? steve8000818@gmail.com swf pdf

SergeGardien commented 4 years ago

Do you have method to convert files which pops out PDFlib exception (fatal): [2600] PDF_load_image: Couldn't find encoding 'cp936'? I can conver swf to text-copyable pdf with several steps. It is time consuming. Any fast method?

No, I'm sorry but I haven't observed that issue. It seems related to Chinese fonts: https://stackoverflow.com/questions/5882275/fatal-error-uncaught-exception-pdflibexception-with-message-couldnt-find-en If you haven't done it already, just do a Google search for a solution.