Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 06-17-2005, 10:20 PM
dorjvar dorjvar is offline
Member
 
Join Date: May 2005
Posts: 38
Default Pdf & Word

hello dir friends
I Want to open pdf and word files in delphi without opening
acrobat or word
please Help Me
Thanks
Your Friend Dorjvr
Reply With Quote
  #2  
Old 06-18-2005, 03:31 AM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Pdf & Word

You can not open PDF files directly in delphi without using the Acrobat Reader application or the ActiveX control, unless you write your own control to show the file - which i don't recommend you try to attemp if you are a novice delphi programmer.

There are thirdparty controls to view PDF files without relying on ADOBE

One of the top of my mind is:

GnostIce PDFtoolkit

http://www.gnostice.com/pdftoolkit.asp

Viewing Word Files is alittle easier but requires the same thing - a third party control. The TRichEdit (Standard) that comes with Delphi, can view RTF files, but only the text and formatting - Not images or anyother OLE stuff. You will need to find a third party RTF control which can handle the images

http://www.trichview.com/features/








If this helps, please accept as answer!

UnSysApps
Reply With Quote
  #3  
Old 06-18-2005, 03:50 AM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Pdf & Word

Here's how to use the TWebBrowser control to preview and print Microsoft Word documents.

Drop a TWebBroswer (name: WebBrowser1) on a Form and assign the next code for the NavigateComplete2 event handler:

procedure TForm1.FormCreate(Sender: TObject) ;
begin
//open a Word document in WebBrowser
WebBrowser1.Navigate('c:\SomeFolder\SomeDocument.d oc') ;
end;

procedure TForm1.WebBrowser1NavigateComplete2(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant) ;
begin
with (WebBrowser1.Document AS _Document) do
begin
ActiveWindow.View.ShowAll := False;
ActiveWindow.View.TableGridlines := False;
ActiveWindow.DisplayRulers := False;

ActiveWindow.View.type_ := wdPageView;
end;
end;

~~~~~~~~~~~~~~~~~~~~~~~~~
// print directly without printer dialog
procedure WBPrintNoDialog(WB: TWebBrowser) ;
var
vIn, vOut: OleVariant;
begin
WB.ControlInterface.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, vIn, vOut) ;
end;

//call the printer dialog
procedure WBPrintWithDialog(WB: TWebBrowser) ;
var
vIn, vOut: OleVariant;
begin
WB.ControlInterface.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER, vIn, vOut) ;
end;

// Print Preview
procedure WBPrintPreview(WB: TWebBrowser) ;
var
vIn, vOut: OleVariant;
begin
WB.ControlInterface.ExecWB(OLECMDID_PRINTPREVIEW, OLECMDEXECOPT_DONTPROMPTUSER, vIn, vOut) ;
end;

//Call page setup dialog
procedure WBPrintPageSetup(WB: TWebBrowser) ;
var
vIn, vOut: OleVariant;
begin
WB.ControlInterface.ExecWB(OLECMDID_PAGESETUP, OLECMDEXECOPT_PROMPTUSER, vIn, vOut) ;
end;




You can also use TWebBrowser to preview & Print PDF's as well, however, you will have to have the Acrobat ActiveX control installed and then you will have to import the activeX into delphi and create a _TLB unit. Let me know if this is a route you may be interested in.....and i can help further



If this helps, please accept as answer!

UnSysApps
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 12:55 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.