            PDF2TXT COM Component user manual


------------------------ PDF2TXT(pdf to text) Features ------------------------
1.PDF to TEXT software can convert pdf files to text files on the fly 
2.Support PDF1.5 protocol (supported by Acrobat 6.0) 
3.Support command line, you can call it from yourself program 
4.Keep original page layout 
5.Needn't Adobe Acrobat software 
6.Support all Windows platform, 95/98/ME/NT/2000/XP 
7.Batch convert PDF files to text files 
8.Auto align text columns in table 
9.Extract various information (title, subject, author, keywords, creator, producer, 
  created date, security, version, page count, etc.) from PDF file 


------------------------ FAQ ------------------------
>How to use PDF2TXT COM Component?
1.You may use pdf2txt.dll in your project, the pdf2txt.dll is a simple dll library, 
  you may call it from your VB, C++, Delphi etc codes.
2.You also can use p2tocx.ocx control in your project, this OCX control base on the 
  pdf2txt.dll library, you must put the pdf2txt.dll and p2tocx.ocx in same directory, 
  you also can put the pdf2txt.dll in your windows\system32 directory, so the any 
  programs will can access it.
If you wish use p2tocx.ocx control, you must register it first,
~~~~~~~~~~~~~~~~~~~~~~~~~~~
regsvr32 p2tocx.ocx
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please refer to the VB, VC, Delphi and ASP examples for the detail usage.


>How to use PDF2TXT COM Component in ASP language?
1.Please put pdf2txt.dll and PDF2TXTEx.dll file (The PDF2TXTEx.dll file can be found 
  in the pdf2txt_asp\asp_vb_dll directory) to the system32 directory on your server.
For Example:
    Copy pdf2txt.dll C:\windows\system32
    Copy PDF2TXTEx.dll C:\windows\system32

2.Please register PDF2TXTEx.dll library,
~~~~~~~~~~~~~~~~~~~~~~~~~~~
regsvr32 C:\windows\system32\PDF2TXTEx.dll
~~~~~~~~~~~~~~~~~~~~~~~~~~~
3.You may use following codes to use PDF2TXT COM from your ASP code.
<%
	dim oTest 
	Set oTest = Server.CreateObject("PDF2TXT.CPDF2TXT")
	Response.write "Create Object Success!"
	oTest.Pdf2TxtEx "C:\sample1.pdf","C:\sample1.txt" 
	Response.write "Convert  Success!"
%>
4.Then it's OK.

Please notice, if you wish put the pdf2txt.dll file to another directory, you may 
change the PDF2TXTEx.dll codes, this dll codes in the pdf2txt_asp\asp_vb_dll directory, 
you may modify the dll file path and re-compile it into the PDF2TXTEx.dll file, and then
replace the older version.
~~~~~~~~~~~~~~~~~~~~~~~~~~
In the CPDF2TXT.cls file:
--------------------------
Private Declare Function pdf2txt Lib "pdf2txt.dll" Alias "PDF2TXT" (ByVal Source As String, ByVal Dest As String) As Long
Private Declare Function SetTXTFormat Lib "pdf2txt.dll" (ByVal Source As Long) As Long
Private Declare Sub SetGetDocumentSummary Lib "pdf2txt.dll" (ByVal Source As Boolean)
Private Declare Sub SetPageSeparator Lib "pdf2txt.dll" (ByVal Source As String)
~~~~~~~~~~~~~~~~~~~~~~~~~~



------------------------ Limitations ------------------------
The trial version only support extract first three pages from the pdf file, after you 
purchased it, you may get a registered version, the registered version hasn't any Limitations.


------------------------ File List ------------------------
charmap.txt		A table that map some unicode characters to local characters
p2tocx.ocx		PDF2TXT OCX Control, it depend on the PDF2TXT.DLL file
pdf2txt.dll		PDF2TXT.DLL library
pdf2txt.h		PDF2TXT DLL header file
pdf2txt.lib		PDF2TXT.DLL library interface file
readme.txt		Readme.txt file
sample1.pdf		An example PDF file, only for the test purpose
sample2.pdf		An example PDF file, only for the test purpose
test.exe		Test example, you may use "text.exe c:\sample1.pdf c:\sample1.txt" to test pdf2txt.dll library
------------------------ Functions ------------------------
1.int PDF2TXT(char *szPDFName,char *szTXTName)
Description:
	Convert PDF file to Text file.

