Print Page | Close Window

Merging PDFs

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=521
Printed Date: 19 May 24 at 8:05AM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Merging PDFs
Posted By: Kaus Media
Subject: Merging PDFs
Date Posted: 29 Sep 06 at 3:48AM
Hi there,

I have a database with page records (1 page PDF) I need to merge. It seemed obvious it should work with something like:

while Not EOF do begin
   intNewDocument := pdf.NewDocument;
   pdf.SelectDocument (intNewDocument);
   bs := CreateBlobStream(FieldByName('PDF'), bmRead);
   pdf.LoadFromStream(bs);
   //pdf.SaveToFile ('c:\test.pdf') <= File is not blank!
   pdf.SelectDocument(intMainDocument);
   pdf.MergeDocument(intNewDocument);
   bs.Free;
   Next;
end;

But it ain't!!! I have the proper number of pages, but all are blank! (An I don't have the source to see what's wrong :))

Can anyone help? Thank you :)

-------------
KMD



Replies:
Posted By: Ingo
Date Posted: 29 Sep 06 at 7:42AM
Hi!

Please try the search function (on the top, right side) on this page with "merg". There are a many postings and your solution will be already there ;-)

Best regards,
Ingo


Posted By: Kaus Media
Date Posted: 02 Oct 06 at 9:05AM
Hi Ingo,

It's been the whole morning I am looking into the forums and tried a lot of thing, but nothing works as expected.
The thing is that I need to merge a lot of pages together. Source files are fax pages in high resolution, one-page pdf source file (A drawn BMP image on the first page) that comes from a "pages" table.

If I use MergeStreams, it works. But the thing is that it is exponentially slow because for each new page added it must copy in memory the whole source stream to the destination stream.

If I try MergeDocuments, or CopyPageRanges, these two functions gives me blank pages (with a success return code!)

I have checked for the permissions on the pdf files also. Everything is allowed on all the files.

The only solution I have finally come up with and that is not exponentialy slow is to save every blob from the DB to disk and then use a MergeFileListFast... (Which is also time consuming since it must load every page from the database, save it to disk, reload it, and save it once again. Three times more disk access than necessary).

I have read somewhere in the forums that QuickPDF does not properly support huge image files. Maybe this is the reaon...




-------------
KMD



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk