Copy link to clipboard
Copied
use AI to directly open pdf , if some computer missing font, so these character will show error glyph.
how to write a correct script , the highlight is selected? thanks
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var pdfOptions = app.preferences.PDFFileOptions;
pdfOptions.pageRangeToOpen = "all";
pdfOptions.placeAsLinks = false;
//how to add outline action in here?
var idoc = app.open(File(path)); // full path to your pdf
app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;
1 Correct answer
Hi @rui huang, I think you might be able to do what you ask in Acrobat. I don't know of any way to do it in Illustrator for the reason Carlos gave—Illustrator has no power to alter a pdf without first instantiating DOM objects, eg. TextFrames, and by that time, the opportunity is gone. I'd be surprised, however, if Acrobat couldn't do it. I did a quick search and this answer by Scott mentions a way to do it in Acrobat.
- Mark
Explore related tutorials & articles
Copy link to clipboard
Copied
Flattern Transparency is not part of OpenOptionsPDF, you have to open the pdf then apply Flattening after the pdf opens
Copy link to clipboard
Copied
Hi Carlos,
After opening the PDF document, then outline text, it is meaningless , because the fonts are missing.
function outlineText() {
while (app.activeDocument.textFrames.length > 0) {
app.activeDocument.textFrames[0].createOutline();
}
}
Copy link to clipboard
Copied
Hi @rui huang, I think you might be able to do what you ask in Acrobat. I don't know of any way to do it in Illustrator for the reason Carlos gave—Illustrator has no power to alter a pdf without first instantiating DOM objects, eg. TextFrames, and by that time, the opportunity is gone. I'd be surprised, however, if Acrobat couldn't do it. I did a quick search and this answer by Scott mentions a way to do it in Acrobat.
- Mark
Copy link to clipboard
Copied
also, opening the pdf as Links will preserve the fonts, at that point you might be able to flatten the file
Copy link to clipboard
Copied
Hi Carlos,
I see you reply in other post, said that can use app.executeMenuCommand('Flatten Transparency'), but it will pop up a window to prompt. the action is not good for user.