Batch convert Swf to Pdf

Discussion in 'Mac Basics and Help' started by lilaznboi, Aug 30, 2010.

  1. macrumors newbie

    Mar 11, 2009
    I have a book that is separated into 1000 different swf files and i was wondering if there is any software that is able to batch convert them to pdf? Doing each one manually takes too long.
  2. macrumors newbie

    Sep 7, 2010
    batch convert swf to pdf

    I'm looking for something that can do them individually... I did it once but can't remember how...

    thank you for your time

    J Barta
  3. macrumors member

    Jan 6, 2004
    Hey Guys,

    I have 1488 pages as swf's to combine. I've been trying to get this to happen for a few days, and there is no good solution. Here's the best I could do:

    make a series of html files to display the swf's. I did it in groups of 50 per html file because more would crash Safari on my machine. I made a shell script in the folder with the swf's to generate the html files.

    for j in {0..30}
    echo "<html><head><STYLE TYPE='text/css'>" > output$j.html
    echo "P.pagebreakhere {page-break-before: always}" >> output$j.html
    echo "</STYLE></head><body>" >> output$j.html
    for i in {1..50}
       echo "<OBJECT CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" WIDTH=\"1700\" HEIGHT=\"2200\" CODEBASE=\",0,0,0\"><PARAM NAME=\"MOVIE\" VALUE=\"page$((i+50*j)).swf\"><PARAM NAME=\"PLAY\" VALUE=\"true\"><PARAM NAME=\"LOOP\" VALUE=\"true\"><PARAM NAME=\"QUALITY\" VALUE=\"high\"><PARAM NAME=\"SCALE\" value=\"noborder\"><EMBED SRC=\"page$((i+50*j)).swf\" WIDTH=\"1700\" HEIGHT=\"2200\" PLAY=\"true\" LOOP=\"true\" QUALITY=\"high\" scale=\"noborder\" PLUGINSPAGE=\"\"></EMBED></OBJECT>" >> output$j.html
       echo "<P CLASS=\"pagebreakhere\">" >> output$j.html
    echo "</body></html>" >> output$j.html
    For your purposes change page$((i+50*j)).swf to correlate to your naming scheme (mine was page1.swf through page1488.swf). Note that there are two instances of the file name in the script.

    Also, change the range of variable j to the number of 50 swf sets you need.

    Now, you have files named output##.html...and this is where my automation skills have failed. Here's my manual process for the rest:

    Close all safari tabs and windows, but keep the application running.

    Select all of the html files in Finder and hit Command+O to open them (or ctrl+click to open in Safari if it isn't your default browser)...on second thought, they opened in 30 tabs of one window on my system. That may have been contingent on my configuration/preferences. Don't do that if it opens multiple windows.

    Switch to Safari. Wait for the first 50 pages to load. Open the print dialog and choose a custom paper size. Create a page that is 17 inces wide and 23 inches tall (slightly more than double 8.5"x11" to make sure the page break commands fit with the swf on a single page). Save as PDF from the print dialog to your preferred numbered file name. Wait for that to happen (it takes my machine 2-5 minutes or so). Close that tab. wait for the next set of swf's to load and repeat the process (remember to choose your new page size!).

    Once all tabs are done (the last one will be blank because I forgot about the zero page) open them all in preview, delete the pages that are blank at the end and "print" the whole thing to a pdf on your preferred paper size.

    You're done!

    Just to explain the paper size thing: swf's print at screen resolution (72 dpi) and look like garbage. By making them "print" onto double size paper, we get that up to 144 dpi once the size has been reduced. It's not great, but I think it's the minimum tolerable for text, and anything bigger froze or crashed my Safari.

    So, who can help figure out how to automate the print to PDF part? And how to OCR it without spending a ton of money?

Share This Page