How to 'Place in the linked file' (not 'import') a multipage PDF file on a single work plan?

ILLUSTRATOR CS4

Hello

I often use import it the Carlos Santo multiPDF script and it works fine.

But I sometimes customers multipage PDF files with text and the fonts are embedded so rarely.

As you may know, the solution for this font "vectorized" even if you don't have it in your font collection is to place your pdf as a linked file (menu file-> Place with the "link" box checked) in an open document (or drag and drop the it) and then via the object Menu-> flatten transparency , I check the "Embed text" did.

So to automate it with a multipage PDF and inspired by the script of Carlos, I tried this:

/////////////////////////////////////////////////

var doc = app.activeDocument;

app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;

var pdfOptions = app.preferences.PDFFileOptions;

firstPage var = 1;

var lastPage = 10;

pdfFile = File.openDialog ("open multiple PDF pages", "*.pdf", false);

for (i = firstPage; i < lastPage; i ++)

{

pdfOptions.pageToOpen = i;

var thisPlacedItem = doc.placedItems.add ();

thisPlacedItem.file = pdfFile;

};

/////////////////////////////////////////////////

It does not work! I find myself with 10 placedItems the number of page 1 of the pdf file. Maybe the pageToOpen option only works when I use the Open method? Actually no, because if I run the application only the 2 following lines and then I drag and drop the pdf file, the specified page (page 8 of the example) is well placed.

//////////////////

var pdfOptions = app.preferences.PDFFileOptions;

pdfOptions.pageToOpen = 8;

/////////////////

I don't know how to fix. I have 2 solutions, but it only makes "semi automatic":

-Create a dialog box palette with a button that increases successively the pageToOpen option and then make drag and drop my file once for all pages (easy)

-Without the palette and the button, but with a listener of events with a function that increases the value of pageToOpen whenever I have do drag and drop a new file (perhaps by listening to the evolution of document.placedItems.length), but is it possible?

Any suggestions?

Thank you very much for your help!

I find myself with 10 placedItems the number of page 1 of the pdf file. Maybe the pageToOpenoption doesn't work when I use the Open method?

I had the same problem, my first option was to place the pdf pages, I couldn't make it work I therefore had no choice but to open the file instead.

go with your first option, besides you drag Actions may place the right page, based on the property of pageToOpen ... so there is hope, record an Action to place your pdf and...

1. run your script to increase the property of pageToOpen

2. play your action

3. Repeat this process for each page

actions can also run scripts, then you can do it too.

If you had CS6, it would be easier, CS6 can play shares with Javascript

Tags: Illustrator

Similar Questions

Maybe you are looking for