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 VBScript example demonstrates the SetOutputSecurity methods, which add 40-bit or 128-bit security to the output PDF. The SetOutputSecurity methods enable features such as disabling the use of print or copy commands with the output PDF or requiring a password to view the file. Here, SetOutputSecurity128 is used with the PSToPDF method, but with minor modifications you could use ImageToPDF or StartPrinting.

NOTE: You must call the security method before PSToPDF, ImageToPDF, or StartPrinting.

These files are required:
  • File.PS - The PostScript® file to convert to PDF.
  • SetOutputSecurity(PSToPDF).VBS - Code detail provided below.
Click here to download this example (includes required files):
' Define Variables
    ' User Password
    varUserPass = "userpass"

    ' Owner Password
    varOwnerPass = "ownerpass"
    
    ' CanPrint (40-bit or 128-bit)
    varPrint = 0
    
    ' CanEdit (40-bit or 128-bit)
    varEdit = 0
    
    ' CanCopy (40-bit or 128-bit)
    varCopy = 0
    
    ' CanModify (40-bit or 128-bit)
    varModify = 0

    ' CanFillInFormFields (128-bit)
    varFillFormFields = 0
 
    ' CanMakeAccessible (128-bit)
    varMakeAccessible = 0
    
    ' CanAssemble (128-bit)
    varAssemble = 0
    
    ' CanReproduce (128-bit)
    varReproduce = 0
    
' Instantiate Object
Set APS = CreateObject("APServer.Object")

' Add 40-bit Encryption to PDF
'APS.SetOutputSecurity varUserPass, varOwnerPass,_
'    varPrint, varEdit, varCopy, varModify

' Add 128-bit Encryption to PDF
APS.SetOutputSecurity128 varUserPass, varOwnerPass,_
    varPrint, varEdit, varCopy, varModify,_
    varFillFormFields, varMakeAccessible, varAssemble, varReproduce

' PS To PDF conversion
varReturn = APS.PSToPDF("file.ps", "ps.pdf")
If varReturn <> 0 Then Error("PSToPDF") End If

' Clear Server Object
Set APS = Nothing

' Conversion Successful
Msgbox "Done!"

' Error Handling
Sub Error(Method)
    Msgbox "'" & Method & "' failed with a '" & varReturn
    Set APS = Nothing
    Wscript.Quit
End Sub
 
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