Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

PDF Creation via PHP

  • 15-11-2006 12:44pm
    #1
    Closed Accounts Posts: 8,478 ✭✭✭


    We've been using standard HTML/PHP to display printable reports depending on data coming back from MySQL. Trying to control the HTML formatting when printed on different printers is becoming a pain. What I want to do is try to create PDF documents on the fly.

    I've tried to use some of the more popular methods - such as html2fpdf and so on. None worked as well as I would like, as they all seem to fail when attempting to generate the PDF versions of the HTML tables.

    I use the free software from primopdf.com to create "proper" pdf documents, but this is obviously something that I would rather automate, and not have to depend on a 3rd party executable.

    Ideas!


Comments

  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    You can add an extension to PHP to allow you to create PDF documents directly from the scripts. I have searched briefly in the past, but it doesn't seem to be possible to get a free extension...

    PDFLib gives the highest google ranking:
    http://www.pdflib.com/download/pdflib-family/pdflib-7/

    If all the machines are of a standard build, perhaps you could try exporting in RTF or CSV or something which would print a little more standard than HTML?


  • Registered Users, Registered Users 2 Posts: 5,618 ✭✭✭Civilian_Target


    You could get your program to output a Latex-formatted file and then use PDFLatex to compile it...

    A better suggestion, however, would be to simply define a printing style-sheet: xhtml/CSS2 supports a header tag (can't remember it off hand) that is automatically invoked when the browser tries to print: maybe that's what you're looking for!s


Advertisement