creating several print jobs using PDF Creator

The PDF Creator enables you to create secure PDF documents and to view, print and process existing PDF documents.
If you have any questions about the installation and usage of the PDF Creator please post them here.
Post Reply
Shura
Posts: 2
Joined: Thu Mar 18 2004

creating several print jobs using PDF Creator

Post by Shura »

Hi! I use PDFCreactiveX.dll Version 1.09b
I want to create print job for each printed file. Below is a Delphi code for this :

var PDF:Variant;
I:Integer;
begin
Pdf := CreateOleObject('PDFCreactiveX.PDFCreactiveX');
pdf.Open('1.pdf', '');
Pdf.StartPrint('HPLJ1100', false);
for I := 1 to Pdf.PageCount do begin
// In the futere here will be som page manipulations.
pdf.PrintPage(I);
end;
Pdf.EndPrint;

pdf.Open('2.pdf', '');
Pdf.StartPrint('HPLJ1100', false);
for I := 1 to Pdf.PageCount do begin
// In the futere here will be som page manipulations.
pdf.PrintPage(I);
end;
Pdf.EndPrint;
Pdf := Unassigned;

If I use single block of StartPrint ... endPrint it is all ok, but in the spooler it is the only print job for all documents. I realy need to create separate print job per file. Could you please tell me, what I'm doing wrong?
Jose
Amyuni Team
Posts: 553
Joined: Tue Oct 01 2002
Contact:

Post by Jose »

Hello,

In looking at your source code, it seems that the first "Pdf.EndPrint;" function should end the first print job.

Have you stepped through you code and verified that when you call the StartPrint(), a print job is started and when the EndPrint is called the print job ends?

Thanks
Shura
Posts: 2
Joined: Thu Mar 18 2004

Post by Shura »

Yes, first job printed successfully and second job even doesn't appears in the print spooler.

Next code works great:

var PDF:Variant;
I:Integer;
begin
Pdf := CreateOleObject('PDFCreactiveX.PDFCreactiveX');
pdf.Open('1.pdf', '');
Pdf.StartPrint('HPLJ1100', false);
for I := 1 to Pdf.PageCount do begin
// In the futere here will be som page manipulations.
pdf.PrintPage(I);
end;
//Pdf.EndPrint;

pdf.Open('2.pdf', '');
//Pdf.StartPrint('HPLJ1100', false);
for I := 1 to Pdf.PageCount do begin
// In the futere here will be som page manipulations.
pdf.PrintPage(I);
end;
Pdf.EndPrint;
Pdf := Unassigned;

But the code listed in the previos post print only the first file, and nothing happens on the second block of StartPrint ... EndPrind.

I need to create separate print job per file.
I will very appreciate your help.

Thanks.
Post Reply