How to convert PDF to text from C# by cloud API application?

       For converting PDF to text from C#, now you do not need to spend a lot of money to buy software toolkit. VeryPDF develops a series of cloud based API application, VeryPDF PDF to Text Converter Cloud API is one of them. This software is also cloud based application, so you can call this software together with C#, VB.NET, ASP.NET, ASP, PHP, Java, Ruby, Amazon, etc.  This software only can be used to convert text based PDF to text. When converting image based PDF to text, please use the version with OCR function. By by this PDF to Text Converter Cloud API, you can convert password protected PDF to text, choose conversion page range and others. Please check more information of this software on homepage, in the following part, let us check how to use this software.

Step 1. Go to the registration page

  • Go to the registration page to register an account. Please input a user name and your email address, and the click the Register button. Please pay more attention to the email box as when you pay for it, the API code will be sent to you email box at once.
  • When you get the code, for safety reason, you’d better change the temporary password to your preferred new password.
  • There are many payment method, please check them in Try and Buy website.

Step 2. Convert PDF to Text from C# by cloud API application.

  • Here is a code template of calling this software from C# for converting PDF to text, please have a check.

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.Serialization;
    using System.Net;
    using System.IO;

    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
            private void button1_Click(object sender, EventArgs e)
            {
                string url ="http://online.verypdf.com/api/apikey=XXXX&app=pdftools&
    infile=http://online.verypdf.com/examples/cloud-api/verypdf2.pdf&outfile=verypdf.txt&-f=1&-l=1&-layout
    ";
                WebRequest request = HttpWebRequest.Create(url);
                WebResponse response = request.GetResponse();
                StreamReader reader = new StreamReader(response.GetResponseStream());
                string urlText = reader.ReadToEnd();
                MessageBox.Show(urlText);
            }
        }
    }

  • Here are some parameter for you to choose:

    -f <int>     : first page to convert
    -l <int>     : last page to convert
    -opw <string>: owner password (for encrypted files)
    -upw <string>: user password (for encrypted files)
    -layout      : maintain original physical layout in PDF to Text conversion
    -nopgbrk     : don't insert page breaks between pages in PDF to Text conversion

When adding those parameters to output PDF file, please add them at the end of the URL like the above code template. During the using, if you have any question, please contact us as soon as possible.

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in VeryPDF Cloud API and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!