Jump to content

[SOLVED] PHP Pdf viewer


kmachstang

Recommended Posts

Hi All,

 

I am currently working on a project where I must have a custom built PDF viewer that runs server side. The way I thought of doing it was to use the ImageMagick convert command to convert the page of the PDF that the user wants into a JPEG and serve that image. The problem is I can't have thousands of Image files hanging around on the server. Can anyone either:

 

A) Tell me a better way of accomplishing what I need to do?

 

B) Give me some clever idea as to how to create a dynamic image from the PDF file?

 

C) Some idea as to how to delete the image after it is sent to the user?

 

 

Any guidance will be greatly appreciated,

Kyle

Link to comment
https://forums.phpfreaks.com/topic/73505-solved-php-pdf-viewer/
Share on other sites

Script to check the creation time & date of the image files, over 2 days old get deleted..

 

either that or something like

<?php
header("Content-Type: image/jpeg");
//ImageMagick pdf to jpeg
$img = imagecreatefromjpeg($imgname);
imagejpeg($img);
unlink($imgname);
?>

Link to comment
https://forums.phpfreaks.com/topic/73505-solved-php-pdf-viewer/#findComment-371080
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.