SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trying to merge multiple PDF's into a single PDF document

    Scenario:

    We have presentations that we give our customers.

    Part 1 - Is a single page w/ the Sales Person's information and customer information (PDF)
    Part 2 - Is a 10 page presentation in a single PDF file
    Part 3 - Is a custom Call Me for more information (also a PDF)

    I want the salesperson to hit submit, the document gets created as a single PDF Presentation for them to send out to their customer.

    Thanks in advance.

    -Jeff

  2. #2
    Mouse catcher silver trophy Stevie D's Avatar
    Join Date
    Mar 2006
    Location
    Yorkshire, UK
    Posts
    5,888
    Mentioned
    122 Post(s)
    Tagged
    1 Thread(s)
    It's possible to do this if you buy the full version of Adobe Acrobat (rather than just the free reader), but I'm not aware of any free software that will allow you to combine files like that.

  3. #3
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    We have the full version of Acrobat but I would like to make this happen in the script. Our sales people do not have Acrobat Pro but we (marketing) do. That is what we are doing now, trying to lighten the load around here. Thanks for replying.

  4. #4
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,836
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    See http://www.setasign.de/products/pdf-php-solutions/fpdi/

    That extension to the FPDF library for PHP allows you to read in and update existing PDFs including merging multiple PDFs into one directly from PHP.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  5. #5
    SitePoint Member
    Join Date
    Dec 2008
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, got it to work using PDFTK. You need to install that on your server but after that you can excecute it using PHP.

    // Execute in this format - pdftk 1.pdf 2.pdf 3.pdf cat output 123.pdf

    $merged_pdf = exec("pdftk $first $second $third cat output $fileName");
    echo $merged_pdf;

  6. #6
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,836
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by tazizhere View Post
    OK, got it to work using PDFTK. You need to install that on your server but after that you can excecute it using PHP.
    The suggestion I gave was a pure PHP solution that didn't need access to install anything extra on the server (other than the fpdf and fpdi php libraries which are just ordinary PHP files and so can be uploaded the same way as all your other PHP files).
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Tags for this Thread

Bookmarks

Posting Permissions

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