Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Redistill PDFs?

  1. #1
    chevalier is offline Senior Member
    Join Date
    Jul 2010
    Location
    United States of America
    Posts
    291

    Default Redistill PDFs?

    This is perhaps a question that only Dov might able to answer.

    I receive a lot of different types of files from all kinds of creative software. I get a lot of PDFs that just won't normalize in my preflight workflows. Things get hung and refuse the move. If I rehash the PDF by placing in it into InDesign and export a PDF/X1a or PDF/X4 99.99999% of the time the problem goes away. I also get a fair number of DCS2 files that need to be converted to PDF for imposition/workflow purposes.

    The annoyance is having to place the items in items in Illustrator or InDesign then export/save as PDF/X1a or PDF/X4. Life would be extremely easier to just dump into distiller and get a PDFX/1a or PDF/X4 out the other side.

    Why can't Distiller do this?

  2. #2
    Colorblind's Avatar
    Colorblind is offline Senior Member
    Join Date
    Aug 2007
    Location
    Montreal, Qc, Canada
    Posts
    331

    Default

    On a mac, you can use the following script. Paste the code in Script Editor, click compile and save as an application. Drag one or multiple PDFs on the application icon and it will open each PDF in Acrobat to get infos about them (size, # of pages) and then place them in InDesign and export them in a folder named "Refried PDFs" on your desktop. Beware of the refrying consequenses though... But if you were OK doing it manually, this should work for you.

    --Script by Colorblind, tested with Acrobat 9 and InDesign CS4
    on open pdf_list
    set desktop_path_hfs to the path to the desktop as string
    repeat with mypdf in pdf_list
    tell application "Finder"
    activate
    set dest_pdf_folder to desktop_path_hfs & "Refried PDFs:" as string
    if not (exists dest_pdf_folder) then
    make new folder with properties {name:"Refried PDFs"}
    end if
    set this_pdf_name to the name of mypdf
    open file mypdf using application file id "CARO"
    tell application "Adobe Acrobat Pro"
    activate
    set b to get crop box of page 1 of active doc
    set w1 to item 3 of b as integer
    set w0 to item 1 of b as integer
    set h1 to item 2 of b as integer
    set h0 to item 4 of b as integer
    set PDFheight to (h1 - h0) / 72
    set PDFwidth to (w1 - w0) / 72
    set pagecount to count every page of active doc
    set idh to PDFheight & " i" as string
    set idw to PDFwidth & " i" as string
    close active doc without saving
    end tell


    set idpage to 1
    set pdfpage to 1

    tell application "Adobe InDesign CS4"
    activate
    set mydoc to make document
    tell document preferences of mydoc
    set facing pages to false
    set page width to idw
    set page height to idh
    set pages per document to pagecount

    end tell
    repeat pagecount times
    set page number of PDF place preferences to pdfpage

    -- the "crop PDF" parameter can be changed to the following: crop content/crop art/
    --crop PDF/crop trim/crop bleed/crop media/crop content/crop art/¬
    --crop PDF / crop trim / crop bleed / crop media

    set PDF crop of PDF place preferences to crop PDF

    set mypdfpage to place mypdf on page idpage of mydoc
    set idpage to idpage + 1
    set pdfpage to pdfpage + 1
    end repeat
    end tell
    end tell
    tell application "Adobe InDesign CS4"
    activate
    set my_final_destination to dest_pdf_folder
    tell document preferences of document 1
    set pwn to get page width
    set phn to get page height
    end tell
    tell document 1
    -- You can change "High Quality Print" to any other PDF preset
    export format PDF type to my_final_destination & this_pdf_name using "High Quality Print" without showing options
    end tell
    end tell
    end repeat
    end open
    Better train people and risk they leave - than do nothing and risk they stay.

  3. #3
    chevalier is offline Senior Member
    Join Date
    Jul 2010
    Location
    United States of America
    Posts
    291

    Default

    Thanks for the script!

  4. #4
    Join Date
    Sep 2008
    Posts
    43

    Default

    Hi chevalier,

    Quote Originally Posted by chevalier View Post
    Why can't Distiller do this?
    Distiller can only take PostScript and turn it into PDF.
    If you're starting with PDF, you can use Acrobat to Export to PDF/X-1, 3, or 4. This is probably less invasive than the "place in InDesign and re-export PDF" route.


    Quote Originally Posted by chevalier View Post
    I get a lot of PDFs that just won't normalize in my preflight workflows. Things get hung and refuse the move.
    It's reasonable to expect the occasional unusual file to have issues, but if this happens for you frequently... Sounds like you need a more robust preflight workflow.

    James

  5. #5
    Stephen Marsh is offline Senior Member
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    575

    Default

    Quote Originally Posted by Colorblind View Post
    On a mac, you can use the following script.

    Thanks Colorblind, I still use InDesign CS3 and Tiger on a PPC - sadly I get an error when executing the script (it makes the output folder but gets stuck with an error "The variable b is not defined")...I am running Acrobat 9 Pro though!

    Thanks again for sharing!


    Stephen Marsh

  6. #6
    Colorblind's Avatar
    Colorblind is offline Senior Member
    Join Date
    Aug 2007
    Location
    Montreal, Qc, Canada
    Posts
    331

    Default

    Stephen, do you get the PDF to open in Acrobat at all when you drop the file on the script?
    Better train people and risk they leave - than do nothing and risk they stay.

  7. #7
    Stephen Marsh is offline Senior Member
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    575

    Default

    Quote Originally Posted by Colorblind View Post
    Stephen, do you get the PDF to open in Acrobat at all when you drop the file on the script?

    Colorblind, yes, the PDF does open into Acrobat Pro 9, the "Refried PDFs" folder is also created on the Desktop - however the "The variable b is not defined" is the problem at this point of the process.

    It is not a big deal so please don't sweat over it just for me (that being said, I would like to see your script work).


    Regards,

    Stephen Marsh

  8. #8
    Colorblind's Avatar
    Colorblind is offline Senior Member
    Join Date
    Aug 2007
    Location
    Montreal, Qc, Canada
    Posts
    331

    Default

    Stephen, it works here but do yourself a favor and open the same PDF in Acrobat Pro, paste the following code in Script Editor, make sure the "Event Log" tab is active (bottom right of the script editor window), run the script then copy what you'll get in the Event Log tab after you run it and PM it to me or post it here. It could be that the PDF doesn't have a page 1 or something else.

    tell application "Adobe Acrobat Pro"
    activate
    try
    set displayed_page to get page number of PDF Window of active doc
    end try
    try
    set b to get crop box of page displayed_page of active doc
    end try
    try
    set my_media to get media box of page displayed_page of active doc
    end try
    try
    set my_trim to get trim box of page displayed_page of active doc
    end try
    try
    set my_bleed to get bleed box of page displayed_page of active doc
    end try
    end tell
    Better train people and risk they leave - than do nothing and risk they stay.

  9. #9
    Stephen Marsh is offline Senior Member
    Join Date
    Apr 2009
    Location
    Sydney, Australia
    Posts
    575

    Default

    Quote Originally Posted by Colorblind View Post
    Stephen, it works here but do yourself a favor and open the same PDF in Acrobat Pro, paste the following code in Script Editor, make sure the "Event Log" tab is active (bottom right of the script editor window), run the script then copy what you'll get in the Event Log tab after you run it and PM it to me or post it here. It could be that the PDF doesn't have a page 1 or something else.end tell

    Thank you for the support Colorblind!

    Attached is the result.

    I ran the second script separate to the first script code. Should I combine the two lots of code into one script?

    Running the original script code with the PDF open in Acrobat Pro still returns the origianl error message.

    As I said, this is not a big deal, so please don't go out of your way to attempt to make this work at my end if you have better things to do.


    Best,

    Stephen Marsh
    Attached Images Attached Images

  10. #10
    Colorblind's Avatar
    Colorblind is offline Senior Member
    Join Date
    Aug 2007
    Location
    Montreal, Qc, Canada
    Posts
    331

    Default

    It gets stranger, you don't get any result in the Event Log... If you could post that PDF you ran the script on, I could probably help more...
    Better train people and risk they leave - than do nothing and risk they stay.


Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Sponsors

Esko Sponsored Content