VeryPDF Cloud REST API :: Best PDF Cloud REST API for Mobile, Web, Desktop and Cloud Developers. Create, Edit, Convert PDF to DOC, XPS, HTML, TXT, Image, etc. in .NET, Java, PHP, Ruby, Python, etc. program languages

VeryPDF Cloud REST API Home Page,

https://www.verypdf.com/online/cloud-api/index.html

Download test package of VeryPDF Cloud REST API,

https://www.verypdf.com/dl2.php/VeryPDF_CloudAPI.zip

VeryPDF Cloud REST API is an easy-to-use REST API to create, convert and automate documents between DOC, DOCX, HTML, XLS, PPT, PPTX, PDF, EML, MSG, RTF, TXT, XPS, PNG, JPEG, TIFF and CSV formats along with Dropbox integration and OCR features.

VeryPDF Cloud REST API platform will work with both desktops and mobile devices, no matter what OS you are using. Your apps can access any of our PDF features from desktops, servers or mobile devices.

VeryPDF Cloud REST API is a cloud-based platform that allows PDF generation, conversion and automation. This easy-to-use tool eliminates the need for separate APIs for different file formats and works with Word, Excel, PowerPoint, HTML, and images. VeryPDF Cloud REST API can be called from any language such as .NET, Java and PHP deployed on multiple platforms like Windows, Mac OS, UNIX, iOS and Android.

VeryPDF Cloud REST API is a platform independent document manipulation API, it is a true REST API that can be used with any language: .NET, Java, PHP, Ruby, Rails, Python, jQuery and many more. You can use it with any language or platform that supports REST. (Almost all platforms and languages support REST and provide native REST clients to work with REST APIs). You do not need to worry about language or platform limitations. You can use it with any platform — web, desktop, mobile, and cloud. The API integrates with other cloud services to give you the flexibility you need when processing documents. It is suitable for any type of business, document, or content.

Integrating VeryPDF Cloud REST API into your app is simple and effective, requiring no installation and no need to have your own servers.

Common Uses of VeryPDF Cloud REST API:

1. Convert PDF documents to editable Word.
2. Convert PDF documents to images.
3. Convert Word to PDF.
4. Convert an image file to PDF.
5. Add watermark to PDF.
6. Replace or extract text from PDF files.
7. Edit images in a PDF file.
8. Extract text from PDF images.
9. Convert Office Documents to PDF.
10. Convert web pages to image files.
11. Convert web pages to PDF files.
12. Convert PDF file to simple HTML file for further editing purpose.
13. Convert image or scanned PDF file to text file using OCR function.
14. Split and merge PDF files.
15. Compress PDF files.
16. Convert PDF to Flash SWF files.
17. Convert office document formats to HTML files.
18. Convert PDF file to Online Flipbook for web viewing.
19. Provide PDF Annotation Cloud API to annotate PDF files.
20. Powerful HTML5 PDF Viewer to View PDF files Online.
21. more and more...

PHP Source Code Examples,

<?php

 

// gets the data from a URL

function get_data($url)

{

    $ch = curl_init();

    $timeout = 5;

    curl_setopt($ch, CURLOPT_URL, $url);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

    $data = curl_exec($ch);

    curl_close($ch);

    return $data;

}

 

//The Usage

$strOutFile = 'verypdf.jpg';

$strURL = 'http://online.verypdf.com/api/?apikey=XXXX-XXXX-XXXX-XXXX&app=html2image&infile=https://www.verypdf.com&outfile=' . $strOutFile;

ExecuteCloudAPI($strURL, $strOutFile);

 

$strOutFile = 'verypdf.pdf';

$strURL = 'http://online.verypdf.com/api/?apikey=XXXX-XXXX-XXXX-XXXX&app=html2pdf&infile=https://www.verypdf.com&outfile=' . $strOutFile;

ExecuteCloudAPI($strURL, $strOutFile);

////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////

function ExecuteCloudAPI($strURL, $strOutFile)

{

    echo $strURL."\n";

    $strReturn = get_data($strURL);

    $strReturn = str_replace('[Output]', '', $strReturn);

    $strReturn = str_replace('<br>', '', $strReturn);

    $strReturn = str_replace(' ', '', $strReturn);

    $strLocalFile = dirname(__FILE__) . '/' . $strOutFile;

    DownloadFile($strReturn, $strLocalFile);

    echo $strLocalFile."\n";

}

 

function DownloadFile($url, $path)

{

    $newfname = $path;

    $file = fopen ($url, "rb");

    if (!$file)

        return false;

    $newf = fopen ($newfname, "wb");

    if (!$newf)

        return false;

    while(!feof($file))

    {

        fwrite($newf, fread($file, 1024 * 8 ));

    }

    fclose($newf);

    fclose($file);

    return true;

}

 

