Question:I want to convert the VeryPDF?through PHP by API but when the output image generated it's get blur from original.I use some application in the market. Blur image is not what I want, so I guess is there any solution on
Answer: When you need to convert PDF to Image Converter Cloud API, by which we can convert like JPG, PNG, normal TIFF, Faxable TIFF, GIF, TGA, PCX, BMP, etc. images. And VeryPDF cloud based application can be called from any platform and any program languages, include C#, VB.NET, ASP.NET, ASP, PHP, Java, Ruby, Amazon, etc. And the output will not be blur. Please check more information of this software on homepage, in the following part, I will show you how to use this software.through PHP by API, maybe you can have a free trial of VeryPDF cloud based application named
Step 1. Convert PDF to image from PHP
- By VeryPDF cloud based application, you do not need to download any application. As we have installed related software on our server, all you need to do is that open browser and inputting URL like the following:
- When you need to call it from PHP code, all you need to do is simply add the above URL to PHP code then you can run the conversion. Here is an example for your reference:
Convert PDF file to black and white TIFF file, at 300 DPI, without dither option,
By the above URL, we can convert PDF file to black and white TIFF file and set resolution as 300 DPI without dithering. Meanwhile by this application, we can specify conversion page range like, if you need to only convert the first page of PDF, please add parameter &-f=1&-l=1 like this.
-f <int> : first page to convert
-l <int> : last page to convert
-pagerange <string> : set page range
Please check more parameters on the user manual. There are too many, I can not list all of them here.
/* gets the data from a 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);
$returned_content = get_data('http://online.verypdf.com/api/?apikey=XXXX&app=pdftools&infile=http://online.verypdf.com/examples/cloud-api/verypdf2.pdf&outfile=verypdf.jpg&-f=1&-l=1&-width=300&-height=600');
By this API, we can convert PDF to image from PHP code easily. Now let us check the conversion effect from the following snapshot. During the using, if you have any question, please contact us as soon as possible.