我使用Delphi 7并想知道该文件是否正在打印到PDF设备,因此我可以进行一些特殊处理。这就是我必须要让它发挥作用。
// If the printer is a PDF type it will ask for the file name here.
Printer.BeginDoc;
// The next line returns the file extension of the original file name and
// not the extension of the file being printed to.
Extension := AnsiUpperCase(ExtractFileExt(Printer.Title));
// I've added this line to get it to work but want to be able
// just check if the current child is being printed to a pdf device.
if CustomPrintDialog.ActivePrinter.Caption = 'Adobe PDF' then