Problem with Encryption in VFP

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
calvin
Posts: 9
Joined: Fri Apr 02 2004

Problem with Encryption in VFP

Post by calvin »

When I run this code in Visual Foxpro 7.0:

PDFviewer = CREATEOBJECT("PDFCreactiveX.PDFCreactiveX")

PDFviewer.setlicenseKey(mylicname,mylicensenumber)

cfile=GETFILE('pdf')

pdfviewer.Open(cfile,'')
numpages=pdfviewer.pagecount
PDFviewer.currentpage = 1
pdfviewer.Encrypt("mypassword", "", 4294967232)
pdfviewer.Save("test1.pdf", 1)

The encrypt line gives me the error:
OLE error code : 0x8002000a: Out of present range

What am I doing wrong?
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Please use FFFFFFC0 as Hexadecimal value in your code or if you want to use a decimal value please use -64.

Try to call:
pdfviewer.Encrypt("mypassword", "", -64)

It should work.
Post Reply