>>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 >>