Copy link to clipboard
Copied
Hello,
I am trying to save a FM file to PDF from ExtendScript, but for some reason PDFConvertCMYKtoRGB doesn't work. The colors in the PDF produced are wrong.
I have manually checked and the ConvertCMYKtoRGB is definitely the setting that affects the color issue. Manually disabling this setting in the interface and saving to PDF from the interface produces the same colors in the PDF as below script.
var saveParams = GetSaveDefaultParams();
var saveReturnParams = new PropVals();
i = GetPropIndex(saveParams, Constants.FS_FileType);
saveParams[i].propVal.ival = Constants.FV_SaveFmtPdf;
i = GetPropIndex(saveParams, Constants.FS_PDFUseDistiller);
saveParams[i].propVal.ival = 0; // 1 has correct colors, but shows distiller dialog
i = GetPropIndex(saveParams, Constants.FS_AlertUserAboutFailure);
saveParams[i].propVal.ival = 1;
i = GetPropIndex(saveParams, Constants.FS_FileIsInUse);
saveParams[i].propVal.ival = Constants.FV_ResetLockAndContinue;
i = GetPropIndex(saveParams, Constants.FS_SaveFileNotWritable);
saveParams[i].propVal.ival = Constants.FV_DoShowDialog;
doc.PDFConvertCMYKtoRGB = 1;
doc.PDFDistillerAbsent = 1;
doc.PDFJobOption = "High Quality Print";
doc.PDFBookmark = 1;
doc.PDFBookmarksOpenLevel = Constants.FV_PDFBookmarksOpenDefaultLevel;
docProps = doc.GetProps();
for (i = 0; i < docProps.length; i++) {
// print props to check if PDFConvertCMYKtoRGB is set to 1
$.writeln(docProps[i].propIdent.num + " " + docProps[i].propVal.ival);
}
doc.Save(pdfName, saveParams, saveReturnParams);
Anyone know why this doesn't work ?
Copy link to clipboard
Copied
What version of FM are you trying this with? FM2022 patch4 has scripting issues I believe...
Copy link to clipboard
Copied
I have FM2022 patch 3: 17.0.3.546
Copy link to clipboard
Copied
OK, I'd stay on that version until the issues in patch 4 are worked out. Was this script working before & now it's not? Or has it never worked?
Copy link to clipboard
Copied
I just wrote it today for the first time.
The saving to PDF works, just the colors are wrong.
Copy link to clipboard
Copied
Well, part-way there! Maybe @frameexpert will jump in. 😁
Copy link to clipboard
Copied
Color model conversions are almost never fully satisfactory, so I'm wondering what your criteria are.
If manually saving from FM to PDF is producing a different result than scripting the same thing, then there is clearly a software problem. Screenshots of the two outputs might be helpful in the troubleshooting here.
And is it all color images in any FM document, or just some file formats?
Copy link to clipboard
Copied
Hi, here you can see the difference in color. This happens for text front color.
So, if there is no problem with the script content, then it must be a bug in Framemaker and this feature does not work, right?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now