Copy link to clipboard
Copied
I want to script some settings for PDF export from InDesign.
But I'm running into syntax problems, the references I have don't show use cases of the code i want to use, so its hit and miss with the syntax
///PDF EXPORT SETTINGS///
app.pdfExportPreference.AcrobatCompatibility.ACROBAT_4;
app.pdfExportPreference.standardsCompliance(PDFXStandards.PDFX1A2001_STANDARD);
app.pdfExportPreference.effectivePDFDestinationProfile(PDFProfileSelector.USE_DOCUMENT);
app.pdfExportPreference.effectivePDFXProfile(PDFProfileSelector.USE_DOCUMENT);
app.pdfExportPreference.pdfColorSpace(PDFColorSpace.CMYK);
app.pdfExportPreference.subsetFontsBelow(0);
app.pdfExportPreference.useDocumentBleedWithPDF = true;
// Flatener Settings //
app.pdfExportPreference.appliedFlattenerPreset(HIGH_RESOLUTION);
app.pdfExportPreference.appliedFlattenerPreset.convertAllStrokesToOutlines = true;
app.pdfExportPreference.appliedFlattenerPreset.convertAllTextToOutlines = true;
app.pdfExportPreference.appliedFlattenerPreset.gradientAndMeshResolution(600);
app.pdfExportPreference.appliedFlattenerPreset.lineArtAndTextResolution(1200);
// Marks //
app.pdfExportPreference.colorBars = false;
app.pdfExportPreference.cropMarks = false;
app.pdfExportPreference.registrationMarks = false;
app.pdfExportPreference.pageInformationMarks = false;
// Bitmap Settings //
app.pdfExportPreference.colorBitmapCompression(BitmapCompression.ZIP);
app.pdfExportPreference.colorBitmapQuality(CompressionQuality.MAXIMUM);
app.pdfExportPreference.colorBitmapSampling(Sampling.NONE);
app.pdfExportPreference.grayscaleBitmapCompression(BitmapCompression.ZIP);
app.pdfExportPreference.grayscaleBitmapQuality(CompressionQuality.MAXIMUM);
app.pdfExportPreference.grayscaleBitmapSampling(Sampling.NONE);
app.pdfExportPreference.monochromeBitmapSampling(Sampling.NONE);
// Document Elements //
app.pdfExportPreference.compressTextAndLineArt = false;
app.pdfExportPreference.exportLayers = false;
app.pdfExportPreference.exportNonprintingObjects =false;
app.pdfExportPreference.exportWhichLayers(ExportLayerOptions.EXPORT_VISIBLE_PRINTABLE_LAYERS);
app.pdfExportPreference.includeBookmarks = false;
app.pdfExportPreference.includeHyperlinks = false;
app.pdfExportPreference.interactiveElementsOption(InteractiveElementsOptions.APPEARANCE_ONLY);
Use the following
app.pdfExportPreferences
Also i just noticed that you are setting values incorrectly. If you refer to the links i shared you would see that effectivePDFDestinationProfile is a property and not a method and hence you can't use the () syntax to assign it. For properties you use the = sign for assigning values and () are used for methods
Also if you notice then effectivePDFDestinationProfile is a readonly value so you can't set it directly.
-Manan
Copy link to clipboard
Copied
You did not tell what exactly is the error that you are getting, in order to look at what the properties are and what the possible values they can take look at the DOM reference
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#PDFExportPreference.html
Also you might want to use a pdf preset, look at it
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#PDFExportPreset.html
-Manan
Copy link to clipboard
Copied
Hi Manan,
This is the error I'm getting
Copy link to clipboard
Copied
Use the following
app.pdfExportPreferences
Also i just noticed that you are setting values incorrectly. If you refer to the links i shared you would see that effectivePDFDestinationProfile is a property and not a method and hence you can't use the () syntax to assign it. For properties you use the = sign for assigning values and () are used for methods
Also if you notice then effectivePDFDestinationProfile is a readonly value so you can't set it directly.
-Manan
Find more inspiration, events, and resources on the new Adobe Community
Explore Now