On a linux machine I installed CUPS-PDF
Now I can write to a VirtualPrinter.
The actual created PDF file can be found in the directory that you specified in /etc/cups/cups-pdf.conf
under Out In my case "Out {$HOME}/Documents"
procedure TForm1.Button1Click(Sender: TObject);
CONST printerpad = 'Documents';
BEGIN
naam:= 'Doc__' + GetEnvironmentVariable('USER') + '_Documents.pdf';
//Optional
DeleteFile(printerpad + '/' + naam);
Printer.SetPrinter('Virtual_PDF_printer');
Printer.Title:= 'Doc';
Printer.BeginDoc;
// Your code
Printer.EndDoc;
//Optional:
SysUtils.ExecuteProcess(UTF8ToAnsi('/usr/bin/okular'),printerpad + '/' + naam, []);
end;
I don't know much about MS Windows. CUPS is Unix specific.
Try using PDFCreator as printer in Windows