Jump to content
Ian Branch

Working with PDF files??

Recommended Posts

Hi Team,

D11.3.

I need to be able to load a .pdf file to a TTable blob field, and display the blob/pdf on a form.

I can load the .pdf to a blob field no problem, but I can't figure out how to display it.

It would be nice if there was the ability to zoom in/out for viewing.

I would expect the display .pdf to change as the TTable changed records.

Looking for suggestions/ideas.

 

Regards & TIA.

Share this post


Link to post

Why don't you just use a WebView to display the PDF?

 

It can enable/disable zoom by gestures/touch/hotkeys, and set the general zoom level, but I think it cannot zoom in on a specific part of the PDF, like you can with two fingers on a touchscreen.

  • Like 1

Share this post


Link to post
1 hour ago, Der schöne Günther said:

Why don't you just use a WebView to display the PDF?

Customer is using Win 7.  😞

He also is still using IE and can't change that because of other Legacy applications.  😞

Share this post


Link to post
1 minute ago, Ian Branch said:

Customer is using Win 7.  😞

So what?

 

Also, the web browser for "surfing the internet" got nothing to do with how you want to display PDF files within your application. You should get familiar with the WebView2 runtime for your trusty old TWebBrowser. I'd strongly recommend.

Share this post


Link to post

I have, and have looked at that, but it has too many limitations att.

I need zoom in /out plus some other caabilities that I have mentioned to Bruno.

Share this post


Link to post

hi @Ian Branch

 

maybe the "easer way" do show your PDF or any other files (extention) registered in your browser, it would be: WebBrowser (old IDEs) or EdgeBrowser (new IDEs)

  • some extentions (or not registered to your browser open) will be "to download file" not to show it! you know...

you'll need:

  • web kit for your browser target  (im using "Microsoft.WebView2.FixedVersionRuntime.111.0.1661.54.x64.cab" library kit from MS)
  • web DLL in your exe folder

 

other way, would be "import a ActiveX from Adobe (for example) into your IDE and use this new component... but all target-PC needs have Adobe installed"

 

 

here my sample using EdgeBrowser components in RAD 11.3 do open a PDF file

 

...
  Vcl.Edge;

type
  TForm1 = class(TForm)
    EdgeBrowser1: TEdgeBrowser;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  EdgeBrowser1.Navigate('file://d:\p1.pdf')
end;

end.

image.png.fed67dedc4cbd7a27a94eff03ee03740.png

 

Edited by programmerdelphi2k

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×