How I can set restriction to Print the PDF in My PDF file ?

If you are a VB developer and have questions about using our products from VB, here is the place to post them.
Post Reply
kamleshvgujarathi
Posts: 39
Joined: Fri Jan 09 2004
Location: Bombay ( INDIA)
Contact:

How I can set restriction to Print the PDF in My PDF file ?

Post by kamleshvgujarathi » Thu Dec 23 2004

Hello ,

I have created the pdf through amyuni but now I want restrict it
for printing (ie no should be able to print that).

Print option should get disable if some open my pdf in other editor.

and no body should be able to copy the text from pdf

then How it is possible.

code snippet will be prefer. waiting for reply

Thanking You

---------------------------
Kamlesh Gujarathi
kamlesh@itshastra.com

Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan » Tue Dec 28 2004

Hello,

to set restrictions on the pdf document you can do this either using the PDF Converter or the PDF Creator but you need to have the Professional version of these products.

If you are using the PDF Converter to generate the pdf document, you can then open the generated PDF and encrypte it.


Example DLL interface:

Code: Select all

SetLicenseKeyA LicenseTo, ActivationCode
EncryptPDFDocument "c:\Temp\Test.pdf", "Owner", "User", -64
'OR
EncryptPDFDocument128 "c:\Temp\Test.pdf", "Owner", "User", -64
Example ActiveX interface:

Code: Select all

 Dim doc as new CDintfEx.Document
doc.Open "C:\Temp\Test.pdf"
doc.SetLicenseKey LicenseTo, ActivationCode
doc.Encrypt "owner", "user", -64     '40 bits encryption
'OR
doc.Encrypt128 "owner", "user", -64    '128 bits encryption
doc.Save "C:\Temp\Encrypted.pdf"
The permission values are:

Code: Select all

-64+4     EnablePrinting
-64+8     Enable document modification
-64+16   Enable copying text and graphics
-64+32   Enable adding and changing notes
To combine multiple options you can use -64 plus the values 4, 8, 16, 32. eg to enable both printing and adding notes you can use -64+4+32 = 28. To disable all 4 options you need to use -64.

Hope this helps.

Post Reply