首页 > 其他分享 >delphi quick pdf library打印PDF很方便

delphi quick pdf library打印PDF很方便

时间:2023-01-01 15:56:25浏览次数:36  
标签:PDFLibrary delphi library iPrintOptions pdf quick PDF

// 事先需要安装foxit quick pdf library ,安装完成,把DebenuPDFLibraryDLL1811.pas文件添加你的项目文件内
// 把DebenuPDFLibraryDLL1811.dll动态库复制到你执行程序目录
// 执行调用指定打印机打印PDF文件
var PDFLibrary: TDebenuPDFLibraryDLL1811; UnlockResult: Integer; CustomPrinter:string; iPrintOptions: Integer; begin PDFLibrary := TDebenuPDFLibraryDLL1811.Create(ExtractFilePath(Application.ExeName) + 'DebenuPDFLibraryDLL1811.dll'); try UnlockResult := PDFLibrary.UnlockKey('quick pdf key'); // 需要软件密钥,去网上找个破解的密钥 if UnlockResult = 1 then begin PDFLibrary.LoadFromFile(Edit3.Text, ''); CustomPrinter := PDFLibrary.NewCustomPrinter('Microsoft Print to PDF'); // 自定义打印机 iPrintOptions := PDFLibrary.PrintOptions(0, 0, 'Hello World.pdf'); PDFLibrary.PrintDocument(CustomPrinter, 1, 1, iPrintOptions); // PDFLibrary.PrintDocument(PDFLibrary.GetDefaultPrinterName, 1, 1, iPrintOptions); // 默认打印机打印 end else begin ShowMessage('Invalid license key'); end; finally PDFLibrary.Free; end;

标签:PDFLibrary,delphi,library,iPrintOptions,pdf,quick,PDF
From: https://www.cnblogs.com/yangxuming/p/17018138.html

相关文章