Combine multiple PDF's with proper paging?

Ask a Question related to Adobe Acrobat Windows, Design and Development.

  1. #1

    Default Combine multiple PDF's with proper paging?

    I'm very new to Acrobat, so please forgive me if this is trivial or has been answered 1000 times already! I searched but couldn't find an answer.

    I have a number of PDF files that I would like to combine into one PDF for sending to a printing company. Combining them is easy enough, but the document will be printed duplex (i.e. both sides of the paper). It is important that the first page of each "sub-document" (think chapters in a book :-)) starts on the front of a page, leaving a blank page before it if necessary. There are too many "sub-documents" to do this manually. Can it be automated?

    I am a developer, so I'm not scared to script or code it if necessary. I just need to find a way to produce the desired end result.

    Thanks!
    Brad.
    Bradley_Plett@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. Proper Windows 2003 Server setup with multiple DC's
      Hello all I have setup a new Windows 2003 single DC which is by all I have read the GC as well. I wish to install a new DC for redundancy DNS,...
    2. Linking to destinations in a PDF & multiple PDF's opening
      I have a single PDF that contains many destinations. I have several HTML pages that contain one link per destination that when clicked takes the user...
    3. Cannot combine PDF's (insert page) because of font subset conflict
      I'm experiencing a conflict when trying to "insert pages" of a PDF file into another PDF file. A warning pops up with something about the naming of...
    4. Combine Multiple Files into 1 Layered Files
      Does anyone have a solution to simplify this process? I wish to take a folder of images, combine them into one layered file where each layer is named...
    5. --- Multiple Selection, with Paging in the Datagrid ---
      Hi, Hard work but possible. You need to keep internal data (add fields to row data) on the server to track the selected rows. Natty Gur, CTO...
  3. #2

    Default Re: Combine multiple PDF's with proper paging?

    [email]Bradley_Plett@adobeforums.com[/email] wrote:
    > I'm very new to Acrobat, so please forgive me if this is trivial or has been answered 1000 times already! I searched but couldn't find an answer.
    >
    > I have a number of PDF files that I would like to combine into one PDF for sending to a printing company. Combining them is easy enough, but the document will be printed duplex (i.e. both sides of the paper). It is important that the first page of each "sub-document" (think chapters in a book :-)) starts on the front of a page, leaving a blank page before it if necessary. There are too many "sub-documents" to do this manually. Can it be automated?
    >
    > I am a developer, so I'm not scared to script or code it if necessary. I just need to find a way to produce the desired end result.
    >
    > Thanks!
    > Brad.
    Here is an idea. Create a blank page and save it as a single PDF
    document. Write a script that counts the number of pages in each
    sub-document. If the sub-document has an odd number of pages, append
    the blank page to the end. When it is done, combine all the
    sub-documents to yield your completed PDF.

    If you have Acrobat, you could do this with JavaScript and batch
    processing, I suspect. Or VB and Acrobat OLE, or Perl and Acrobat OLE,
    or ...

    If you don't have Acrobat, you could do this with pdftk, which you could
    use to report the number of PDF pages and then append the blank PDF page
    as needed.

    HTH-

    Sid Steward
    Sid_Steward@adobeforums.com Guest

  4. #3

    Default Re: Combine multiple PDF's with proper paging?

    That would be a perfectly acceptable solution. However, as I've said, I'm new to Acrobat. I could really use an example or some sample scripts/programs. We have Acrobat, and I'm comfortable with pretty much any language (though the final solution will probably be in VB.NET). If I could just find a bit of documentation on scripting and/or a sample or two, I'm sure this would be easy.

    Brad.
    Bradley_Plett@adobeforums.com Guest

  5. #4

    Default Re: Combine multiple PDF's with proper paging?

    OK, I got this mostly working thanks to <http://www.planetpdf.com/mainpage.asp?WebPageID=47>

    One minor problem remaining: how do I programmatically create a blank page? I would think this would be trivial, but having searched extensively, I haven't found anything that helps. As a kludge/work-around, I've created a pdf file containing a blank page, but that's not exactly an elegant solution! :-)

    Brad.
    Bradley_Plett@adobeforums.com Guest

  6. #5

    Default Re: Combine multiple PDF's with proper paging?

    [email]Bradley_Plett@adobeforums.com[/email] wrote:
    > OK, I got this mostly working thanks to <http://www.planetpdf.com/mainpage.asp?WebPageID=47>
    >
    > One minor problem remaining: how do I programmatically create a blank page? I would think this would be trivial, but having searched extensively, I haven't found anything that helps. As a kludge/work-around, I've created a pdf file containing a blank page, but that's not exactly an elegant solution! :-)
    >
    > Brad.
    Whoops- Sorry about the lack of document ref.s.

    In Acrobat JavaScript, you can create a new, blank page by executing:

    app.newDoc( 612, 792 )

    where the arguments give the page size in points. You could measure one
    of your sub-doc's pages, first, to ensure a good fit.

    You can access Acrobat JavaScript methods from VB, according to
    technical note 5417: Programming Acrobat JavaScript Using Visual Basic.
    This seems to be part of the Acrobat SDK documentation.

    The Acrobat 6 SDK docs require a membership, but the Acrobat 5 SDK docs
    do not. All sorts of other goodies, too, if you plan to program Acrobat:

    [url]http://partners.adobe.com/asn/acrobat/download.jsp[/url]

    The Acrobat JavaScript spec. is technical note 5186:
    [url]http://partners.adobe.com/asn/developer/pdfs/tn/5186AcroJS.pdf[/url]


    Sid Steward
    Sid_Steward@adobeforums.com Guest

  7. #6

    Default Re: Combine multiple PDF's with proper paging?

    Oddly, trying to create a blank page is turning out to be more difficult than merging the documents! I've been able to create a blank page from the JavaScript console using "app.newDoc", but haven't figured out how to access the app object from the JSObject.

    Any help would be appreciated.

    Thanks!
    Brad.
    Bradley_Plett@adobeforums.com Guest

  8. #7

    Default Re: Combine multiple PDF's with proper paging?

    More information: I'm able to create a new document with a blank page using "jso.app.newDoc(612, 792)", but the COM object that is returned is not the new document. I'm not sure what's returned, but it doesn't work in "InsertPages". Also, now when I close Acrobat it asks me whether I want to save the new, temporary document. I assume that if I can somehow access the new document, I should be able to close it without the prompt, but....

    Brad.
    Bradley_Plett@adobeforums.com Guest

  9. #8

    Default Re: Combine multiple PDF's with proper paging?

    [email]Bradley_Plett@adobeforums.com[/email] wrote:
    > More information: I'm able to create a new document with a blank page
    > using "jso.app.newDoc(612, 792)", but the COM object that is returned is
    > not the new document. I'm not sure what's returned, but it doesn't work
    > in "InsertPages". Also, now when I close Acrobat it asks me whether I
    > want to save the new, temporary document. I assume that if I can somehow
    > access the new document, I should be able to close it without the
    > prompt, but....
    According to the Acrobat JavaScript docs, you get a "Doc Object"
    returned from app.openDoc. Maybe the problem is that it's a
    "JavaScript" PDF document and not a "COM" PDF document object? Have you
    tried manipulating it with the JavaScript Doc object methods (e.g.,
    closeDoc insertPages)?

    Sid Steward
    Sid_Steward@adobeforums.com Guest

  10. #9

    Default Re: Combine multiple PDF's with proper paging?

    Brad-

    Here is a little JavaScript I wrote that works on a single document. If
    the current document has an odd number of pages, it adds a blank page to
    the end that takes the same dimensions as the last page.

    In Acrobat 5, I wasn't able to use it with batch processing due to a
    curious bug in Acrobat (I found a workaround here[1]). I haven't tried
    it in Acrobat 6, yet.

    Anyhow, I hope it helps-

    Sid Steward

    if( this.numPages % 2 == 1 ) {
    last_page_i= this.numPages- 1;
    crop_box= this.getPageBox( "Crop", last_page_i );
    new_doc= app.newDoc( crop_box[2]- crop_box[0],
    crop_box[1]- crop_box[3] );
    this.insertPages( last_page_i, new_doc.path, 0, 0 );
    new_doc.closeDoc( true );
    }

    [1] [url]http://www.planetpdf.com/mainpage.asp?webpageid=1515[/url]
    Sid_Steward@adobeforums.com Guest

  11. #10

    Default Re: Combine multiple PDF's with proper paging?

    Hi,

    I don't understand that you try to make it so complicated. In the documentation you will find that newDoc don't work with JSO and that it don't work in every case.

    You may create a sorted file list for the files you want to merge (including Blank.pdf at the places you need it). Then insert all files based on the file list. This gives you a high flexibility, regarding sorting, inserting from different directories, easy producing different versions, .... The Blank.pdf you may store into the unavoidable dir \My Documents\Adobe ...

    Maybe in PdfTK you can use then: pdfTK <FileList.txt cat output MyBooklet.pdf
    Sid may know if that works, otherwise write a short programm or I may spend you a WSH/VBS to handle it.

    HTH, Reinhard
    Reinhard_Franke@adobeforums.com Guest

  12. #11

    Default Re: Combine multiple PDF's with proper paging?

    Thanks a lot for your help. I'm quite surprised that there isn't a simple "newPage" method on the PDDoc object, but.... Anyway, I've got what I need even if it's not as pretty as I'd like! :-)

    Thanks again!
    Brad.
    Bradley_Plett@adobeforums.com Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139