EncryptPDFDocument doesn't work in DLL interface

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
holing1123
Posts: 5
Joined: Thu Jul 31 2003

EncryptPDFDocument doesn't work in DLL interface

Post by holing1123 »

I'm using the PDF Converter developer version 2.02, and using the DLL api interface to generate the PDF file.

I'm trying to protect a pdf file using EncryptPdfDocument.
But the DLL does not have a function declaration call "SetLicenseKeyA".

So I just run the function as follow
EncryptPdfDocument("c:\test.pdf", '123456', '654321', -64) and returns 0.
Then I run the function GetLastErrorMsg() and returns "The operation completed successfully."

I don't want to use the ActiveX interface to complete this task.

Any idea?

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

Post by Joan »

Hello,

Do you have the Professional or End User version of the driver?

The Encrypt function is a vailable only in the Pro version.

The function in the DLL is called SetLicenseKey, if you are using an application where SetLicenseKey is a reserved word you can specify another name like SetLicenseKey when declaring he function.

Best Regards.
holing1123
Posts: 5
Joined: Thu Jul 31 2003

Post by holing1123 »

Hi,

I'm using "dumpbin cdintf.dll /exports" to export the functions included in the DLL. As following:

1 0 00002CE5 BatchConvertEx
3 1 00002422 CDICreateDC
4 2 00001BBB CaptureEvents
5 3 00002B30 ConcatenateFiles
6 4 00001531 DllCanUnloadNow
7 5 0000151D DllGetClassObject
8 6 00001536 DllRegisterServer
9 7 000015E6 DllUnregisterServer
10 8 00001AF9 DriverEnd
11 9 00001A61 DriverInit
12 A 000019C9 EMFDriverInit
13 B 00002C5D EncryptPDFDocument
14 C 00003824 GLock
15 D 0000387F GUnlock
16 E 00002071 GetCompression
17 F 00001647 GetDocumentTitle
18 10 00002365 GetFontEmbedding
19 11 000022A8 GetHTMLMultipleHTMLs
20 12 000021EB GetHTMLUseLayers
21 13 000025F9 GetHorizontalMargin
22 14 0000212E GetJPEGCompression
23 15 000026BA GetJPegLevel
24 16 000015F0 GetLastErrorMsg
25 17 00001EF1 GetOrientation
26 18 00001E34 GetPaperLength
27 19 00001CB6 GetPaperSize
28 1A 00001D77 GetPaperWidth
29 1B 00002AD5 GetPrinterAttributes
30 1C 0000283C GetRTFFullRTF
31 1D 000029B6 GetRTFTextOnly
32 1E 000028F9 GetRTFTextRTF
33 1F 00001FB2 GetResolution
34 20 0000277B GetVerticalMargin
35 21 00001931 HTMLDriverInit
36 22 00002C62 LinearizePDFDocument
37 23 00003707 Lock
38 24 00002BC0 MergeFiles
39 25 00001801 PDFDriverInit
40 26 00001899 RTFDriverInit
41 27 0000259A RestoreDefaultPrinter
42 28 000030E8 SendMail
2 29 000031FF SendMailW
43 2A 00002C67 SendMessagesTo
44 2B 00001B59 SetBookmark
45 2C 000020CC SetCompression
46 2D 0000247D SetDefaultConfig
47 2E 000024DC SetDefaultConfigEx
48 2F 000016D6 SetDefaultDirectory
49 30 0000173D SetDefaultFileName
50 31 0000253B SetDefaultPrinter
51 32 0000357F SetEmailFieldBCC
52 33 0000351D SetEmailFieldCC
53 34 000034BB SetEmailFieldTo
54 35 00003643 SetEmailMessage
55 36 000036A5 SetEmailPrompt
56 37 000035E1 SetEmailSubject
57 38 0000179F SetFileNameOptions
58 39 000023C0 SetFontEmbedding
59 3A 00002303 SetHTMLMultipleHTMLs
60 3B 00002246 SetHTMLUseLayers
61 3C 00002658 SetHorizontalMargin
62 3D 00001C19 SetHyperLink
63 3E 00002189 SetJPEGCompression
64 3F 00002719 SetJPegLevel
65 40 00001F50 SetOrientation
66 41 00001E8F SetPaperLength
67 42 00001D15 SetPaperSize
68 43 00001DD2 SetPaperWidth
69 44 00002A73 SetPrinterAttributes
70 45 00002897 SetRTFFullRTF
71 46 00002A11 SetRTFTextOnly
72 47 00002954 SetRTFTextRTF
73 48 0000200D SetResolution
74 49 00003395 SetServerAddress
75 4A 000033F7 SetServerPort
76 4B 00003459 SetServerUsername
77 4C 000027DA SetVerticalMargin
78 4D 00001C3F SetWatermark
79 4E 000037C6 TestLock
80 4F 00003765 Unlock

As you can see, I only can get the function "EncryptPDFDocument" but not "SetLicenseKey".

Moreover, the driver is no need to set the license key before I generate the PDF document.

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

Post by Joan »

Hello,

Yes, if you are using version 2.02 than you don't need to call SetLicenseKey() this function exists only in version 2.10.

When you mentioned SetLicenseKeyA in your post i didn't really pay attention to the version number anymore so I thought that you are using the latest version.

GetLastErrorMsg is not really signigicant in this case. EncryptPDFDocument() should return True if succfull and False otherwise. if the function is returning 0 than you may not have the Professional version of the driver or something wrong is happening in the process, please check this issue with our Support Department support@amyuni.com so they can check what license you have and what is going in your code.

Thanks.
Post Reply