?>

 

C# Source Code Examples,

 

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;

using System.Diagnostics;

 

namespace WindowsFormsApplication1

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

 

        private string ExecuteCloudAPI(string strURL, string strOutFile)

        {

            Debug.WriteLine(strURL);

            WebRequest request = HttpWebRequest.Create(strURL);

            WebResponse response = request.GetResponse();

            StreamReader reader = new StreamReader(response.GetResponseStream());

            string strResponse = reader.ReadToEnd();

            string strFileURLOnServer = strResponse.Replace("<br>", "");

            strFileURLOnServer = strFileURLOnServer.Replace("[Output]", "");

 

            string appPath = Path.GetDirectoryName(Application.ExecutablePath);

            strOutFile = appPath + "\\" + strOutFile;

 

            Debug.WriteLine(strFileURLOnServer);

            Debug.WriteLine(strOutFile);

 

            WebClient webClient = new WebClient();

            webClient.DownloadFile(new Uri(strFileURLOnServer), strOutFile);

            return strOutFile;

        }

 

        private void button1_Click(object sender, EventArgs e)

        {

            //https://www.verypdf.com/online/cloud-api/index.html

            //https://www.verypdf.com/wordpress/category/verypdf-cloud-api

 

            string strAPIKEY = "XXXX-XXXX-XXXX-XXXX";

            {

                string strOutputFile = "verypdf.jpg";

                string strURL = "http://online.verypdf.com/api/?apikey=" + strAPIKEY

                    + "&app=html2image&infile=https://www.verypdf.com&outfile="

                    + strOutputFile;

                string strLocalFile = ExecuteCloudAPI(strURL, strOutputFile);

                MessageBox.Show(strLocalFile);

            }

            {

                string strOutputFile = "verypdf.pdf";

                string strURL = "http://online.verypdf.com/api/?apikey=" + strAPIKEY

                    + "&app=html2pdf&infile=https://www.verypdf.com&outfile="

                    + strOutputFile;

                string strLocalFile = ExecuteCloudAPI(strURL, strOutputFile);

                MessageBox.Show(strLocalFile);

            }

        }

    }

}

 

CURL Command Line Examples,

 

curl -X GET http://online.verypdf.com/api/?apikey=XXXX-XXXX-XXXX-XXXX&app=html2pdf&infile=https://www.verypdf.com&outfile=verypdf.pdf

 

 

Java Source Code Examples,

 

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

import java.net.HttpURLConnection;

import java.net.URL;

import java.net.URLEncoder;

import java.io.*;

 

/**

 *

 * A complete Java class that shows how to open a URL, then read data (text) from that URL,

 * HttpURLConnection class (in combination with an InputStreamReader and BufferedReader).

 *

 * @author alvin alexander, devdaily.com.

 *

 */

public class VeryPDFCloudAPI

{

public static void main(String[] args) throws Exception

{

                 System.out.println("[Message] Enter main application...");

 

                 String strOutFile = "verypdf.jpg";

                 String strCloudAPIURL = "http://online.verypdf.com/api/?apikey=XXXX-XXXX-XXXX-XXXX&app=html2image&infile=https://www.verypdf.com&outfile=" + strOutFile;

                 VeryPDFCloudAPIConverter(strCloudAPIURL, strOutFile);

 

                  strOutFile = "verypdf.pdf";

                  strCloudAPIURL = "http://online.verypdf.com/api/?apikey=XXXX-XXXX-XXXX-XXXX&app=html2pdf&infile=https://www.verypdf.com&outfile=" + strOutFile;

                  VeryPDFCloudAPIConverter(strCloudAPIURL, strOutFile);

}

 

public static void VeryPDFCloudAPIConverter(String strCloudAPIURL, String strOutFile) throws Exception

{

      String strResults = doHttpUrlConnectionAction(strCloudAPIURL);

      strResults = strResults.replace("[Output]", "");

      strResults = strResults.replace("<br>", "");

      strResults = strResults.replace(" ", "");

      System.out.println("[CloudAPI Return] " + strResults);

      File file = new File(".");

      String strLocalFile = file.getCanonicalPath()+"\\"+strOutFile;

      DownloadFileFromURL(strResults, strLocalFile);

}

        

public static void DownloadFileFromURL(String strFileURL, String destinationFile) throws IOException

{

      System.out.println("[From] "+strFileURL);

      System.out.println("[To] "+destinationFile);

 

      URL url = new URL(strFileURL);

      InputStream is = url.openStream();

      OutputStream os = new FileOutputStream(destinationFile);

        

      byte[] b = new byte[2048];

      int length;

        

      while ((length = is.read(b)) != -1) {

                  os.write(b, 0, length);

       }

        

       is.close();

       os.close();

}

/**

   * Returns the output from the given URL.

   *

   * I tried to hide some of the ugliness of the exception-handling

   * in this method, and just return a high level Exception from here.

   * Modify this behavior as desired.

   *

   * @param desiredUrl

   * @return

   * @throws Exception

   */

