Copy link to clipboard
Copied
Hello, Proficient Expert,
I build a new post to discussthis issue about Flatten Transparency, Is there a better way to solve it with AI, besides using app.executeMenuCommand('Flatten Transparency')?
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var pdfOptions = app.preferences.PDFFileOptions;
pdfOptions.pageRangeToOpen = "all";
pdfOptions.placeAsLinks = true;
var idoc = app.open(File("~/Desktop/test.pdf"));
app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;var doc = app.activeDocument;
var pItems = doc.placedItems;
for(var i=pItems.length-1; i>=0; i--){
pItems[i].selected = true;
app.executeMenuCommand('Flatten Transparency') ;
}
below script without pop up a window, have to basic on the preset in the window of 'Flatten Transparency'. if the preset is change , all will be changed, there is risk to proceed pdf file. whether can make the preset with script ?
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var pdfOptions = app.preferences.PDFFileOptions;
pdfOptions.pageRangeToOpen = "all";
pdfOptions.placeAsLinks = true;
var idoc = app.open(File("~/Desktop/test.pdf"));
var doc = app.activeDocument;
var pItems =
Copy link to clipboard
Copied
below script without pop up a window, have to basic on the preset in the window of 'Flatten Transparency'. if the preset is change , all will be changed, there is risk to proceed pdf file. whether can make the preset with script ?
app.userInteractionLevel = UserInteractionLevel.DONTDISPLAYALERTS;
var pdfOptions = app.preferences.PDFFileOptions;
pdfOptions.pageRangeToOpen = "all";
pdfOptions.placeAsLinks = true;
var idoc = app.open(File("~/Desktop/test.pdf"));
var doc = app.activeDocument;
var pItems = doc.placedItems;
for(var i=pItems.length-1; i>=0; i--){
pItems[i].selected = true;
app.executeMenuCommand('Flatten Transparency') ;
}
app.userInteractionLevel = UserInteractionLevel.DISPLAYALERTS;
Copy link to clipboard
Copied
I had also asked for help to create a script that imported PDF files into multiple artboards, and then applied a transparency conversion with a preset profile. But no one helped me. Probably no one knows how to do it.
https://community.adobe.com/t5/illustrator-discussions/script-help-import-file-to-artboards-and-flat...
Copy link to clipboard
Copied
Untested, but should be possible:
In your Script
Save as PDF with PDFSaveOptions flattenerPreset: string (the name of your preset)
Sent from my phone
Copy link to clipboard
Copied
must convert text to outline when open, because pdf file may be missing font , so will show error char.
Copy link to clipboard
Copied
I think you know that it carries the risk of preset changes affecting all documents and as currently there's no direct script to set the preset for Flatten Transparency....... you can mitigate risks by specifying the transparency flattening settings programmatically within your script.
It involves simple things like you've to define the necessary parameters such as raster resolution and color conversion options to match your desired preset. By setting these parameters in your script, you ensure consistent and controlled flattening without relying on manual presets. You can also explore Adobe's scripting documentation for any updates or alternative approaches to achieve this task more effectively.
Copy link to clipboard
Copied
who did you actually answer?
Copy link to clipboard
Copied
because PC may be missing font, must convert all text to outline when open, how to preset this ?