Everything you need to know is in your own presentation on C functions available in RPG. Open a PDF in EDTF set for ASCII and scroll to the bottom. You'll be able to reverse engineer the page offset table. If I had access to a machine I'd whip this out in RPG and post it. Probably not more than 50 lines of code. 

<div>-------- Original message --------</div><div>From: Jon Paris <jon.paris@xxxxxxxxxxxxxx> </div><div>Date:12/08/2014 5:12 PM (GMT-06:00) </div><div>To: Midrange-L Midrange-l <midrange-l@xxxxxxxxxxxx> </div><div>Subject: Re: Merging PDFs </div><div>
</div>That sounds more doable Dan - if only I knew C better!

This is pretty much all I need to do - simply merge n PDFs into a single document.

Surely there are C libs out there that manipulate PDFs as the java etc. libs do.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Dec 8, 2014, at 5:57 PM, dkimmel <dkimmel@xxxxxxxxxxxx> wrote:

It's more straightforward in RPG than others have implied. Use the C string and file libraries. All the tags in PDF are ASCII. at the very end is a table of offsets to the pages. This table may also contain an offset to a previous table. The offsets are in ASCII. You can add pages to a PDF without disturbing the existing pages. To merge two documents, copy the binary stream from the first to the output and save the offset to the page table in the first and save the total length. Then copy the binary stream of the second doc to output up to its page table. Write the page table incremening each page offset value by the length of the stream length from the first doc and include the offset to the previous page table.

<div>-------- Original message --------</div><div>From: Jon Paris <jon.paris@xxxxxxxxxxxxxx> </div><div>Date:12/08/2014 12:26 PM (GMT-06:00) </div><div>To: Midrange-L Midrange-l <midrange-l@xxxxxxxxxxxx> </div><div>Subject: Merging PDFs </div><div>
</div>Anyone had any experience merging PDFs ?

I know there is a Java tool that I could use but I am trying to avoid having to use anything beyond RPG + C functions in this instance as the stuff has to be distributed to multiple systems.


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].