Ad block is installed and active. Please support us by disabling it.
HomeSunday, August 20, 2017, 22:49:38
35

Convert pdf to image - mpdf

Monday, July 6, 15, 13:15:24, 2 Yaers Ago Via wain, Hits: 4455
Convert pdf file to jpg with php and mpdf
Code:
<?php
include("convert/mpdf.php");
$mpdf=new mPDF('utf-8', array(216,280));
$html = '<h1>My HTML</h1>';
$filename = 'filename';
$mpdf->WriteHTML($html);
$mpdf->Output('temp/'.$filename.'.pdf','F');
$pdf_file = 'temp/'.$filename.'.pdf';
$savepath = 'temp/'.$filename.'.jpg';
$img = new imagick($pdf_file);
$img->setImageFormat('jpg');
$img->writeImage($savepath);
echo "<img src='temp/$filename.jpg' />";
exit;
?>

Sign In

Sponsor

Related

PHP str_replace

str_replace - This function returns a string or an array with all occurrences of search in subject replaced with the given replace value

PHP $_GET Function

Get function in PHP

Creating a Math CAPTCHA with PHP - PHP Tutorial

This tutorial will show you how to create a form with Math Captcha.

PHP Form Basic

PHP Form - PHP form basic, Requirement(s): PHP Server

Math Captcha V6

PHP Math Captcha Image Version 6

Sitemap

phpForm.net Website Sitemap

How to insert new line (IP Address) with fwrite

How to insert new line (IP Address) with fwrite, Get IP address and write to file.

Email Link

HTML email link example

Tell A Friend with Captcha

This form allows your visitors to suggest your site to a friend. It features an HTML email format and an admin notification email.

Process Form Data with Jquery

jQuery, Process form data
About Author

wain

Date Registered: Sun, Feb 8, 15
Last Time Online: Thu, Jun 15, 17
So far has created 115 entries.
wain
This author has not yet filled in any details.