diff --git a/examples/create_pdf_thumbnail.php b/examples/create_pdf_thumbnail.php index 4cd271e..6ae14ef 100644 --- a/examples/create_pdf_thumbnail.php +++ b/examples/create_pdf_thumbnail.php @@ -6,28 +6,19 @@ # set your api secret or token ConvertApi::setApiCredentials(getenv('CONVERT_API_SECRET')); -# Example of extracting first page from PDF and then chaining conversion PDF page to JPG. -# https://www.convertapi.com/pdf-to-extract +# Example of converting the first page of a PDF to a JPG thumbnail. # https://www.convertapi.com/pdf-to-jpg $dir = sys_get_temp_dir(); -$pdfResult = ConvertApi::convert( - 'extract', - [ - 'File' => 'files/test.pdf', - 'PageRange' => 1, - ] -); - $jpgResult = ConvertApi::convert( 'jpg', [ - 'File' => $pdfResult->getFile(), - 'ScaleImage' => true, - 'ScaleProportions' => true, + 'File' => 'files/test.pdf', + 'PageRange' => 1, 'ImageHeight' => 300, 'ImageWidth' => 300, + 'FitToSize' => true, ] );