Skip navigation
Currently Being Moderated

Introducing: Open Multi-Page PDF win/mac

Jan 7, 2012 11:33 PM

Tags: #illustrator #pdf #javascript #ui #multipage_pdf #jsx #multiartboards

Hi all, many users have expressed their desire for a way to open multipage PDFs in Illustrator and for a couple of years now, mac users have enjoyed the use of a script by Shane Stanley to do just that...at first I wanted to translate his script into VB so PC users could benefit from it...since I couldn't get the source code, I decided to give my own version a try using JS....here's the result.

 

Use with caution, save everything before running until you're comfortable it won't mess things up. I didn't try opening a crazy amount of pages, I "only" opened 35 in about minute and a half. Let us know how many pages you're able to open before you crash Illustrator...

 

it works with CS4 and CS5 only, windows and mac

 

have comments?, questions? let me know...enjoy. Carlos Canto

 

openMultiPagePFD4.PNG

openMultiPagePFD1.PNG

openMultiPagePFD2.PNG

openMultiPagePFD3.PNG

 

Download:

http://www.fileswap.com/dl/QDc2eDC9v4/AI_openMultiPagePDF_CS4_CS5.zip. html

 
Replies 1 2 Previous Next
  • Currently Being Moderated
    Jan 8, 2012 12:53 AM   in reply to CarlosCanto

    Thanks Carlos!

     

    Doesn't seem to ever acknowledge a PDF is selected with AI15.1.0/MacOS 10.7.2. So can't ever get past the select PDF stage.

     

    It does open and work with AI15.1.0 and Mac OS10.6.8 but after the script finishes running it opens the ExtendScript ToolKit as well. It's a minor thing to quit the Toolkit and switch back to AI where all the pages are there.

     

    Nice work!

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 8, 2012 2:29 AM   in reply to [scott w]

    Scott, its not Carlos's script as such… Illustrator has a bug/problem with LIon it will no longer take a File Object or String with the '~' OS tilde…

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 8, 2012 11:46 AM   in reply to CarlosCanto

    Carlos, my Lion kitty is still in the box… Won't be getting installed any time soon… I can't try or test… only pass on what issues I've seen posted in the scripting forum… Lion did not add a tilde to mac file specification OSX has always been like that its just the user home… thus far I have only seen issues reported in the Illustrator scripting forum so I think the choking on '~' is an Illustrator + Lion issue… May be using .fsName for a full string would fix I can't really say…

     
    |
    Mark as:
  • Currently Being Moderated
    Jan 10, 2012 9:37 AM   in reply to CarlosCanto

    I was looking for something to enable this about a month ago, and today I found another use for it and went searching... You rock, Carlos! Thanks!

     
    |
    Mark as:
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Jan 15, 2012 4:34 PM   in reply to CarlosCanto

    Carlos:

    It still doesn't work with Lion ...we're looking into it.

    Is this bug written up somewhere? It appears that File.openDialog() returns a File object with an fsName starting with file:// which confuses the rest of the machinery, which is existing a POSIX path. The solution is to strip any leading file:// and create a new File object. So add the second of these two lines on line 61:

     

    var fileRef = File.openDialog ("Select PDF...", "*.pdf"); // get the file
    fileRef = new File(fileRef.fsName.replace("file://",""));
    

     

    This seems to fix it for me on 10.7.2.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 9, 2012 4:45 AM   in reply to CarlosCanto

    Hey Carlos!

     

    Thanks...:)

     

    I am using my Macbook Pro running Lion 10.7.2.

     

    I downloaded the script and added it to the JavaScript folder (is this the right folder?)

    Opened Illustrator -> File -> Scripts -> Other Scripts -> (browsed for the script)

     

    Opened the pdf file in preview and noticed the amount of pages. Can the script have an autodetect so it selects all the pages in the pdf?

    Went back to the script dialog box and changed the To area to the amount of pages. Clicked Open.

    (I have a few 16 page pdf files that I need to change the logo for each page)

    Gradually it opened seemingly on top of each other. Clicked ok. 14 artboards from left to right. 2 artboards below on the left. Hmm I forgot how to adjust the layout of the artboards, can anyone give me the hint on doing so?

     

    I tested the script with 2 16 page pdf files and it looks good!

    Now if only you could add the script to Indesign as well...:) As I noticed that Indesign can not open pdf files.

     

    Have a great day!

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 9, 2012 5:16 AM   in reply to Paal Joachim

    You place PDF's in indesign… Anyhows a script…

     

    http://indesignsecrets.com/placing-all-the-pages-of-a-pdf-inside-indes ign.php

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 9, 2012 5:51 AM   in reply to Muppet Mark

    Thanks Mark!

     

    I am also looking for ways to have the pdf files editable inside Indesign.

    Adobe really should improve the pdf editing features in Illustrator and Indesign. I find it weird that Indesign can not even bring in pdf files. Since Indesign and Illustrator both can save out to pdf files it seems natural that both programs can open these kinds of files and also edit them.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 9, 2012 9:18 AM   in reply to Paal Joachim

    PDF is not intended for editing.

     

    On top of that: those apps that can create PDFs (like CorelDraw, Keynote, AutoCAD, Scribus, InDesign, Photoshop, OpenOffice) are different, have different functions and options - so making a PDF fully editable would be like creating the universal file format.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 9, 2012 12:07 PM   in reply to CarlosCanto

    Total page count sounds really nice.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 9, 2012 12:37 PM   in reply to Monika Gause

    While certainly not a universal file format, several applications can open and use PDF content pretty darn well. For the flier or small brochure type of PDFs, I use Xara Designer Pro (use it quite a lot anyway). For "publication" types of PDFs I need to redo, I use Serif's PagePlus with the text setting set to "Flow" (versus "Tight").

     

    Depending on how the PDF is constructed and by what originating app, the contents are editable in most all respects in either of the two above applications.

     

    As for a so-called universal graphic format, well, SVG is one such attempt.

     

    Take care, Mike

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 9, 2012 1:13 PM   in reply to CarlosCanto

    Carlos, arranging artboards can be done at new document creation… Rearrange artboards can be used when ever… Your PDF page count can be a bit tricky…

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 10, 2012 12:30 AM   in reply to CarlosCanto

    This is a reply to Monika:

    Even though there is no universal standard it is better to have the opportunity to open a pdf and edit in Illustrator and Indesign then no chance at all. Of course if needed there can be a warning that the contents might look different then expected or the pdf not even be editable at all during the opening of a pdf file. Trying is better then not trying.

     

    Carlos:

    Yeah I know that I can move each individual artboard around. But I find it cumbersome with having to move around 16 or more into a position that works for me.

     

    Mark:

    Yes arranging the arboards can be done at new document creation but since we are not creating a new document but opening a pdf file in Illustrator there is no option on arranging the artboards.

     

    Carlos:

    It would be great with having the arrange artboards in your next version of the file! Thank you...:)

    Perhaps an options button that opens a tab or slides out to show arrange artboards etc.

    Total page count of a pdf is also very good. Then I do not need to check the pdf beforehand to see how many pages it contains.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 10, 2012 1:19 AM   in reply to Paal Joachim

    Yes arranging the arboards can be done at new document creation but since we are not creating a new document but opening a pdf file in Illustrator there is no option on arranging the artboards.

     

    This is simply NOT true… I read the syntax… If you count the *.pdf pages then the artboard arrangement can be set up when creating the new doc… Carlos will know what I meant…

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 10, 2012 1:49 AM   in reply to Muppet Mark

    (Mark it seems I missed something somewhere please correct me but this is what I meant) After opening the multipage pdf file and going into Document Setup there is no option on how the artboards should be laid out (atleast what I can notice) I look forward to when Carlos adds it into the options of his script.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 16, 2012 3:53 AM   in reply to CarlosCanto

    I am just thinking the default artboard layout options could be available on import of the pdf file.

     

    Thanks for creating the script Carlos...:)

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 14, 2012 9:33 PM   in reply to CarlosCanto

    Carlos,

     

    I downloaded your script on a whim, thinking I'd never really have a use for it. Just finished modifying 60 pages of music in four documents for a concert emergency, just in time, thanks to your script. Much obliged.

     

    Peter

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 15, 2012 7:44 AM   in reply to CarlosCanto

    This has been a very cool thread to read. I just downloaded and ran the script on my Macbook Pro - OS Lion. Seems to work great, and, the page count request is a relevant one. Staying tuned !

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 24, 2012 5:01 AM   in reply to CarlosCanto

    Carlos, I just found this and it is a great Script ...one of the awesome things i have found since using illustrator.

     

    I have one issue when i am opening an 8 page PDF it duplicates page 1 for 7 and 8 and skips 4 and 5?

     

    Have you experianced this?

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 24, 2012 5:04 AM   in reply to CarlosCanto

    Ok i found a workaround i just resave the pdf from Adobe Reader and changed the name it worked thanks! If you had a website i def would donate some money for your time.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 24, 2012 11:35 AM   in reply to Natesroom1

    ER hello… he does… You can adopt and get a photo… ! signed thou…

     

    http://www.worldwildlife.org/gift-center/gifts/Species-Adoptions/Chimp anzee.aspx

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 3:22 AM   in reply to CarlosCanto

    You could create one with no problem Carlos and make some cash on the side. The coding you do here is much more advanced than HTML and CSS and you already know alot of the Javascript root. I agree with you Nate! I would pay as well. You could even purchase one of the those premade template sites and make a killing. Sort of like a coding doctor that gets paid by diagnosis.

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 4:03 AM   in reply to CarlosCanto

    I agree especially for PC scripts because it seems that most of the good ones are coded in applesript for mac..

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 5:04 AM   in reply to Natesroom1

    Very true and I’m a PC guy!

     
    |
    Mark as:
  • Currently Being Moderated
    Apr 25, 2012 11:02 AM   in reply to CarlosCanto

    The same way people make a living building websites. The basic code is already there, but someone has to put it together, make sense of it and make it work. Because of you and Mark, I’ve became pretty valuable at work with my new knowledge, and I really appreciate it. You don’t realize how much money your knowledge saves people, given it is using Adobe products, but you would be more a less a consultant like a lot of those guys who write add-ins for Excel. The code is already there, but they make sense of it.

     

    And no different than when you call Microsoft and they charge you 69.95 to help you fix your PC. Help is valuable!

     
    |
    Mark as:
1 2 Previous Next
Actions

More Like This

  • Retrieving data ...

Bookmarked By (2)