Ad block is installed and active. Please support us by disabling it.
HomeFriday, April 20, 2018, 19:57:13
35

Convert pdf to image - mpdf

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

Prevent the error loading XML – libxml_use_internal_errors

libxml_use_internal_errors() allows you to disable standard libxml errors and enable user error handling.

PHP Trim

trim() Strip whitespace (or other characters) from the beginning and end of a string.

Addslashes - Stripslashes

addslashes — quote string with slashes, stripslashes — un-quotes a quoted string

PHP Mail

Sends an email.

Sitemap

phpForm.net Website Sitemap

Create dynamic Web Pages with PHP & MySQL

Create dynamic Web Pages with PHP & MySQL, Requirement(s): PHP Server, MySQL

Preg_Match - PHP Email Validation

Validate email with preg_match in php

MySQL to RSS

Publishing MySQL data in RSS

Bookmark Current Page - PHP Tutorial

Bookmark current page with PHP example.

Stack Overflow Clone Script - Ja2BU

Open source question and answer script written in PHP, MySQL and jQuery. Main features are: SEO friendly url's, private message system, rating system, comments system.
About Author

wain

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