PDF in tooltip?

This forum is for eXpress++ general support.
Message
Author
skiman
Posts: 1215
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

PDF in tooltip?

#1 Post by skiman »

Hi,

I'm looking to display a pdf in a tooltip. Anyone who already has a solution for this?
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4854
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: PDF in tooltip?

#2 Post by rdonnay »

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.
The eXpress train is coming - and it has more cars.

skiman
Posts: 1215
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: PDF in tooltip?

#3 Post by skiman »

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.
Best regards,

Chris.
www.aboservice.be

User avatar
rdonnay
Site Admin
Posts: 4854
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: PDF in tooltip?

#4 Post by rdonnay »

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.
Yes, this is a good solution.
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.

k-insis
Posts: 144
Joined: Fri Jan 28, 2011 4:07 am

Re: PDF in tooltip?

#5 Post by k-insis »

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.

skiman wrote: Fri May 16, 2025 7:02 am
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.

skiman
Posts: 1215
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: PDF in tooltip?

#6 Post by skiman »

Hi K-insis,

Just wondering how you can communicate with the HTML to navigate between documents?
Best regards,

Chris.
www.aboservice.be

k-insis
Posts: 144
Joined: Fri Jan 28, 2011 4:07 am

Re: PDF in tooltip?

#7 Post by k-insis »

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.

skiman wrote: Mon May 19, 2025 12:22 am Hi K-insis,

Just wondering how you can communicate with the HTML to navigate between documents?

User avatar
Tom
Posts: 1288
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: PDF in tooltip?

#8 Post by Tom »

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:

Code: Select all

oMyPdfControl:ExecuteScript("window.print()")
Besides, "ExecuteScript" is a powerful method.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

skiman
Posts: 1215
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: PDF in tooltip?

#9 Post by skiman »

Hi,

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
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.
Best regards,

Chris.
www.aboservice.be

User avatar
Tom
Posts: 1288
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: PDF in tooltip?

#10 Post by Tom »

Maybe I could implement a dcnewhtmlviewer which is using the xbphtmlviewer2?
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.

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.
chat.png
chat.png (106.01 KiB) Viewed 4173 times
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply