Ad block is installed and active. Please support us by disabling it.
HomeSunday, December 17, 2017, 04:25:07
35

Convert pdf to image - mpdf

Monday, July 6, 15, 13:15:24, 3 Yaers Ago Via wain, Hits: 5075
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

Syntax highlighting in Smarty

Syntax highlighting for Smarty - Google Code Prettify

PHP $_SESSION

Session_start creates a session or resumes the current one based on a session identifier passed via a GET or POST request, or passed via a cookie.

Email Link

HTML email link example

PHP form with file upload

Advanced Contact Form with email and form field validation. It allows your visitors to send you an email directly from your website.

Imageline

Draws a line between the two given points.

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.

Inserting form data in MySql table

Inserting form data in MySql table with PHP

Adsense crawler errors and robots.txt

How to fix Google AdSense crawler errors in robots.txt

GuestBook PHP Script

Allow visitors to leave messages on your site. It features easy install, admin notification, and control panel to remove unwanted entries.

PHP Form Validation

PHP form validation :: PHP tutorial, requirement(s): PHP Server
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.