{{ !articles[0].partner.isSponsoringArticle ? "Platinum" : "Portal" }} Partner

How to convert Specific Pages of PDF File to JPG Image Using PHP in Cloud

This tutorial demonstrates how to use Aspose for Cloud to convert specified page of a PDF document to JPG image using PHP. Aspose for Cloud is a cloud-based document generation, conversion and automation platform for developers that offer a unique suite of APIs to work with Word documents, Excel spreadsheets, PowerPoint presentations, PDFs, and email formats and protocols.  To run the application please edits index.php to fill the correct values of appSID and appKey. Signup at http://cloud.aspose.com for free to get these. Upload the files to a web server and it is ready to use. The server should support PHP, JSON and cURL.
UploadFile($input, "");

  // Convert $page into specified $format and save the result in $output file
  $output = $converter->ConvertToImage($page, $format);

  // Tell the web browser that the PHP script is about to send a JPG image

  // Send the contents our $output file to the browser
  echo file_get_contents($output);

  // Delete the generated $output file. We don't need it anymore

  // Delete the uploaded PDF too. We are all done with it.
  // It is a good practice to keep the uploaded document until all operation
  // are complete and the file is no more needed. Uploading the file
  // again on each request will waste time :-)

} catch (Exception $x) {
  // Ooops! let the user know what happened
  echo $x->getMessage();
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks