Skip to main content
4everJang
Legend
Apr 27, 2023 10:04 AM UTC
Question

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

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 ? 

This topic is closed to new replies. Start a new post to keep the conversation going.

5 replies

frameexpert
Community Expert
Community Expert
Apr 27, 2023 11:49 AM UTC

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
www.frameexpert.com
frameexpert
Community Expert
Community Expert
Apr 27, 2023 12:21 PM UTC

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

Translate
www.frameexpert.com
K.Daube
Community Expert
Community Expert
May 2, 2023 6:20 PM UTC

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

Translate