Skip to main content
Inspiring
April 3, 2025
Answered

InDesign script can't seem to set the exported color conversion to NONE

  • April 3, 2025
  • 1 reply
  • 511 views

I have an in design script and part of it is to export selected images to PDF. I want to set the PDF output color conversion to none so there is no color conversion happening, but I can't seem to find the right code to make that work. does anybody know the proper way to do this?

with (app.pdfExportPreferences) {
    pageRange = pageNumber;
    acrobatCompatibility = AcrobatCompatibility.acrobat6;
    exportGuidesAndGrids = false;
    exportLayers = false;
    exportNonPrintingObjects = false;
    exportReaderSpreads = false;
    generateThumbnails = false;
    try { ignoreSpreadOverrides = false; } catch (e) {}
    includeBookmarks = false;
    includeHyperlinks = true;
    includeICCProfiles = false;
    includeSlugWithPDF = false;
    includeStructure = false;
    interactiveElementsOption = InteractiveElementsOptions.doNotInclude;
    subsetFontsBelow = 100;
    colorBitmapCompression = BitmapCompression.NONE;
    colorBitmapSampling = Sampling.BICUBIC_DOWNSAMPLE;
    colorBitmapSamplingDPI = 400;
    grayscaleBitmapCompression = BitmapCompression.NONE;
    grayscaleBitmapSampling = Sampling.BICUBIC_DOWNSAMPLE;
    grayscaleBitmapSamplingDPI = 400;
    monochromeBitmapCompression = BitmapCompression.NONE;
    monochromeBitmapSampling = Sampling.BICUBIC_DOWNSAMPLE;
    monochromeBitmapSamplingDPI = 1200;
    compressionType = PDFCompressionType.compressNone;
    compressTextAndLineArt = true;
    cropImagesToFrames = true;
    optimizePDF = true;

    colorConversion = PDFColorConversion.NONE; //How do i get this to work?
    //colorConversion = app.pdfExportPreferences.colorConversion.NONE;
    destinationProfile = "";
    //destinationProfile = "GRACoL2013_CRPC6"; // optional?
    includeICCProfiles = true; 
}
Correct answer Robert at ID-Tasker

Selection is the wrong word. I have a dialog that I choose a page from and it exports that page as a pdf.  


I think it's this:

 

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#PDFColorSpace.html#d1e80571

 

I've checked pretty much whole DOM 😉 and that's the only thing that makes sense...

 

1 reply

Robert at ID-Tasker
Legend
April 3, 2025

Let me guess - ChatGPT failed again? 

 

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#PDFExportPreference.html

 

There is no "colorConversion" property... Not in the whole InDesign's DOM...

 

ChatGPT is hallucinating again... 

 

Inspiring
April 3, 2025

Yeah, I saw it https://developer.adobe.com/indesign/dom/api/p/PDFExportPreference/ but the fine folks on this forum have helped me out so many times I thought maybe, just maybe there would be a way. Thanks for you time. 

Inspiring
April 3, 2025

I think it's this:

 

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#PDFColorSpace.html#d1e80571

 

I've checked pretty much whole DOM 😉 and that's the only thing that makes sense...

 


I knew I could count on this community! It works, thank you!