ActivePDF
Shopping Cart My Account Help Contact Us
Request a Call
Search
Products Solutions Support Downloads Corporate
Submit an Issue
Knowledge Base
Server Product Support
Examples & How-Tos
Support Options
Support Policies
Annual Subscription
Extensions
Documentation
Resource Links
   
 
 
 
 

HomeSupportKnowledge Base
 
activePDF KB #10015 - SetOutputSecurity with Server
activePDF KB #10015 - SetOutputSecurity with Server
Information: Example Printer Version | Return to Search
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
 
Last Updated 2008-01-04 Printer Version | Return to Search
 
Knowledge Base Article Feedback*
*KB article feedback ONLY (submit support issues here)
Quality of this article?
  Poor Excellent 
1 2 3 4 5 6 7 8 9 10
Is this article helpful? Yes       No       Maybe
Comments (Optional)
Email Address (Optional)
Please enter the word "PDF"
(without quotes)
 
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
2003 activePDF Site Map Feedback Privacy Policy Legal