Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Incorporating DLL File in VFP program
Message
 
To
19/12/2013 04:30:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01590624
Message ID:
01590625
Views:
97
This is VFP version of VB code.
I removed events (button click)
Declare INTEGER apCreate   IN ps2pdf.dll
Declare         apClose   IN ps2pdf.dll INTEGER id
Declare INTEGER apConvert IN ps2pdf.dll INTEGER id
Declare INTEGER apSetFunc IN ps2pdf.dll INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2
Declare INTEGER apGetFunc IN ps2pdf.dll INTEGER id, INTEGER code, INTEGER nOptVal1, INTEGER nOptVal2, STRING pOptVal1, STRING pOptVal2


#define AP_Set_Output     3000
#define AP_Set_Input      3001
#define AP_Set_PDFInfo    3006
#define AP_Set_PDFEncrypt 3007


*Supported pdf header information
#define AP_PDF_TITLE       "title"
#define AP_PDF_SUBJECT     "subject"
#define AP_PDF_AUTHOR      "author"
#define AP_PDF_KEYWORDS    "keywords"
#define AP_PDF_APPLICATION "creator"


*Supported encryption mode
#define AP_PDF_ENCRYPT_40   40
#define AP_PDF_ENCRYPT_128 128

*Supported user access permissions
#define AP_PDF_PERMISSION_NONE     0
#define AP_PDF_PERMISSION_PRINT    1
#define AP_PDF_PERMISSION_COPYING  2
#define AP_PDF_PERMISSION_MODIFY   4
#define AP_PDF_PERMISSION_ALL      7


** Convert ps files to a general pdf file.
id = apCreate()
IF (id # 0)
   apSetFunc(id, AP_Set_Input , 0, 0, "test1.ps" , 0)  &&input file.
   apSetFunc(id, AP_Set_Input , 0, 0, "test2.ps" , 0)  &&input file.
   apSetFunc id, AP_Set_Output, 0, 0, "test1.pdf", 0) &&output format and file.
    
   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_TITLE      , "untitled document")
   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_AUTHOR     , "adultpdf")
   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_APPLICATION, "PS to PDF sdk demo")
   iRet = apConvert(id)
   apClose(id)
ENDIF


* Convert ps files to an restricted pdf file.
sUserPw  = "1111"
sOwnerPw = "2222"
    
id = apCreate()
IF (id # 0)
   apSetFunc(id, AP_Set_Input , 0, 0, "test1.ps" , 0)  &&input file.
   apSetFunc(id, AP_Set_Input , 0, 0, "test2.ps" , 0)  &&input file.
   apSetFunc id, AP_Set_Output, 0, 0, "test1.pdf", 0) &&output format and file.
    
   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_TITLE      , "untitled document")
   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_AUTHOR     , "adultpdf")
   apSetFunc(id, AP_Set_PDFInfo, 0, 0, AP_PDF_APPLICATION, "PS to PDF sdk demo")
        
   apSetFunc(id, AP_Set_PDFEncrypt, AP_PDF_ENCRYPT_128, AP_PDF_PERMISSION_PRINT + AP_PDF_PERMISSION_COPYING, sUserPw, sOwnerPw)
   
   iRet = apConvert(id)
   apClose(id)
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform