activePDF KB #10015 - SetOutputSecurity with Server
activePDF KB #10015 - SetOutputSecurity with Server
SetOutputSecurity with Server
Product
Code Samples
Server
VBS ASP CF
Description
The following ColdFusion® example demonstrates the SetOutputSecurity method, which adds 40-bit security to the output PDF.
These files are required:File.PS - The PostScript® file to convert to PDF.SetOutputSecurity(PSToPDF).CFM - Code detail provided below.
Click here to download this example (includes required files) :
<!--- Define Variables --->
<!--- User Password --->
<CFSET varUserPass = "userpass" >
<!--- Owner Password --->
<CFSET varOwnerPass = "ownerpass" >
<!--- CanPrint (40-bit or 128-bit) --->
<CFSET varPrint = 0 >
<!--- CanEdit (40-bit or 128-bit) --->
<CFSET varEdit = 0 >
<!--- CanCopy (40-bit or 128-bit) --->
<CFSET varCopy = 0 >
<!--- CanModify (40-bit or 128-bit) --->
<CFSET varModify = 0 >
<!--- CanFillInFormFields (128-bit) --->
<CFSET varFillFormFields = 0 >
<!--- CanMakeAccessible (128-bit) --->
<CFSET varMakeAccessible = 0 >
<!--- CanAssemble (128-bit) --->
<CFSET varAssemble = 0 >
<!--- CanReproduce (128-bit) --->
<CFSET varReproduce = 0 >
<!--- Instantiate Object --->
<CFOBJECT ACTION = "Create"
TYPE = "COM"
CLASS = APServer.Object
NAME = "APS" >
<!--- Add 40-bit Encryption to PDF --->
<!--- <CFSET APS.SetOutputSecurity varUserPass, varOwnerPass,
varPrint, varEdit, varCopy, varModify> --->
<!--- Add 128-bit Encryption to PDF --->
<CFSET APS.SetOutputSecurity128 ( varUserPass , varOwnerPass ,
varPrint , varEdit , varCopy , varModify ,
varFillFormFields , varMakeAccessible , varAssemble , varReproduce ) >
<!--- PS To PDF conversion --->
<CFSET varReturn = APS.PSToPDF ( ExpandPath ( "file.ps" ),
ExpandPath ( "ps.pdf" )) >
<CFIF varReturn lt 0 OR varReturn gt 0 >
<CFOUTPUT> #Error("PSToPDF")# </CFOUTPUT>
</CFIF>
<!--- Clear Server Object --->
<CFSET ReleaseComObject ( APS ) >
<!--- Conversion Successful --->
<CFOUTPUT> Done! </CFOUTPUT>
<!--- Error Handling --->
<CFFUNCTION name = "Error" >
<CFARGUMENT name = "method" required = "Yes" >
<CFOUTPUT>
'#method#' failed with a '#varReturn#'
</CFOUTPUT>
<CFSET ReleaseComObject ( APS ) >
<CFABORT>
</CFFUNCTION>
Keywords
PSetOutputSecurity, image, start, printing, startprinting, imagetopdf, Post, Script, PostScript, To, Convert, Server, 40, bit, 128, method, methods, property, properties, asp, cfm, cf, coldfusion, cold, fusion, VBS, VBScript, vb, script, example, sample
The information in this article is for the use of activePDF Customers and Evaluation Users Only. No part of this document may be transmitted or reproduced without the express written consent of activePDF.
Copyright © 2005, activePDF, Inc. All Rights Reserved