Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TWebBrowser to Open PDF Files But without PDF Toolbar

2,029 views
Skip to first unread message

Prabhat

unread,
Sep 14, 2006, 8:11:32 AM9/14/06
to
Hello Friends!

I want to display PDF files on my Delphi 5 Interface (Delphi Form). On
Button click I have the below code:

URL := 'file://' + lblDocFullName.Caption;
Flags := navNoHistory or navNoReadFromCache or navNoWriteToCache;
wbPreview.Navigate(WideString(URL), Flags);
while wbPreview.ReadyState <> READYSTATE_COMPLETE do
begin
Application.ProcessMessages;
Sleep(0);
end;

it works fine and the TWebBrowser opens the pdf file correctly as
InternetExplorer does. My problem is that It also display the PDF ToolBar
same like InternetExplorer. We have a button "Show\Hide toolbar" below the
opened PDF file that can hide the PDF toolbar. But it is only for that
Document, If we open another document that also comes with the toolbar.

Is there any way that I can hide the PDF Toolbar in my application? Please
advice me.

Regards
Prabhat


fafa...@gmail.com

unread,
Sep 14, 2006, 4:12:09 PM9/14/06
to
Prabhat wrote:
> Is there any way that I can hide the PDF Toolbar in my application? Please
> advice me.

I googled for "acrobat hide toolbar internet explorer" and came up with
the following:

It's a bug:
- set the openprefs to 'full-screen' and the toolbar is gone.
- try "document.pdf#toolbar=0" in your HTML

also

You can hide the toolbar using this syntax:
<http://www.myWeb.com/myFile.pdf#toolbar=0>

In the full version of Arobat also check the file>document
properties>open options dialog box.

Hope this helps!

Marc Rohloff [TeamB]

unread,
Sep 14, 2006, 7:03:55 PM9/14/06
to
On Thu, 14 Sep 2006 17:41:32 +0530, Prabhat wrote:

> I want to display PDF files on my Delphi 5 Interface (Delphi Form). On
> Button click I have the below code:

Why don't you just embed the Acrobat Reader control directly?

--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com

Prabhat

unread,
Sep 15, 2006, 7:27:53 AM9/15/06
to
Hi Mark,

Thanks for the reply. Can you please guide me to do that. I think I can
import the adobe acrobat reader dll or ocx to make use of that but not sure.
I will also try.

Reg. TWebBrowser: If I use the webbrowser component I can handle many other
file types (like .jpg etc) along with PDF file types. But my current
requrement is only PDF. It will be helpful for me if you can guide me on
your suggestion.

Thanks
Prabhat

"Marc Rohloff [TeamB]" <"on request"> wrote in message
news:19764d3l...@dlg.marcrohloff.com...

Prabhat

unread,
Sep 15, 2006, 7:46:56 AM9/15/06
to
Hi Marc,

I have imported the Acrobat Reader control onto delphi 5 and used the
control to load the pdf using below code:

sFileName := 'D:\ScanDocs\DataWarehouse.pdf';
AcroPDF1.LoadFile(WideString(sFileName));
But still i get the toolbar. any idea?

Thanks
Prabhat

"Marc Rohloff [TeamB]" <"on request"> wrote in message
news:19764d3l...@dlg.marcrohloff.com...

Björn Schreiber

unread,
Sep 15, 2006, 10:33:21 AM9/15/06
to
Prabhat wrote:
> Hi Marc,
>
> I have imported the Acrobat Reader control onto delphi 5 and used the
> control to load the pdf using below code:
>
> sFileName := 'D:\ScanDocs\DataWarehouse.pdf';
> AcroPDF1.LoadFile(WideString(sFileName));
> But still i get the toolbar. any idea?

Take a look at the generated unit. You should find the following method:

procedure setShowToolbar(On_: WordBool);


Warning 1: This method doesn't allways react as you maybe expect. It
could be possible that you must call it two times.

Warning 2: If I take a look at the name - AcroPDF - I came to the
conclusion that you imported the Acrobat Reader control version 7. There
was a little change between version 4 to 6 and 7, the type library and
some GUIDs have changed. So if you want to run your program on others
systems with older versions of the control you should test it carefully.
We create the control dynamic and uses one type library for version 4
to 6 and another type library for version 7. In order to handle this
circumstance we wrote a wrapper class.

Warning 3: If you use version 7 of the control it doesn't react
allways on size changes. For example if you put the control on a form
and set the property Align to alClient, it could happen that the control
don't change it's size if you change the form size.


Hth,
Björn
--
Björn Schreiber, DRIGUS GmbH
new...@drigus.de
Bei Email NOSPAM in den Betreff aufnehmen.
Put NOSPAM in subject to reach me by email.

Prabhat

unread,
Sep 15, 2006, 10:44:22 AM9/15/06
to
Hi,

You have given a very good information on the subject. Thanks for that. I
know that my clients uses Ver 6x in theier PC I have 7x in my PC So as per
your advice I need to test all the circumstances before I give program.

Thanks
Prabhat

"Björn Schreiber" <new...@drigus.de> wrote in message
news:450a...@newsgroups.borland.com...

Prabhat

unread,
Oct 12, 2006, 8:07:10 AM10/12/06
to
Hi,

Can you please suggest some sample code where I can do all in run time for
<7x or >= 7x versions?

Also How can I clear the document that I have loaded in the control?

Thanks
Prabhat


0 new messages