我应该使用什么组件在 Delphi 2009 应用程序中显示 PDF 文件?
编辑:
我一直在使用PDF Viewer by Synactis - 一个非常好的免费 PDF 查看器 但它没有 Delphi 2009 支持。
所以我需要从产品中设计它
最佳答案
我们在 Delphi 应用程序中嵌入了 Acrobat Reader。 看看这篇文章“How to embed Adobe Acrobat into your application”。 将 Acrobat Reader ActiveX 组件添加到表单后,您可以使用以下代码:
procedure TForm1.Button1Click(Sender: TObject);
begin
// This example assumes that you have a TOpenDialog
// and TPdf dropped onto your form
OpenDialog1.Filter := 'PDF Files (*.pdf)|*.pdf';
if OpenDialog1.Execute then
Pdf1.src := OpenDialog1.FileName;
end;
有原生的 Delphi 组件,但嵌入 Acrobat Reader 组件满足了我们的需求。
关于delphi - 在 Delphi 2009 中显示 PDF 文件的最佳方式是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/624246/