Skip to main content
Participating Frequently
March 18, 2015
Question

makePDFPresentation - poor shape output quality

  • March 18, 2015
  • 4 replies
  • 1264 views

I have a custom script I've made to make layer compositions then output them into a multi-page PDF. The only way I can current see of doing that is with the makePDFPresentation() method. Everything works brilliantly EXCEPT the output multi-page PDF has really badly simplified vector shapes. They're still vector, but they're badly simplified. See the attached image which shows a PDF output in the normal way on the left, and using makePDFPresentation() on the right - notice the horrible wiggling in the 'x' in particular. I'm using the exact same PDFSaveOptions() in both.

So I know makePDFPresentation() is supposed to be DEPRECATED as per CS4 (but it still seems to generally work) but I can't see an alternative option to output a multi-page PDF.

Does anyone know if this is a bug in makePDFPresentation() or an intended 'feature', and also if there's a better way to output layer comps to a single multi-page PDF using just one script/click within Photoshop (rather than having to manually put multiple PDF pages together, or run one script in Ps then another somewhere else).

Thanks

This topic has been closed for replies.

4 replies

Pedro Cortez Marques
Legend
March 20, 2015

This very interesting.

I've manage to send my photoshop Notes directly to PDF using Philip Cord code.

I have also discovered how to add other PresentationOptions:

// [...]

desc4.putEnumerated( charIDToTypeID('BckC'), charIDToTypeID('BckC'), charIDToTypeID('Blck') ); // 'Blck':black | 'Wht ':white

// how to include FONT SIZE ?????????????? 

desc4.putBoolean( stringIDToTypeID('includeFilename'), true );

desc4.putBoolean( stringIDToTypeID('includeExtension'), true );

desc4.putBoolean( stringIDToTypeID('includeTitle'), true );

desc4.putBoolean( stringIDToTypeID('includeDescription'), true );

desc4.putBoolean( stringIDToTypeID('includeAuthor'), true );

desc4.putBoolean( stringIDToTypeID('includeCopyright'), true );

// how to include EXIF Info ??????????????

desc4.putBoolean( stringIDToTypeID('includeAnnotations'), true );

// [...]

Regarding PDF Presets and the poor quality shape over paths, I have found that I can create first my own PDF Preset under Edit > Adobe PDF Presets...

The problem is that the option to disable the path compression, on Photoshop PDF Preset manager, doen't exist (we have it on Indesign PDF Preset compression manager).

But I had success to create a new PDF Preset on Indesign removing path compression, restart Photoshop, and the PDF Preset was accessible also on Photoshop.

It might be possible to use the code changing the new PDF Preset name I have created.

// [...]

desc5.putString( stringIDToTypeID('pdfPresetFilename'), "MyPreset" );

// [...]

But I did not tested it.

This are the PDF Preset managers on Indesign and Photoshop:

Inspiring
March 20, 2015

Here you are.

desc4.putBoolean( stringIDToTypeID('includeEXIFData'), true );

desc4.putInteger( stringIDToTypeID('fontSize'), 12 );

beckylushAuthor
Participating Frequently
March 20, 2015

Pedro, I tried as you suggested and the tickbox in question for "compress text and line art" changes this line in the .joboptions file:

/CompressPages true

... I tried using makePDFPresentation() twice, once with a .joboptions with this set to true and one without (via PDFSaveOptions .presetFile) but the output was the same both times - shapes/paths being mangled.

I have a working solution using InDesign at the moment which gets Photoshop to output a separate temporary PDF for each layer comp then does this magic:

function indesignCombine(pdfs, filename) {

  var script = [];

  script.push('var input_pdfs = ["' + pdfs.join('", "') + '"]');

  script.push('var doc = app.documents.add();');

  script.push('with (doc.documentPreferences) {');

  script.push(' pageWidth = "392mm";');

  script.push(' pageHeight = "270mm";');

  script.push(' pageOrientation = PageOrientation.landscape;');

  script.push(' pagesPerDocument = input_pdfs.length;');

  script.push(' documentBleedUniformSize = true;');

  script.push(' documentBleedTopOffset = 0;');

  script.push(' facingPages = false;');

  script.push('}');

  script.push('app.pdfPlacePreferences.pdfCrop = PDFCrop.cropMedia;');

  script.push('for (var i=0; i<input_pdfs.length; ++i) doc.pages.place(File(input_pdfs));');

  // TODO: set InDesign pdf options

  script.push('doc.exportFile(ExportFormat.pdfType, File("' + filename + '"));');

  script.push('doc.close(SaveOptions.no);');

  script = script.join("\n");

  var timeout = 120; // max time for indesign bit to run

  var bt = new BridgeTalk;

  bt.target = 'indesign';

  bt.body = script;

  // bt.onResult = function(data) {callback();}; // not needed as sync with .send(timeout)

  bt.onError = function(err) { alert('error: ' + err); };

  bt.onTimeout = function(msg) { alert('InDesign timeout: ' + timeout + 's - please ask Jake to increase the timeout ' + msg); }; // hmm, never called?

  bt.send(timeout); // by specifying a timeout (in seconds) it is sync not async :)

}

I'd love to find a way to do it without using InDesign (and I still need to work on my todo re indesign pdf options and the indesign docs seem really poor for this!) but looks like it's this way for now at least.

matias.kiviniemi
Legend
March 19, 2015

Is there some issue in enabling one layer comp, using doc.saveAs, enabling next comp, etc. in a script? If it's just having in one PDF, you'd probably be better off merging output PDFs manually.

beckylushAuthor
Participating Frequently
March 19, 2015

Yes, I can do that fine Matias, but what I want here is a single multi-page PDF. I'm currently coding that by invoking InDesign from a Photoshop script and I'm having good success so far

beckylushAuthor
Participating Frequently
March 18, 2015

To clarify, doc.saveAs(pdf, pdfOptions(), true, Extension.LOWERCASE); works perfectly whilst makePDFPresentation() causes the shape vector quality loss, both using the same PDFFileOptions.

c.pfaffenbichler
Community Expert
Community Expert
March 18, 2015

Does it happen both when you create the pdf presentation manually and via Script?

Have you tried DOM and AM code?

beckylushAuthor
Participating Frequently
March 18, 2015

How do you create a pdf presentation manually? I'm not sure if you can. I've used Adobe's script "Export comps to PDF..." and I get the same (poor) output.

I'm new to scripting and haven't tried AM, only DOM - wouldn't know where to start with AM.

c.pfaffenbichler
Community Expert
Community Expert
March 18, 2015

How do you create a pdf presentation manually?

File > Automate > PDF Presentation

I'm new to scripting and haven't tried AM, only DOM - wouldn't know where to start with AM.

Record the operation with ScriptingListener.plugin, then isolate the pertinent code and adapt it as needed (wrap it in a function for example).