Home > Products Windows > PDF to TXT Converter

VeryPDF PDF to TXT Converter

VeryPDF

PDF to TXT Converter

  • Convert PDF to plain text.
  • Save PDF to HTML file.
  • Easy drag and drop operation.

Download Buy Now
Version 3.2
$38.00

VeryPDF PDF to TXT Converter COM supports to be called from different programming languages like Visual Basic, C/C++, Delphi, ASP, PHP, C#, and .NET. It is helpful for application developers to develop new application in which the function of converting PDF to TXT will be realized perfectly.

In this page, you will see the main samples like ASP, C++ and VB of VeryPDF PDF to TXT Converter COM, which will enable you to use this application smoothly.

System preference

Operating Systems: all the Windows platforms, like Windows 2000, XP, Vista, 7, 8,Windows Server 2003, 2008, 2008 R2 – 32 and 64 Bit and so on.

Programming Languages

The following programming languages are supported:C#, VB .NET, MS Visual Basic, Borland Delphi, VBA (MS Office products such as Access) and C++ via COM, C and C++ via native C.

Sample: ASP

<%

dim oTest

dim nRet

Set oTest = Server.CreateObject("PDF2TXT.CPDF2TXT")

Response.write "Create Object Success!"

oTest.com_SetTXTFormat 1

oTest.com_SetZoomRatio 90

oTest.com_PDF2TXTSetLicenseCode("XXXXXXXXXXXXXXXXXXXXXX")

nRet = oTest.com_Pdf2Txt("C:\sample1.pdf","C:\sample1-pdf2txt.txt")

nRet = oTest.com_Pdf2TxtEx(

       "C:\sample1.pdf","C:\sample1-pdf2txtex.txt",0,0,"",""

       )

Response.write "Convert Success!"

%>

Sample:Visual C++

void ConvertPDFBuffer2TextBuffer(char *pdffile, char *textfile)

{

    int m_iFileLength = 0;

    char* pdfBuffer = NULL;

    FILE *file = fopen(pdffile,"rb");

    if(file)

    {

        m_iFileLength = _filelength(fileno(file));

        if(m_iFileLength <= 0)

        {

            fclose(file);

            return;

        }

        pdfBuffer = new char[m_iFileLength];

        if(pdfBuffer == NULL)

        {

            fclose(file);

            return;

        }

        memset(pdfBuffer,0,m_iFileLength);

        fread(pdfBuffer,1,m_iFileLength,file);

        fclose(file);

    }

    if(pdfBuffer == NULL || m_iFileLength <= 0)

        return;

 

    SetPageSeparator("<<<<<<<<<********>>>>>>>>>>>>>");

    SetZoomRatio(100);

    SetTXTFormat(1);

    SetOpenResultFile(0);

    SetDeleteBlankLine(TRUE);

 

    int textBufferSize;

    const char *textbuffer = PDFBuffer2TextBuffer(

                pdfBuffer, m_iFileLength, &textBufferSize

                );

    if(textbuffer)

        printf("%s\n",textbuffer);

    PDF2TextFreeBuffer(textbuffer);

 

    LPCWSTR textbufferW = PDFBuffer2TextBufferW(

            pdfBuffer, m_iFileLength, &textBufferSize

            );

    PDF2TextFreeBufferW(textbufferW);

 

    textbufferW = PDFBuffer2TextBufferWEx(                   pdfBuffer,m_iFileLength,&textBufferSize,

                  0, 0,NULL,NULL,NULL,0

                  );

    PDF2TextFreeBufferW(textbufferW);

 

    delete []pdfBuffer;

}

Sample: Visual Basic

Private Sub bconvert_Click()

     ' only PDF Files

     cdialog.Filter = "PDF Files (*.PDF)|*.PDF"

     ' if ok

     cdialog.ShowOpen

     ' if file specified

If cdialog.FileName <> "" Then

    ' Application exe path and add filename for txt

     TxtFile = App.Path + "\Temp.Txt"

     ' Txt file exist ?

     If Dir(TxtFile) <> "" Then

        ' ok delete it

        Kill TxtFile

     End If

     'Register your PDF2TXT SDK by given License Code

     PDF2TXTSetLicenseCode "XXXXXXXXX"

     SetTXTFormat 1

     SetGetDocumentSummary 0

     SetPageSeparator "*****************>>>>>>>>>>>>>>>"

     ' convert the file

     pdf2txt cdialog.FileName, TxtFile

     ' open notepad with textfile

     ShellExecute 0, "open", TxtFile, "", "", SW_SHOW

     TxtFile = App.Path + "\Temp2.Txt"

     pdf2txtEx cdialog.FileName, TxtFile, 0, 0, "", ""

     ShellExecute 0, "open", TxtFile, "", "", SW_SHOW

 End If

End Sub

For more programming language samples, please download VeryPDF PDF to TXT Converter COM to see all its samples.

Sample: Visual Basic

  • Support all features of VeryPDF PDF to TXT Converter.
  • Allow developer companies to integrate the program into their products.
  • Enable developers to access the converter via any programming or scripting languages.
  • Support Visual Basic, C/C++, Delphi, ASP, PHP, C#, and .NET.

Video Tutorial

Relative Products

Related Links

Gold Support 30-DAY NO RISK REFUND
 
  Learn more about PDF to TXT Converter   See other products   Download   Buy Now
 
 
                   
 You may like these products
VeryPDF PDF to Word Converter
PDF to Word Converter

$39.95

Convert PDF to Office Word or RTF. It also provides a command line tool that can be used in a script.

Learn More>>

try buy
VeryPDF PDF to Excel Converter
PDF to Excel Converter

$39.95

Converting PDF files to Excel spreadsheets.

Learn More>>

try buy
Scan to Word OCR Converter
Scan to Word OCR Converter

$79.95

Recognize characters from scanned files and scanners and save as Word.

Learn More>>

try buy