VeryPDF Cloud API Examples

Cloud PDF Processing APIs
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=pdftools&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.pdf&-f=1&-l=1&outfile=out.jpg
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=pdftools&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.pdf&-f=1&-l=1&outfile=out.png
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=pdftools&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.pdf&outfile=out.png&-r=72
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=pdftools&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.pdf&outfile=out.jpg&-width=100&-height=100
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=pdftools&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.pdf&outfile=out.jpg

Cloud HTML to PDF Converter APIs
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=html2pdf&infile=http://www.verypdf.com&outfile=verypdf.pdf

Cloud HTML to Image Converter APIs
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=html2image&infile=http://www.verypdf.com&outfile=verypdf.jpg
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=html2image&infile=http://www.verypdf.com&outfile=verypdf.jpg&--width=300&--height=300
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=html2image&infile=http://www.verypdf.com&outfile=verypdf.png

Cloud Image Format Converter and Image Processing APIs
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=imageproc&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.png&outfile=out.jpg&-resize=300x300!

Cloud Office Document Formats to PDF and Image Converter APIs
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=doc2any&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.doc&outfile=verypdf.pdf
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=doc2any&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.xls&in_ext=.xls&outfile=verypdf.pdf
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=doc2any&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.ppt&outfile=out.pdf
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=doc2any&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.docx&outfile=out.pdf
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=doc2any&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.xlsx&outfile=out.pdf
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=doc2any&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.pptx&outfile=out.pdf
http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=doc2any&infile=https://dl.dropboxusercontent.com/u/5570462/verypdf-cloud-api/verypdf.rtf&outfile=out.pdf

[ERROR] Please provide a valid APIKEY.

If you have not a APIKEY, please sign up an account on "http://online.verypdf.com" site, you will get a valid APIKEY at "http://online.verypdf.com/wp-admin/accountinfo.php" page. If you do not provide a valid APIKEY, VeryPDF Cloud API will work at DEMO mode. If you need any assistance, please feel free contact us via VeryPDF Ticket System at  "http://support.verypdf.com".

Some Examples to call VeryPDF Cloud API:

PHP Example for VeryPDF Cloud API:

//The Code
/* 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
$returned_content = get_data('http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=html2image&infile=http://www.verypdf.com&outfile=verypdf.jpg');
echo $returned_content;


curl Example for VeryPDF Cloud API:

curl 'http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=html2image&infile=http://www.verypdf.com&outfile=verypdf.jpg'
curl --request GET 'http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=html2image&infile=http://www.verypdf.com&outfile=verypdf.jpg'


C# Example for VeryPDF Cloud API:

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=XXXXXXXXXXXXX&app=html2image&infile=http://www.verypdf.com&outfile=verypdf.jpg";
            WebRequest request = HttpWebRequest.Create(url);
            WebResponse response = request.GetResponse();
            StreamReader reader = new StreamReader(response.GetResponseStream());
            string urlText = reader.ReadToEnd();
            MessageBox.Show(urlText);
        }
    }
}


VB.NET Example for VeryPDF Cloud API:

Imports System.IO
Imports System.Net

Module Module1
    Sub Main()
        'Address of URL
        Dim URL As String = "http://online.verypdf.com/api/?apikey=XXXXXXXXXXXXX&app=html2image&infile=http://www.verypdf.com&outfile=verypdf.jpg"
        ' Get HTML data
        Dim client As WebClient = New WebClient()
        Dim data As Stream = client.OpenRead(URL)
        Dim reader As StreamReader = New StreamReader(data)
        Dim str As String = ""
        str = reader.ReadLine()
        Do While str <> Nothing
            Console.WriteLine(str)
            str = reader.ReadLine()
        Loop
    End Sub
End Module


Java Example for VeryPDF Cloud API:

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.*;
 
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=http://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=http://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();
    }
    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();
                }
            }
        }
    }
}


VeryPDF Cloud API Platform Home Page

VeryPDF Cloud API Archives

If you have any question for VeryPDF Cloud API Platform, please feel free contact us,

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