TOPIC: Embedded document viewer
#1336
Embedded document viewer 1 Year, 4 Months ago
Hi,

I know there is an object to show images inside a window, but I am wondering if there is also an option to show a document in an embedded view (as a preview for example). Of course the document can be opened externally with for example Word or Acrobat Viewer, but a small viewer to show a documents first page can be handy is some cases.

Let me know if there is an option like that. Thanks...
 
 
#1337
Re:Embedded document viewer 1 Year, 4 Months ago
That would be useful. OpenImageControl that we use for "attachments" in our applications shows thumbnails for jpeg and gif, but not for other stuff like pdf or doc.

It just opens the files the same as if you double clicked on them in Windows Explorer.

We could add configuration so you could choose what application to use for each file type, e.g. to use the Word Viewer instead of the full Word.

I don't know of any programs or libraries to do this. If anyone knows of something, let us know.
 
 
andrew
 
#1338
Re:Embedded document viewer 1 Year, 4 Months ago
Thanks. So if I understand correctly there is a viewer that can be used for documents but it is default bypassed, so the document is opened in Word instead? Or is there no Viewer for documents yet? Maybe if it doesn't exist I could try to make my own. Not sure how difficult that would get.

Cheers :)
 
 
#1339
Re:Embedded document viewer 1 Year, 4 Months ago
Sorry, I wasn't clear. Suneido does not have a viewer (other than for images e.g. jpeg and gif).

The Word Viewer I mentioned is a Microsoft program.

Unless you can find some kind of library or tool, I think this would be hard to implement. Word docs and even pdf's are complex to render properly.
 
 
andrew
 
#1340
Re:Embedded document viewer 1 Year, 4 Months ago
Not exactly on topic but... maybe this link could help you dutchboy

www.suneido.com/index.php?option=com_fir...092&catid=3#1092
 
 
#1344
Re:Embedded document viewer 1 Year, 4 Months ago
Well there is a way to create an Word/Excel/PDFViewer in Suneido. It is a bit tricky. First : You need the AtlAxWinControl with "Shell.Explorer" !! as parameter. The trick is that the Internet Explorer is able to display word documents. (Using this technic, you can also display Excel, PDF, etc. documents)

// I don't remember the syntax so just a very raw description.

1) AtlAxWinControl( "Shell.Explorer" )
2) Call AtlAxWinControl's COMobject method
// returns f.i. ActiveX
3) ActiveX.Navigate( "MyDoc.doc" )

You have to play a bit with this erm. "snippet" but I have created an embedded Excel/Word viewer/editor! this way. (Using another 4GL system) HTH Nana
PS If I find a free hour I could publish a suneido version, in case that there is some interest.
 
 
Last Edit: 2009/04/16 11:55 By nana.
 
#1345
Re:Embedded document viewer 1 Year, 4 Months ago
Hi,

Thanks for the good tips. Actually I already fixed the issue using the internet browser embedded viewer. The PDF viewer is fine, so is Excel documents. The only problem is Word documents. The document shows, but no scrollbar, or option to zoom in/out. Any suggestions to that?

Thanks so far, great support!
 
 
#1346
Re:Embedded document viewer 1 Year, 4 Months ago
Hi,
hope I can help...running a bit out of time..
Ok, let's say your COMobject is named word.

word = COMobject( "Word.Application" )
// You have to extract it from AtlAxWinControl !!!

Code:


//Zoom
word.ActiveWindow.ActivePane.View.zoom.Percentage = nRatio 

//Showing document in different modes
word.ActiveWindow.View.Type = 6 // wdOnlineView

if word.ActiveWindow.View.SplitSpecial = 0  /* wdPaneNone */
{ word.ActiveWindow.ActivePane.View.Type = 3 /* wdPageView */
}else
{
word.ActiveWindow.View.Type = 3 // wdPageView
}

word.ActiveWindow.ActivePane.View.Type = 2 // wdOutlineView

word.ActiveWindow.ActivePane.View.Type = 5 // wdMasterView



HTH Nana aka Björn, PS send us a screenshot, if you like ;)
 
 
#1350
Re:Embedded document viewer 1 Year, 4 Months ago
Hi,

Thanks for the answers so far.
I have been doing some experimenting, and noticed that there is a much more direct way to open a PDF or Word doc in a browser window. Some examples...

Open google.com:
Window(#(AtlAxWin 'www.google.com'))

A PDF viewer:
Window(#(AtlAxWin 'file:///C:/test.pdf'))

A Word viewer:
Window(#(AtlAxWin 'file:///C:/test.doc'))

Nice :)
 
 
#1352
Re:Embedded document viewer 1 Year, 4 Months ago
I agree, very nice.
 
 
andrew