Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Saving to PDF from script - how do I set the PDF version ?

Advocate ,
Apr 27, 2023 Apr 27, 2023

I have a script that saves my files to PDF, using the following lines:

	var oaParams = GetSaveDefaultParams( );
	
	i = GetPropIndex( oaParams, Constants.FS_FileType );
	oaParams[i].propVal.ival = Constants.FV_SaveFmtPdf;
	
	i = GetPropIndex( oaParams, Constants.FS_PDFUseDistiller );
	oaParams[i].propVal.ival = 0;

My customer now asks me to generate PDF 1.7 instead of the current 1.6. Does anyone know where I can set this property ? 

TOPICS
PDF output
632
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2023 Apr 27, 2023

There is roundabout way to get there, but I don't think it can be done through ExtendScript. If your code doesn't use Distiller, I am pretty sure it uses the current settings in the Publish panel. When you edit the sts and its PDF area, you will see a preset, for example, Standard. You can load custom job options files by clicking the browse button.

 

On my system, the job options files are located here: C:\ProgramData\Adobe\Adobe PDF\Settings. If you open one of the joboptions file with a text editor, you will see this line (around line 12):

 

/CompatibilityLevel 1.6

 

You can try changing this and running your script again and see if it gives you the result you want. When you open your PDF, go to File > Properties and choose the Description tab. It will show you the PDF version at the lower part of the dialog box.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 27, 2023 Apr 27, 2023

I tried this and it didn't change the PDF Level in the resulting PDF. Apparently, I am missing something.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 02, 2023 May 02, 2023

... and how about just setting up an appropriate JobOptions file with all the required properties - and then referring to it?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 02, 2023 May 02, 2023

In FM-15 FDK Reference I find this:

«FP_PDFJobOption (StringT) The name of the Distiller Job Options followed by compliance and compatibility values. If the specified name does not exist in the Distiller Job Options list, then the first Distiller Job Option in the list is used.

If the Job Option name is 'J' and its compliance and compatibility are 'L' and 'T' respectively, then the returned list is JLTJLTJLT.»

It seems that we need somethin like this

i = GetPropIndex( oaParams, Constants.FP_PDFJobOption);
oaParams[i].propVal.sval = "StandardPDF/A-1b(Acroat 5.0 Compatible)Acrobat 5 (PDF 1.4)";

But for me the format of this string is not clear at all to me: How to distinguish between the three fields? Are the terms in () required or not?

FDK Programmer Guide does not give any further information on this subject.

The FM 15 Scripting Guide referes to a constant PDFJobOption:

«PDFJobOption string Denotes the name of the Distiller Job Option. If the specified name does not exist in the Distiller Job Options list, then the first Distiller Job Option in the list is used. - but that's all - it is not explained in an example or else.»

► Obviously this has not been updated to contain the same information as in the FDK... And there is no further metion of its use.

► So we are left to specualtion, voodoo and experiments.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
May 02, 2023 May 02, 2023
LATEST

I am not using Distiller. I don't think it is installed on my system, and I cannot even find any joboptions file. But maybe it is hidden in one of the 100 subfolders of FrameMaker.

 

I sent a question to the Adobe dev team asking where this property can be set when using the SaveFmtPdf. I will post an answer here when I get it - or when I have figured it out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines