源檔案的說明如下:
OpenPDF(filename, ignore protect, user pass, owner pass, pdf handle )
Description:
Opens the PDF file for reading and loads the catalog of the pdf for information on the document (such as
number of pages).
Input Fields:
Filename Char * Contains the full path and filename for the input PDF file.
Ignore Protect BOOL TRUE – Ignores password protection on the PDF
FALSE – Passwords will be used (if needed)
User password Char * Password for the person USING the pdf
Owner password Char * Password for the creator of the pdf
Pdf Handle long * Handle for the open PDF
Return codes:
LONG Status returned:
0 – success
1 - couldn't open the PDF file
2 - couldn't read the page catalog
3 - PDF file is damaged
4 - file is encrypted and password was incorrect or not supplied
5 – User does not have permission to read
Usage:
long pdf;
long status;
status = OpenPDF("input.pdf", TRUE, NULL, NULL, &pdf );
我在pb中的使用程序如下
外部宣告:
Function long OpenPDF(string filename, Boolean protect, Boolean userpass, Boolean ownerpass, ref long pdfhandle) Library "SII_PDF.dll"
使用方式如下:
long flag1,flag2
long pdfhandle
string ls_s
ls_s="d:\save\00967.pdf"
string ls_m
ls_m='d:\save\00967.txt'
flag1 =OpenPDF(ls_s, TRUE, false, false , pdfhandle)
flag2=ConvertPDFToTextFile(0, 0, pdfhandle, ls_m)
messagebox(string(flag1),flag2)
語法正確,但是運行到時提示錯誤
uj5u.com熱心網友回復:
Function ulong OpenPDF(string filename, Boolean protect, string userpass, string ownerpass, ref ulong pdfhandle) Library "SII_PDF.dll"uj5u.com熱心網友回復:
你這種方法宣告,語法倒是沒錯,但是運行是顯示:bad runtime function reference at line 8........
另,將宣告和使用中的ulong 全換成long結果都一樣,運行出錯!
uj5u.com熱心網友回復:
SII_PDF.dll是不是com組件啊,用regsvr32 SII_PDF.dll注冊一下,在用ConnectToNewObject試試
uj5u.com熱心網友回復:
注冊說是找不到dllregisterserver的輸入點
uj5u.com熱心網友回復:
申明為:Function ulong OpenPDF(string filename, Boolean protect, string userpass, string ownerpass, ref ulong pdfhandle) Library "SII_PDF.dll"ownerpass應該是字串
uj5u.com熱心網友回復:
謝謝1樓和5樓幫我糾正錯誤,但是宣告正確之后,語法檢查沒問題,但是運行執行到呼叫就崩潰:就是那個典型的bad runtime function reference at line 8 ......
很無奈!
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/94960.html
標籤:API 調用
上一篇:PB11.2/11.5開發B/S系統發布后連接資料庫時報錯誤請指正的安裝程式
下一篇:工具條
