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 - Help with batch printing
  FAQ FAQ  Forum Search   Register Register  Login Login

Help with batch printing

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


Joined: 29 Jun 07
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote mac32bit Quote  Post ReplyReply Direct Link To This Post Topic: Help with batch printing
    Posted: 05 Jul 07 at 11:13AM
Hi all
 
I have written the following code to batch print all PDFs in a folder.
 
Do I have to wait somehow for QP.PrintDocument to finish before printing the next document?
 
Many thanks in advance.
 
Mac
 
 
 
procedure TForm1.BitBtn2Click(Sender: TObject);
var
Done:integer;
SearchRec:TSearchRec;
begin

    try
      Done := Findfirst(IncludeTrailingPathDelimiter(BatchEditPath.Text)  + '*.pdf', faAnyFile, SearchRec);
      while Done = 0 do
        begin
          if ((SearchRec.Attr and faDirectory) = 0) and
              (SearchRec.Name <> '.') and
              (SearchRec.Name <> '..') then
          begin
              PrintPdf(IncludeTrailingPathDelimiter(BatchEditPath.Text) + SearchRec.Name);
          end;
          Done := FindNext(SearchRec);
        end;
    finally
        FindClose(SearchRec);
    end;

end;


procedure TForm1.PrintPdf(MyFileName: string);
var
QP : TiSEDQuickPDF;
MyPageCount, MyOptions: integer;
MyPrinter :string;

begin

  QP := TiSEDQuickPDF.Create;
  try

    if QP.UnlockKey('EvaluationKeyHere') <> 1 then
        raise Exception.Create('Invalid license key');

    if QP.LoadFromFile(MyFileName) <> 1 then
        raise Exception.Create('Cannot load PDF file: ' + MyFileName);

    If QP.Encrypted > 0 Then
        QP.Unencrypt;

    MyPageCount := QP.PageCount;

    MyPrinter := QP.NewCustomPrinter(PrintersComboBox.Text); 

    // 2=shrink large pages, 1=rotate to fit and centre on page 
    MyOptions := QP.PrintOptions(2, 1, MyFileName);

    case PaperGroup.ItemIndex of
      0: QP.SetupCustomPrinter(MyPrinter,1,DMPAPER_A3);
      1: QP.SetupCustomPrinter(MyPrinter,1,DMPAPER_A4);
    end;

    if QP.PrintDocument(MyPrinter, 1, MyPageCount, MyOptions) = 0 then
      raise Exception.Create('Cannot print file: ' + MyFileName);

  finally
    QP.Free;
  end;

end;

Back to Top
marian_pascalau View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 28 Mar 06
Location: Germany
Status: Offline
Points: 278
Post Options Post Options   Thanks (0) Thanks(0)   Quote marian_pascalau Quote  Post ReplyReply Direct Link To This Post Posted: 05 Jul 07 at 1:56PM
Hi there,
as much as I know it is ok this way (program I have not checked).
 
Best regards, Marian
Back to Top
mLipok View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Apr 14
Location: Poland, Zabrze
Status: Offline
Points: 453
Post Options Post Options   Thanks (0) Thanks(0)   Quote mLipok Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 15 at 5:02PM
I use QuickPDF library
My clients (all together) print more then 5000 pdfs each day.
And they are very happy.

Why you revive this so old thread.

Here you can find description how to test my examples:
http://www.quickpdf.org/forum/forum_posts.asp?TID=2932&PID=12600&title=drawcapturedpagematrix-matrix-howto#12600
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 15 at 10:03PM
Hi mLipok,

i've removed the message you've answered to.
Looked like spam ;-)

Cheers, Ingo
Cheers,
Ingo

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