Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Sep 2009
    Posts
    165
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Autogeneration of PDFs for PHP based site

    Hi

    I have a site which is written up in PHP and has a page with various products for sale, pulled from a mySQL database.

    What we need to be able to do is have a way of autogenerating a PDF version of the "product detail" page, so that certain items (product description, the main photos, technical details etc.) on the page are bundled into a PDF which is generated for the user and which they can then save, print etc. just as they would with any PDF.

    It should be dynamic, in that if changes are made to the product, when the user next clicks the "Download as PDF" link for that product, the changes are incorporated.

    I know it's possible to just manually make PDFs based on the product pages and put them up on the site, but this means a lot of extra maintenance (remaking PDFs whenever products change etc.)

    Any idea if and how this can be achieved?

  • #2
    Senior Coder
    Join Date
    Aug 2009
    Location
    Mansfield, Nottinghamshire, UK
    Posts
    1,555
    Thanks
    57
    Thanked 148 Times in 147 Posts
    you have to have full control of your server ( dedicated ) or a shared host that has certain php extensions installed. there are some classes, but they are poo.

    Another option to use good old perl to process the creation of pdfs.
    Website Design Mansfield
    PHP Code:
    function I_LOVE(){function b(&$b='P'){$b.='P';}function a($_){return $_++;}$b='P';define("B",'H');b($b=implode('',array($b=a($b),$b=a(B))));b($b);return $b;}
    echo 
    I_LOVE(); 

  • #3
    Regular Coder
    Join Date
    Sep 2009
    Posts
    165
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Do you know which extensions have to be installed on the server for this to work?

    A few people have mentioned FPDF to me- any good or best avoided?

    Lastly, I don't know any Perl so unfortunately that isn't an option...


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •