HomeSaturday, August 18, 2018, 20:19:48
34

Convert pdf to image - mpdf

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

Captcha V2 - Free PHP Script

PHP Captcha protection image Version 2, - Requirement(s): PHP Server, GD Library

PHP DateTimeZone

PHP representation of time zone

Adsense crawler errors and robots.txt

How to fix Google AdSense crawler errors in robots.txt

RSS, MySQL & Smarty

Smarty > Publishing MySQL Data in RSS 2.0

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

Upload Image with PHP [Example2]

[Example2] Tutorial - How to upload and resize image with PHP

Bookmark Script

Allow your users to easily bookmark your site, by clicking on a link on the page.

PHP Form Validation

PHP form validation :: PHP tutorial, requirement(s): PHP Server

Send This Link PHP Script

A popup form which allows your visitors to send a referral link from your site. It features admin notification and HTML output.

PHP Cookies and Sessions Tutorial

PHP Cookies and Sessions Tutorials
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.