在 Delphi 2009 中显示 PDF 文件的最佳方式是什么 [英] What is the best way to display a PDF file in Delphi 2009

查看:18
本文介绍了在 Delphi 2009 中显示 PDF 文件的最佳方式是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该使用什么组件在 Delphi 2009 应用程序中显示 PDF 文件?

What component should I use to display a PDF file in a Delphi 2009 application?

我一直在使用 Synactis 的 PDF 查看器 - 一个非常不错的免费 PDF 查看器但它不支持 Delphi 2009.

I have been using PDF Viewer by Synactis - a very nice free PDF Viewer But it has no Delphi 2009 support.

所以我需要在产品之外设计它

So I need to designing it out of the product

推荐答案

我们在 Delphi 应用程序中嵌入了 Acrobat Reader.查看这篇文章如何将 Adob​​e Acrobat 嵌入到您的应用程序中".将 Acrobat Reader ActiveX 组件添加到表单后,您可以使用以下代码:

We embedded the Acrobat Reader in our Delphi application. Take a look at this article "How to embed Adobe Acrobat into your application". Once you have added the Acrobat Reader ActiveX component to your Form you can use following code:

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 组件可以满足我们的需求.

There is native Delphi components out there but embedding the Acrobat Reader component served our needs.

这篇关于在 Delphi 2009 中显示 PDF 文件的最佳方式是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