U++ framework
Do not panic. Ask here before giving up.

Home » Developing U++ » U++ Developers corner » HTML viewer
HTML viewer [message #61989] Tue, 12 May 2026 15:53 Go to next message
forlano is currently offline  forlano
Messages: 1230
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I played with ClaudeAI and asked him to make a HtmlViewer for U++ using litehtml
https://github.com/litehtml

Here is what I got

/forums/index.php?t=getfile&id=7152&private=0

In the url bar you can set the pat of a local file and it is nicely rendered.
The problem is that it works only in debug mode. If I switch to release mode some bad thing happens and the program cannot retrieve properly the font size. Why this happen is beyond my capability and even beyond ClaudeAI knowledge. We did some LOG to analyze the output and he concluded that in release mode the font dimension are not returned properly. It tried many fix but no results.

This experiment is very promising. If fixed I (ClaudeAI) can add a HTTP support to retrieve page online. But even so as simpler HTML viewer would be very useful... at leat for me to visualize a better report with HTML table.
In the next post I am going to attach the package I used with few instructions.

Thanks,
Luigi

  • Attachment: htmlupp.png
    (Size: 23.17KB, Downloaded 144 times)
Re: HTML viewer [message #61990 is a reply to message #61989] Tue, 12 May 2026 15:59 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1230
Registered: March 2006
Location: Italy
Senior Contributor
Attached the package that contains the folder lithehtml.

In the include directory add these paths:

C:\Users\forla\Documents\MyAppsExp\LHUpp\litehtml\src\gumbo\ include
C:\Users\forla\Documents\MyAppsExp\LHUpp\litehtml\src\gumbo\ include\gumbo
C:\Users\forla\Documents\MyAppsExp\LHUpp\litehtml\include
C:\Users\forla\Documents\MyAppsExp\LHUpp\litehtml\include\li tehtml

I used the U++ 18518

Thanks,
Luigi
  • Attachment: LHUpp.zip
    (Size: 915.04KB, Downloaded 1 time)

[Updated on: Tue, 19 May 2026 21:03]

Report message to a moderator

Re: HTML viewer [message #61998 is a reply to message #61990] Tue, 19 May 2026 21:09 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1230
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I have updated the previous package with some fix.

Now on my computer release mode and debug mode produce the same render and seems ok. I have even fixed the [X] behaviour (it didn't close when pressed).

Can somebody compile the package in both mode and tell me if there are any issue? Is is stable? Can render tables without problems?
Please keep in mind that javascript is not processed. Do not expect to get good result with complex table or layout. There is not yet an action when a link is pressed.

Thanks,
Luigi
Re: HTML viewer [message #61999 is a reply to message #61998] Wed, 20 May 2026 09:34 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1230
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

Here is a new update of the package.
Now it can navigate and show image in not complex pages.
Compile with no optimization, i.e. remove the default -O3
  • Attachment: LHUpp.zip
    (Size: 910.14KB, Downloaded 2 times)

[Updated on: Wed, 20 May 2026 16:02]

Report message to a moderator

Re: HTML viewer [message #62000 is a reply to message #61999] Wed, 20 May 2026 16:05 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1230
Registered: March 2006
Location: Italy
Senior Contributor
Here is a screenshot of our preferite site.

/forums/index.php?t=getfile&id=7156&private=0

With Ctrl + Wheel you can change the font size and then reload the page to see the effect.

Best regards,
Luigi
  • Attachment: html.png
    (Size: 62.68KB, Downloaded 34 times)
Re: HTML viewer [message #62001 is a reply to message #62000] Wed, 20 May 2026 20:28 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1118
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hi Luigi,

This is nice! Lack of web view support is a big drawback in comparision to other frameworks. However, with your work we can mitigate this gap. It would be nice if you can publish your package on UppHub. If you didn't do it before, please contact me on Discrod. I will help.

Klugier


U++ - one framework to rule them all.
Re: HTML viewer [message #62002 is a reply to message #62001] Wed, 20 May 2026 21:38 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1230
Registered: March 2006
Location: Italy
Senior Contributor
Hi Klugier,

I need some more test and then I'll ask you to put it on UppHub because I'm not able to do so.

thanks,
Luigi
Re: HTML viewer [message #62003 is a reply to message #62002] Thu, 21 May 2026 17:58 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1230
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

here is my latest version.

I added a zoom dropdown list that immediately updates the zoom level of the file currently displayed in the Ctrl.
There is also a method to load a TXT file, automatically wrapped in HTML using the <pre> tag (see next post for a screenshot). It is very convenient for displaying plain text reports.

There is also a Print button which unfortunately still does not work properly. Sometimes it produces no output at all, and when it does work, the fonts are microscopic. Printing is actually the most important feature for me, but neither I nor ClaudeAI had enough expertise to fully solve the issues related to font scaling, margins, and pagination. This is currently the only thing preventing me from using this Viewer in production.

At the moment I am struggling with QTF and TXT reports, especially when reports contain many columns. With this Ctrl I finally have a single viewer for both formats. Using zoom, I can adapt the content to the page width quite nicely, but without reliable printing support it remains incomplete for my needs.

I really hope that one of our U++ gurus may eventually take a look at the print method (PrinterJob) and help finish this part. I honestly believe this Ctrl has great potential, especially for reports with wide horizontal layouts and relatively simple CSS. It could become a lightweight and practical alternative to QTF in many scenarios.

To compile it, optimization must be disabled (remove the default -O3) and the following include paths must be added:

C:\Users\forla\Documents\MyAppsExp\LHUpp\litehtml\src\gumbo\ include
C:\Users\forla\Documents\MyAppsExp\LHUpp\litehtml\src\gumbo\ include\gumbo
C:\Users\forla\Documents\MyAppsExp\LHUpp\litehtml\include
C:\Users\forla\Documents\MyAppsExp\LHUpp\litehtml\include\li tehtml

Perhaps these include paths could be configured automatically inside the package somehow.

If Klugier or anyone else believes this project is worth completing and publishing on UppHub, please feel free to continue the work. I think the foundation is already quite promising, and it would be great to see it evolve into a fully usable component for the community.

Thanks to all of you,

Luigi
  • Attachment: LHUpp.zip
    (Size: 917.96KB, Downloaded 0 times)
Re: HTML viewer [message #62004 is a reply to message #62003] Thu, 21 May 2026 18:00 Go to previous message
forlano is currently offline  forlano
Messages: 1230
Registered: March 2006
Location: Italy
Senior Contributor
viewer with TXT wrapper

/forums/index.php?t=getfile&id=7159&private=0

[Updated on: Thu, 21 May 2026 18:13]

Report message to a moderator

Previous Topic: Dwarf debugger - developer needed :)
Next Topic: Technology lab vs External resources
Goto Forum:
  


Current Time: Thu May 21 21:40:07 GMT+2 2026

Total time taken to generate the page: 0.00595 seconds