Hello all.
Anyone out there had any luck getting a Scripted, automated way to save a PDF out of Photoshop with Password protection?
This post here on the Adobe Forums, from Mark is discouraging.
http://forums.adobe.com/message/4306725#4306725
You can do it in the GUI of course, but I need some way to automate way to secure the PDF's coming out of my script. I see parameters like PDFSaveOptions.outputCondition ... not sure how to utilize this, or even if it would be a help. But it sounds promising? Anyone know where I can get more info?
If you really can't do it in Photoshop, then I'm open to using an external command line app. (via JSX File.execute() ) but it would have to be good for Mac and PC. ( http://www.pdfforge.org - looked promising, but its PC only) Or maybe I look into doing the JPG-PDF conversion server side..? argh not sure.
So I'm reaching out to the awesome community here. Any Suggestions?
Saving PDF with Password Security?
-
pfaffenbichler
Saving PDF with Password Security?
Have you tried recording a generating a password protected pdf with ScriptingListener.plugin?
Is the step identifiable in the resulting code?
Is the step identifiable in the resulting code?
-
PhotoSpot_scripter
Saving PDF with Password Security?
Tried that... and I can't see anything that sets the security settings comming out of listener.
Even tried to save a preset with security settings on, but when you load the preset, the security does not come with it.
(This is the first case I've seen where something that can be done in both Photoshop and Illustrator, is Scriptable in AI and NOT in PS! ... usually its the other way around. My client does not have AI or AcrobatPro though, so that's not an option. )
Here's the scripting code when I load the preset "with security" (that actually does not load security settings), and then I re-set the security by hand before saving. Here's what the listener gives me. ....nothing about the password or security. Just looks like its NOT scriptable in PS?
// =======================================================
var idsave = charIDToTypeID( "save" );
var desc27 = new ActionDescriptor();
var idAs = charIDToTypeID( "As " );
var desc28 = new ActionDescriptor();
var idpdfPresetFilename = stringIDToTypeID( "pdfPresetFilename" );
desc28.putString( idpdfPresetFilename, """Adobe PDF Preset WSecurity""" );
var idPhtP = charIDToTypeID( "PhtP" );
desc27.putObject( idAs, idPhtP, desc28 );
var idIn = charIDToTypeID( "In " );
desc27.putPath( idIn, new File( "C:/SomePath/SomefileName.pdf" ) );
var idDocI = charIDToTypeID( "DocI" );
desc27.putInteger( idDocI, 201 );
var idsaveStage = stringIDToTypeID( "saveStage" );
var idsaveStageType = stringIDToTypeID( "saveStageType" );
var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
desc27.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
executeAction( idsave, desc27, DialogModes.NO );
Even tried to save a preset with security settings on, but when you load the preset, the security does not come with it.
(This is the first case I've seen where something that can be done in both Photoshop and Illustrator, is Scriptable in AI and NOT in PS! ... usually its the other way around. My client does not have AI or AcrobatPro though, so that's not an option. )
Here's the scripting code when I load the preset "with security" (that actually does not load security settings), and then I re-set the security by hand before saving. Here's what the listener gives me. ....nothing about the password or security. Just looks like its NOT scriptable in PS?
// =======================================================
var idsave = charIDToTypeID( "save" );
var desc27 = new ActionDescriptor();
var idAs = charIDToTypeID( "As " );
var desc28 = new ActionDescriptor();
var idpdfPresetFilename = stringIDToTypeID( "pdfPresetFilename" );
desc28.putString( idpdfPresetFilename, """Adobe PDF Preset WSecurity""" );
var idPhtP = charIDToTypeID( "PhtP" );
desc27.putObject( idAs, idPhtP, desc28 );
var idIn = charIDToTypeID( "In " );
desc27.putPath( idIn, new File( "C:/SomePath/SomefileName.pdf" ) );
var idDocI = charIDToTypeID( "DocI" );
desc27.putInteger( idDocI, 201 );
var idsaveStage = stringIDToTypeID( "saveStage" );
var idsaveStageType = stringIDToTypeID( "saveStageType" );
var idsaveSucceeded = stringIDToTypeID( "saveSucceeded" );
desc27.putEnumerated( idsaveStage, idsaveStageType, idsaveSucceeded );
executeAction( idsave, desc27, DialogModes.NO );
-
pfaffenbichler
Saving PDF with Password Security?
Just looks like its NOT scriptable in PS?
It looks that way to me, too.
It looks that way to me, too.
-
PhotoSpot_scripter
Saving PDF with Password Security?
Frustrating.
Anyone out there know a command line PDF creator that has security?
...(possibly a question for a different forum, but throwing it out there just in case.) ...
Anyone out there know a command line PDF creator that has security?
...(possibly a question for a different forum, but throwing it out there just in case.) ...