Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

GIF support for PdfCatalogs (I'm almost there!)


hknight

Recommended Posts

The contrabution PdfCatalogs creates a PDF format catalog. It only supports JPEG and PNG type images. I need support for GIF images so I had an idea: why not convert the GIFs to PNGs in realtime while creatating the PDF document?

 

So I used NETPBM and the short script below to convert GIFs to PNGs

 

<?php 
$netpbmPath = "/home/me/public_html/gallery/netpbm"; // don't put at end 
header ("Content-Type: image/png"); 
$file = ereg_replace('.converted.png','',$_SERVER['QUERY_STRING']); 
echo `$netpbmPath/giftopnm $file | $netpbmPath/pnmtopng`; 
?>

 

I have tested this and the conversion works great!

 

NOW all that needs to be done is to somehow use the converted image instead of GIFs in pdf_catalogue.php.

 

I got the first part down but now I need help on the second part. How can I use the converted image instead of the GIFs in the PDF generation script?

 

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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