  private static String doHttpUrlConnectionAction(String desiredUrl) throws Exception

  {

    System.out.println("[CloudAPI URL] " + desiredUrl);

      

    URL url = null;

    BufferedReader reader = null;

    StringBuffer stringBuffer;

 

    try

    {

      // create the HttpURLConnection

      url = new URL(desiredUrl);

      HttpURLConnection connection = (HttpURLConnection) url.openConnection();

      

      // just want to do an HTTP GET here

      connection.setRequestMethod("GET");

      

      // uncomment this if you want to write output to this url

      //connection.setDoOutput(true);

      

      // give it 15 seconds to respond

      //connection.setReadTimeout(15*1000);

      connection.connect();

 

      // read the output from the server

      reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));

      stringBuffer = new StringBuffer();

 

      String line = null;

      while ((line = reader.readLine()) != null)

      {

           stringBuffer.append(line + "\n");

      }

      return stringBuffer.toString();

    }

    catch (Exception e)

    {

      e.printStackTrace();

      throw e;

    }

    finally

    {

      // close the reader; this can throw an exception too, so

      // wrap it in another try/catch block.

      if (reader != null)

      {

        try

        {

          reader.close();

        }

        catch (IOException ioe)

        {

          ioe.printStackTrace();

        }

      }

    }

  }

}

 

VB.NET Source Code Examples,

 

Imports System.IO

Imports System.Net

Public Class Form1

 

Private Function ExecuteCloudAPI(ByVal strURL As String, ByVal strOutFile As String) As String

        Dim client As WebClient = New WebClient()

        Dim strResponse As Stream = client.OpenRead(strURL)

        Dim reader As StreamReader = New StreamReader(strResponse)

        Dim strReturn As String = ""

        Dim strHTTPURL As String = ""

        strReturn = reader.ReadLine()

        Do While strReturn <> Nothing

            Console.WriteLine(strReturn)

            strHTTPURL = strHTTPURL & strReturn

            strReturn = reader.ReadLine()

        Loop

 

        strHTTPURL = strHTTPURL.Replace("[Output]", "")

        strHTTPURL = strHTTPURL.Replace("<br>", "")

 

        Dim strFolderDir As String = Application.StartupPath()

        Dim strLocalFile As String = strFolderDir & "\" & strOutFile

 

        Try

            Dim web_client As WebClient = New WebClient

            web_client.DownloadFile(strHTTPURL, strLocalFile)

            MessageBox.Show("Done")

        Catch ex As Exception

            MessageBox.Show(ex.Message, "Download Error", _

                MessageBoxButtons.OK, _

                    MessageBoxIcon.Exclamation)

        End Try

        ExecuteCloudAPI = strLocalFile

End Function

 

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click

        Dim strURL1 As String = "http://online.verypdf.com/api/?apikey=XXXX-XXXX-XXXX-XXXX&app=html2image" &

            "&infile=https://www.verypdf.com&outfile=verypdf.jpg"

        Dim strLocalFile1 As String = ExecuteCloudAPI(strURL1, "verypdf.jpg")

        MsgBox(strLocalFile1)

 

        Dim strURL2 As String = "http://online.verypdf.com/api/?apikey=XXXX-XXXX-XXXX-XXXX&app=html2pdf" &

            "&infile=https://www.verypdf.com&outfile=verypdf.pdf"

        Dim strLocalFile2 As String = ExecuteCloudAPI(strURL2, "verypdf.pdf")

        MsgBox(strLocalFile2)

    End Sub

End Class

 

We will continue to add more features into VeryPDF Cloud REST API, if you have any suggestion or question for the VeryPDF Cloud REST API, please feel free to let us know,

 

http://support.verypdf.com/open.php

VN:F [1.9.20_1166]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)
VeryPDF Cloud REST API :: Best PDF Cloud REST API for Mobile, Web, Desktop and Cloud Developers. Create, Edit, Convert PDF to DOC, XPS, HTML, TXT, Image, etc. in .NET, Java, PHP, Ruby, Python, etc. program languages, 10.0 out of 10 based on 1 rating

Related Posts

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!