makePDFPresentation in tk-photoshopcc

Hi All,

I’ve been having issues with getting makePDFPresentation to work from inside a hook. I have no issues with exporting or saving via the hook, but I can’t get the equivalent of File>Automate>PDF Presentation to make a multipage PDF to work when using makePDFPresentation. Here’s a sample of what I was testing by throwing it in the validate method

publisher = self.parent
engine = publisher.engine

token_files = []
input_folder = 'pathToFolderWithAllTheImages'
out_file = engine.adobe.File('pathForCombinedPDF')

for file in os.listdir(input_folder):
	token_files.append(engine.adobe.File(file))

presentation_options = engine.adobe.PresentationOptions()
presentation_options.presentation = True
presentation_options.view = True
	
engine.adobe.makePDFPresentation(out_file, out_file, presentation_options) 

Any idea why this always throws rpc errors? Or is there another way to create a multipage pdf without using makePDFPresentation?

Thanks,
Tim

I see two kinds of RPC errors dealing with the adobe frameworks. One is a time out. It will only wait 5 minutes before crashing. If your operation takes longer, it will never succeed. You can fix that like I did here.

For other ‘parsing’ errors I use something like this…

rpc_cmd = ‘app.load(File("’+path+’"))’
results = self.engine.adobe.rpc_eval(rpc_cmd)

Give that a try. It usually works when all else fails.

Daniel