PDF in tooltip?
PDF in tooltip?
Hi,
I'm looking to display a pdf in a tooltip. Anyone who already has a solution for this?
I'm looking to display a pdf in a tooltip. Anyone who already has a solution for this?
Re: PDF in tooltip?
First, I would need to add the ability to display an image in a tooltip in eXpress++.
Then, I you would need to use XbpHtmlViewer to display the PDF in a WebBrowser and capture the screen to an image.
I will look into this and see if it is feasible.
Then, I you would need to use XbpHtmlViewer to display the PDF in a WebBrowser and capture the screen to an image.
I will look into this and see if it is feasible.
The eXpress train is coming - and it has more cars.
Re: PDF in tooltip?
Hi Roger,
Don't spend too much time on it. If someone have it already made it would be nice.
I will create a htmlviewer on my screen where the PDF is shown as a kind of preview. On the left I will have a browse and on the right I can show the PDF in a viewer.
This is also a solution for what I want to accomplish.
Don't spend too much time on it. If someone have it already made it would be nice.
I will create a htmlviewer on my screen where the PDF is shown as a kind of preview. On the left I will have a browse and on the right I can show the PDF in a viewer.
This is also a solution for what I want to accomplish.
Re: PDF in tooltip?
Yes, this is a good solution.I will create a htmlviewer on my screen where the PDF is shown as a kind of preview. On the left I will have a browse and on the right I can show the PDF in a viewer.
We have been doing it this way for years in Bobby Drakos Medallion application which manages many documents.
The eXpress train is coming - and it has more cars.
Re: PDF in tooltip?
This is best solution. You will offload pdf processing to already optimized system with integrated solution on xpphtmlviewer(2) ?
I think I have stored HTML that has simple logic to display arbitrary pdf (and with modification to it of any other file type supported) through it. If you need that small piece of code, post a message.
I think I have stored HTML that has simple logic to display arbitrary pdf (and with modification to it of any other file type supported) through it. If you need that small piece of code, post a message.
Re: PDF in tooltip?
Hi K-insis,
Just wondering how you can communicate with the HTML to navigate between documents?
Just wondering how you can communicate with the HTML to navigate between documents?
Re: PDF in tooltip?
For displaying static document from list of those stored?
Mine is just to use :navigate() to another address on app server.
Parameter url contains basic process identification and ID of document to display and app server prepares html with linked in document.
But same can be done by updating html file locally with pointer URL to pdf file too.
Pane with pdf is mostly static anyways. Capable of display, view, search, print , but that is about it.
XbpHTMLViewer:navigate()
Navigates to the specified URL.
:navigate( <cURL>, [<cCGI>] ) --> self
Parameters
<cURL>
The parameter contains a character string with the URL or document to navigate to. This parameter may be specified as an URL, full-qualified path or an Universal Naming Convention (UNC) location and resource name.
<cCGI>
Optionally, a character string holding a CGI request string can be passed for the second parameter. This can used to issue an HTTP POST command with assorted parameters. If no value is passed for <cCGI> parameter, a HTTP GET command is issued instead. If <cURL> does not contain an HTTP URL, this parameter has no effect.
Return
This method returns the object executing the method (self).
Description
The method navigates to the specified URL or document. The document is loaded into the XbpHTMLViewer object and displayed.
Mine is just to use :navigate() to another address on app server.
Parameter url contains basic process identification and ID of document to display and app server prepares html with linked in document.
But same can be done by updating html file locally with pointer URL to pdf file too.
Pane with pdf is mostly static anyways. Capable of display, view, search, print , but that is about it.
XbpHTMLViewer:navigate()
Navigates to the specified URL.
:navigate( <cURL>, [<cCGI>] ) --> self
Parameters
<cURL>
The parameter contains a character string with the URL or document to navigate to. This parameter may be specified as an URL, full-qualified path or an Universal Naming Convention (UNC) location and resource name.
<cCGI>
Optionally, a character string holding a CGI request string can be passed for the second parameter. This can used to issue an HTTP POST command with assorted parameters. If no value is passed for <cCGI> parameter, a HTTP GET command is issued instead. If <cURL> does not contain an HTTP URL, this parameter has no effect.
Return
This method returns the object executing the method (self).
Description
The method navigates to the specified URL or document. The document is loaded into the XbpHTMLViewer object and displayed.
Re: PDF in tooltip?
This is fast and works excellent. Just use UNC-notation for the file path. You may even print it with your own button if you decided to hide the viewer controls: Besides, "ExecuteScript" is a powerful method.
Code: Select all
oMyPdfControl:ExecuteScript("window.print()")
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: PDF in tooltip?
Hi,
Meanwhile I have created my screen and have this in my browse:
Everyting is working, but there are two issues:
- The PDF is shown but uses only about 75% of the width and height of the sire of the viewer.
- There is an annoying flickering when scrolling in the browse.
I'm using the old htmlviewer since with the htmlviewer2 it is almost impossible to copy in the pdf which I need for another module in my application.
Any suggestions?
Maybe I could implement a dcnewhtmlviewer which is using the xbphtmlviewer2? So I could use both in my application. If anyone can confirm that this would solve the flickering? Then I could use the oMyPdfControl:ExecuteScript("window.print()") as codeblock in Itemmarked.
Meanwhile I have created my screen and have this in my browse:
Code: Select all
@ 1,1 DCBROWSE OBJECT oPeppol alias 'peppol' SIZE 120 ,22 FIT MAX 125*amain(9,10) ;
EDIT xbeBRW_ItemSelected MODE DCGUI_BROWSE_EDITDOWN ;
NODESCENDTOGGLE ;
SUBCLASS 'XbpBrowseForeground()' ;
ITEMMARKED {|| oPdf:navigate(cPeppoldir+alltrim(peppol->id)+".pdf")} ;
Headlines 2 presentation aPresParam
- The PDF is shown but uses only about 75% of the width and height of the sire of the viewer.
- There is an annoying flickering when scrolling in the browse.
I'm using the old htmlviewer since with the htmlviewer2 it is almost impossible to copy in the pdf which I need for another module in my application.
Any suggestions?
Maybe I could implement a dcnewhtmlviewer which is using the xbphtmlviewer2? So I could use both in my application. If anyone can confirm that this would solve the flickering? Then I could use the oMyPdfControl:ExecuteScript("window.print()") as codeblock in Itemmarked.
Re: PDF in tooltip?
Just a few changes needed. At least, just add the asset to the XPJ (DCLIPX_20.XPJ) and replace all references to "XbpHtmlViewer" with "XbpHtmlViewer2" in DCARRAY.PRG, DCCLASS.PRG, DCFUNCT.PRG, DCSCRND.PRG and DCSUPER.PRG. Works excellent.Maybe I could implement a dcnewhtmlviewer which is using the xbphtmlviewer2?
You can control the appearance of the XbpHtmlViewer2, manipulate the zoom factor (I do this with ExecuteScript and something like "document.body.style.zoom='150%'"), hide menus and button bars or whatever you want.
Edit: We implemented a chat feature using this. On the left side of the screen, there is a browse (ownerdrawing) showing users and groups, and on the right side, there is a DCHTMLVIEWER (XbpHtmlViewer2) showing a template for chat dialogues. This is using bootstrap, a little selfmade JS and a few other things. When a user changes or a new message comes in (even from our mobile app, which uses a backend based on Xb2.Net for this), the template is renewed, filled with new messages, user pictures and so on - it just looks (a little) like WhatsApp or Signal or iMessage. Works really good.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."