Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - AddToFileList not working....
  FAQ FAQ  Forum Search   Register Register  Login Login

AddToFileList not working....

 Post Reply Post Reply
Author
Message
agent86 View Drop Down
Beginner
Beginner


Joined: 06 Feb 10
Location: SF Bay Area
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote agent86 Quote  Post ReplyReply Direct Link To This Post Topic: AddToFileList not working....
    Posted: 06 Feb 10 at 6:23PM

Delphi 7
QPDF 0717

When I merge files using the following procedure I get 1 blank page.  The resulting document has the correct name but no contents.  I've searched in vain for what I'm doing wrong.  I've looked at the Delphi demos and can't see what I'm doing wrong.  I've already searched the forum but there is no sample code to show how to successfully use AddToFileList and MergeFileList. 

I'm still evaluating Quick PDF but this is one of my last hurdles before I buy. 

procedure TAutoPrintMainFormForm.MergeEmailPDFsQPDF ;
var source, destination, pname : string ;
   i : integer ;
   Unlockresult : integer ;
   QPDF : TQuickPDF0717 ;
   groupfolder, problemsfolder, pdftempfolder : string ;
   sFileName, pdfname : AnsiString ;
begin
   try
     QPDF := TQuickPDF0717.Create ;
     UnlockResult := QPDF.UnlockKey(QPDFKey);

     QPDF.ClearFileList(sFileName) ;

     // add pdfs to list for merging
     for i := 0 to EmailPDFsFolderMemo.Lines.Count - 1 do
     begin
       // filename with path
       pdfname := Trim(EmailPDFsFolderMemo.Lines) ;
       QPDF.AddToFileList( sFileName, pdfname );
     end ;

     // make folder if it does not exist

     groupfolder := EmailPDFProcessFolderDBEdit.Text + '\' +
                    EmailFolderName ;

     // does folder already exist? if not create

     if not ( DirectoryExists ( groupfolder ) ) then
     begin
       ForceDirectories ( groupfolder ) ;
     end ;

     MergedPDFName := groupfolder + '\' +
                      EmailTransactionDateTime + '_' +
                      EmailFolderName + '.pdf' ;

     QPDF.MergeFileList( sFileName, MergedPDFName ) ;

     QPDF.SaveToFile(MergedPDFName) ;

   finally
     QPDF.Free ;
   end ;
  
end;

Back to Top
Wheeley View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 Oct 05
Location: United States
Status: Offline
Points: 146
Post Options Post Options   Thanks (0) Thanks(0)   Quote Wheeley Quote  Post ReplyReply Direct Link To This Post Posted: 06 Feb 10 at 11:38PM
You are overwriting your merged file with a blank page. Remove the line QPDF.SaveToFile(MergedPDFName). Also don't forget to clear the file list before you do the free.

Wheeley

Back to Top
agent86 View Drop Down
Beginner
Beginner


Joined: 06 Feb 10
Location: SF Bay Area
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote agent86 Quote  Post ReplyReply Direct Link To This Post Posted: 06 Feb 10 at 11:56PM
Thanks!  That took care of it.  Now I only have to deal with what happens when there is only 1 file in the folder.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store