Ad block is installed and active. Please support us by disabling it.
HomeTuesday, February 20, 2018, 01:36:36
35

Convert pdf to image - mpdf

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

Link Base 2.0.

Manage your links using a MySQL database. It features easy install, user submission, and an admin panel to add, edit and remove categories and links.

PHP Tutorials

Useful step-by-step PHP tutorials for beginners

Captcha V2 - Free PHP Script

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

PHP Forms

FREE PHP forms

PHP DateTimeZone

PHP representation of time zone

Block Visitors From Specific IP Address

Learn How To Restrict Users From Different IP Addresses.

Link Base 1.1. - Free PHP Link Index Script

Manage your links using a MySQL database. Features easy install, user submission, and an admin panel to add, edit and remove categories and links.

Upload Attachment - PHP Tutorial

Upload attachment with PHP example, Requirement(s): PHP server

MySQL – Select from two tables

Select data from two tables, PHP MySQL

PHP highlight_string - PHP Tutorial

Outputs or returns a syntax highlighted version of the given PHP code using the colors defined in the built-in syntax highlighter for PHP. Requirement(s): PHP Server.
About Author

wain

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