Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.