I have been looking online for some time now, but I still haven\'t figured out how to print a PDF file in Delphi without showing the document itself, or a print dialog. I ju
Printing a PDF to a printer without attempting to use Adobe Reader from Delphi can be done using Debenu Quick PDF Library, which supports all versions of Delphi from 4 to XE8. Sample code for printing a PDF programmatically without previewing it first:
procedure TForm6.PrintDocumentClick(Sender: TObject);
var
iPrintOptions: Integer;
begin
DPL := TDebenuPDFLibrary1115.Create;
try
UnlockResult := DPL.UnlockKey('...'); // Add trial license key here
if UnlockResult = 1 then
begin
// Load your file
DPL.LoadFromFile('test.pdf', '');
// Configure print options
iPrintOptions := DPL.PrintOptions(0, 0, 'Printing Sample');
// Print the current document to the default printing
// using the options as configured above
DPL.PrintDocument(DPL.GetDefaultPrinterName(), 1, 1, iPrintOptions);
end;
finally
DPL.Free;
end;
end;
More advanced printing options are also available using the customer printer functions. It's not a free SDK, but it will do exactly what you want.