Parameters:
	szPDFName   : Input PDF file name
	szTXTName   : Output Text file name

Return value:
	1 : successed
	0 : failed


2.int SetTXTFormat(int bFormatTXTFile)
Description:
        Set text format in generated TXT file.

Parameters:
        bFormatTXTFile : 1 indicate keep text format
                       : 0 indicate remove text format

Return value:
        Return previous flag.


3.int SetZoomRatio(int iZoomRatio)
Description:
        Set PDF scale options, default is 100, range from 1 to 200.

Parameters:
        iZoomRatio : scale ratio, date range from 1 to 200

Return value:
        Return previous scale ratio.


4.void SetPageSeparator(char *pszPageSymbol)
Description:
        Set page separator.

Parameters:
        pszPageSymbol: page separator, if pszPageSymbol is NULL, the page separator will 
be removed from the result text file.

Return value:
        none.


5.void SetPageTBMargin(int top, int bottom)
Description:
        Set page top and bottom margin, top margin is from top side (0 position) up to "top" 
value, bottom value indicate distance from top (0 position) up to "bottom" value, the valid 
region is from "top" up to "bottom".

Parameters:
        top    : top margin, unit is pixel
        bottom : the distance from top side, unit is pixel, if top and bottom equal -1, the 
valid region is entire page.

Return value:
        none


6.void SetOpenResultFile(BOOL IsOpen)
Description:
        Whether open the text file after it be created.

Parameters:
        IsOpen
             TRUE :  The generated text file will be auto opened after it created.
             FALSE:  Don't auto open the generated text file.

Return value:
        none


7.void SetDeleteBlankLine(BOOL IsDelete)
Description:
       Whether delete blank lines from the result text file.

Parameters:
       IsDelete
             TRUE : Delete blank lines from the generated text file.
             FALSE: Don't delete the blank lines.

Return value:
        none


8.void SetGetDocumentSummary(BOOL IsGetSummary)
Description:
       Whether read the document summary from the pdf file.

Parameters:
       IsGetSummary
             TRUE : Read document summary from the pdf file.
             FALSE: Don't read the document summary.

Return value:
        none


9.const char* PDF2TextBuffer(LPCTSTR pdfFile, int *textBufferSize)
Description:
       Convert a pdf file to a text buffer.

Parameters:
       pdfFile        : input pdf filename
       textBufferSize	: the size of the return buffer

Return value:
       Point to a text buffer, after you used it, you need use PDF2TextFreeBuffer function to free it.


10.const char* PDFBuffer2TextBuffer(const char* pdfBuffer, int pdfBufferSize,int *textBufferSize)
Description:
       Convert a pdf buffer to a text buffer.

Parameters:
       pdfBuffer      : the pdf file contents
       pdfBufferSize  : the size of the pdfBuffer
       textBufferSize	: the size of the return buffer

Return value:
       Point to a text buffer, after you used it, please use PDF2TextFreeBuffer function to free it.


11.void PDF2TextFreeBuffer(const char* textBuffer)
Description:
       Free the text buffer

Parameters:
       textBuffer : this paramter is returned by PDF2TextBuffer and PDFBuffer2TextBuffer functions

Return value:
       none.

12.void __stdcall SetPasswords(const char* userpassword, const char* ownerpassword)
Description:
       Set the passwords for the encrypted pdf file

Parameters:
       userpassword : the user password for the input pdf file

       ownerpassword : the owner password for the input pdf file

Return value:
       none.


------------------------ Support ------------------------
Email: support@verypdf.com

Main site,
    http://www.verypdf.com
    http://www.verypdf.com/pdf2txt/pdf2txt.htm

Mirror sites,
    http://www.toppdf.com
    http://www.toppdf.com/pdf2txt/pdf2txt.htm

    http://www.globalpdf.com
    http://www.globalpdf.com/pdf2txt/pdf2txt.htm

If you encounter any other problems, please don't hesitate to contact us at support@verypdf.com.

