这是一个外国人写的一个PDF转TXT的软件,其中提供了VB调用的代码,包括OCX和DLL的,为什么OCX安装后在DELPHI的面板中不显示,另一种方法就是使用它提供的DLL,
有两个方法来使用一种是使用ConvertPDFToFile,但是提示无些方法,原型如下
ConvertPDFToText( first page, last page, pdf handle, buffer, size )
Description:
Reads in the open PDF file from the first page designated to the last page designated, outputting each
page to an ASCII text format to the passed buffer in memory..
Input Fields:
First page long First page to begin converting. If the value is less than 1 then it is defaulted to the
first page of the PDF.
Last page long Last page to convert. If the value is less than 1 then it is defaulted to the last page
of the PDF
Pdf Handle long * Handle of the open PDF (obtained by calling OpenPDF)
Buffer char * Address of the buffer to receive the converted data.
Size int size of the buffer to receive the converted data
Return codes:
1(TRUE) – file converted successfully. Zero (FALSE) – file conversion had problems.
Usage:
long pdf;
long status;
char buffer[1000];
status = OpenPDF( "input.pdf", TRUE, NULL, NULL, &pdf );
status = ConvertPDFToText( 0, 0, &pdf, buffer, sizeof(buffer) );
或都使用OpenPDF再调用ConvertPDFToTextFile
OpenPDF原型如下
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 );ConvertPDFToTextFile原型如下
ConvertPDFToTextFile( first page, last page, pdf handle, output file )
Description:
Reads in the open PDF file from the first page designated to the last page designated, outputting each
page to an ASCII text format to the passed filename, retaining the basic layout of the text.
Input Fields:
First page long First page to begin converting. If the value is less than 1 then it is defaulted to the
first page of the PDF.
Last page long Last page to convert. If the value is less than 1 then it is defaulted to the last page
of the PDF
Pdf Handle long * Handle of the open PDF (obtained by calling OpenPDF)
Output file char * Full path and filename for the converted output file.
Return codes:
1(TRUE) – file converted successfully. Zero (FALSE) – file conversion had problems.
Usage:
long pdf;
long status;
status = OpenPDF( "input.pdf", TRUE, NULL, NULL, &pdf );
status = ConvertPDFToTextFile( 0, 0, &pdf, “outfile.txt” );
希望能够给出全部的源代码,先给100分,解决问题后再开帖给分,谢谢,高手快帮忙啊  
下载地址
http://www.softinterface.com/PDFX/Convert-PDF-To-Text-Component.HTM[:(]