Delphi

About the programming interface for the virtual PDF printer driver.

Moderator: jr

Delphi

Postby Fixfinn » Mon Jan 11, 2010 11:54 am

Does anyone know how to programm Pdfprinter from Delphi?


Best regards
Fixfinn
 
Posts: 4
Joined: Mon Jan 11, 2010 11:19 am

Re: Delphi

Postby Bullzipper » Thu Mar 11, 2010 7:09 pm

Yes, I have the same problem. Have you made any progress with this?

Thanks;
Bullzipper
 
Posts: 1
Joined: Thu Mar 11, 2010 5:34 am

Re: Delphi

Postby Fixfinn » Wed Apr 21, 2010 2:57 pm

I just make different *.ini files in notepad and then copy/move them in delphi, depending on which I have to use.
It is not so elegant, but it works.

Now I have to find out how to see when making the pdf-file is finish?
Fixfinn
 
Posts: 4
Joined: Mon Jan 11, 2010 11:19 am

Re: Delphi

Postby riley.carrier » Wed Apr 27, 2011 6:27 pm

If you haven't imported the type library that's the first step. Once that's been done, you can use something similar to what is below:

The following fragment assumes you've created the PDFPrinterSettings as a VCL object in a datamodule or form i.e., PDFPrinterSettings1: TPDFPrinterSettings;

procedure setuppdfprinter;
var
pi : integer;
begin
try

pi := printer.Printers.IndexOf('Bullzip PDF Printer [SOA]');
printer.PrinterIndex := pi;

PDFPrinterSettings1.Connect;
PDFPrinterSettings1.SetPrinterName('Bullzip PDF Printer [SOA]');
PDFPrinterSettings1.LoadSettings(FALSE);
oppfn := '\\' + OppOutFileNodeName + '\' + JobFile.GetInstance + '$\' + ExtractFileName(UnixPathToDosPath(OppOutFileName));
PDFPrinterSettings1.SetValue('output', oppfn);

{$IFDEF WATERMARK}
if JobFile.GetInstance <> 'xxxxxxx' then
begin
PDFPrinterSettings1.SetValue('WatermarkText', 'TEST DOCUMENT');
PDFPrinterSettings1.SetValue('WatermarkTransparency', '70');
end;
{$ENDIF}

PDFPrinterSettings1.WriteSettings(TRUE);
PDFPrinterSettings1.Disconnect;
except
writeln('Error connecting to OLE');
end;
end;

Since you've selected the PDF printer as your output device it will create a PDF document when you print using begindoc/enddoc or whatever process you are using. The jobfile class is custom and unique, just make sure you specify the output filename for the pdf document. If you are multi-threaded then you will need to synchronize writing the printer settings.

I also set the document title before physically printing it. I hope this helps.
riley.carrier
 
Posts: 1
Joined: Wed Apr 27, 2011 6:13 pm

Re: Delphi

Postby clear1140 » Wed Sep 21, 2011 3:01 am

Good Day,

I'm new to delphi and i tried the code above. I was wondering how to
1.) un-check the "open the document after creation" checkbox
2.) to automatically "save" without showing the "Bullzip PDF Printer - Create File" form after sending the file to print

hoping for a response, thank you in advance.
clear1140
 
Posts: 2
Joined: Wed Sep 21, 2011 2:53 am

Re: Delphi

Postby clear1140 » Wed Sep 21, 2011 3:40 am

ah forget about my previous post .. found it out by configuring the gui.exe
clear1140
 
Posts: 2
Joined: Wed Sep 21, 2011 2:53 am


Return to Programming

Who is online

Users browsing this forum: No registered users and 2 guests

cron