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
    New to the CF scene
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation converting ajax/php driven site to PDF

    I want to create a link on my ajax/php driven website that can be clicked on and will take the current page and convert it to pdf.

    I have tried using dompdf but from what I can tell, it doesn't have the ability to render something dynamic with ajax. It only takes the whole file on the server and converts it and since the page being viewed is actually made up of several files it doesn't know how to preform the same results like the web browser.

    I am wondering if there would be some kind of work around for this?

    Any suggestions?

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Well.. there's got to be a better way than this, but one approach might be just to grab the entire generated contents of your HTML tag, and fire that at your PHP script. In jquery:

    Code:
    var full_source = $('html').html();
    $.post('html_to_pdf.php', {
    source_html: full_source
    });
    Something along those lines?

  • #3
    New to the CF scene
    Join Date
    Feb 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Just add this code to your pages:

    <a href="http://pdfcrowd.com/url_to_pdf/">Convert this page to a PDF</a>

    Here is an explanation how it works: http://pdfcrowd.com/save-to-pdf/.


  •  

    Posting Permissions

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