HTML in a PDF Report

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

HTML in a PDF Report

Post by customaware »

I am trying to include some styled html text in a PDF Report.

So, I have a text html Attribute and I stuff it with the styled html that I want.....
Here is the string....

<div style="font-family:'Courier New';font-size:6px;">A: PU648YF / <span style="color:red;">⚠ B: AEBY-426</span></div>

But, not matter what font I use or size etc.... the text is displayed fuzzy...
html in pdf.png
html in pdf.png (34.21 KiB) Viewed 692 times
Has anyone done this? Any ideas how to fix and make the text sharp would be greatly appreciated.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
joben
Posts: 230
Joined: Wed Nov 06, 2019 9:49 pm
Location: Sweden
Contact:

Re: HTML in a PDF Report

Post by joben »

Same result if you use "pt" or "em" instead of pixels?
Regards, Joakim

Image
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: HTML in a PDF Report

Post by customaware »

Yes Joben
Makes no difference
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
hpl123
Posts: 2599
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: HTML in a PDF Report

Post by hpl123 »

IF I remember correctly, this has been an issue for years and has something to do with how Aware integrates the HTML into the report. I don´t think there is a workaround (I could be wrong) other than creating a picture programmatically (that has the html text looking good etc.) and then showing that picture instead of the HTML on the report.
Henrik (V8 Developer Ed. - Windows)
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML in a PDF Report

Post by Jaymer »

It would be interesting to look at the source code of this PDF, and focus on the code in question.
Wondering if there is some “surrounding” code, causing the blurriness.

I would assume that code is either coming from Vlad’s JavaScript routines, in which case it should be edible and correctable by us,
Or it’s coming from a third-party jar, which would be a bit tougher to resolve.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
hpl123
Posts: 2599
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: HTML in a PDF Report

Post by hpl123 »

Henrik (V8 Developer Ed. - Windows)
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: HTML in a PDF Report

Post by aware_support »

The problem with fuzziness will be fixed in the next build.
Aware IM Support Team
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML in a PDF Report

Post by Jaymer »

Mark,
why am I not seeing HTML in my report?
Ver 8.6


The field def:
Screenshot 2024-03-23 at 4.51.12 PM.png
Screenshot 2024-03-23 at 4.51.12 PM.png (58.02 KiB) Viewed 525 times

The report def:
Screenshot 2024-03-23 at 4.50.49 PM.png
Screenshot 2024-03-23 at 4.50.49 PM.png (14.51 KiB) Viewed 525 times

The result:
Screenshot 2024-03-23 at 4.51.31 PM.png
Screenshot 2024-03-23 at 4.51.31 PM.png (24.87 KiB) Viewed 525 times
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML in a PDF Report

Post by Jaymer »

Mark? Ideas?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
customaware
Posts: 2405
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: HTML in a PDF Report

Post by customaware »

You need to add a html parameter in your tag

<<mmBO.myAttribute, ‘html’>>
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML in a PDF Report

Post by Jaymer »

ok, thx
that worked - forgot about that

problems now:
1) sucks that you have to use inline 'styles' - tried class and it doesn't pick it up.
2) cant get the text tight...

here is the html in a browser
Screenshot 2024-03-26 at 11.54.38 PM.png
Screenshot 2024-03-26 at 11.54.38 PM.png (23.89 KiB) Viewed 475 times

and shown in chrome explorer
Screenshot 2024-03-26 at 11.56.47 PM.png
Screenshot 2024-03-26 at 11.56.47 PM.png (97.11 KiB) Viewed 475 times
but directly in the PDF its this:
(the left one is non-html)
Screenshot 2024-03-27 at 12.00.57 AM.png
Screenshot 2024-03-27 at 12.00.57 AM.png (26.12 KiB) Viewed 475 times
I'm not as concerned with the 'fuzziness', since its fixed now in v9.
but I MUST have the lines tightened or its a non-starter.
must be using something other than line-height.

EDIT
Also tried multiple variations of Margin to no avail. No change at all.
Applied to the inside DIVs, not the wrapper.
margin-bottom: 20px !important;
margin-bottom: -20px !important;
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
hpl123
Posts: 2599
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: HTML in a PDF Report

Post by hpl123 »

Jaymer wrote: Wed Mar 27, 2024 4:02 am ok, thx
that worked - forgot about that

problems now:
1) sucks that you have to use inline 'styles' - tried class and it doesn't pick it up.
2) cant get the text tight...

here is the html in a browser
Screenshot 2024-03-26 at 11.54.38 PM.png


and shown in chrome explorer
Screenshot 2024-03-26 at 11.56.47 PM.png

but directly in the PDF its this:
(the left one is non-html)
Screenshot 2024-03-27 at 12.00.57 AM.png

I'm not as concerned with the 'fuzziness', since its fixed now in v9.
but I MUST have the lines tightened or its a non-starter.
must be using something other than line-height.

EDIT
Also tried multiple variations of Margin to no avail. No change at all.
Applied to the inside DIVs, not the wrapper.
margin-bottom: 20px !important;
margin-bottom: -20px !important;
Instead of divs, try using span tags and see if that makes a difference? Also, take a look at the padding CSS and see if that changes anything.
Henrik (V8 Developer Ed. - Windows)
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML in a PDF Report

Post by Jaymer »

damn, what a pain in the ass.
and i just did an upgrade on saturday the 30th, and a new version with new Report HTML Library comes out 2 days later.
spent many hours trying to get this HTML to be anywhere close to useable - and it was broke all along.
Hope the new April 1 build finally works.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML in a PDF Report

Post by Jaymer »

Mark
still broke after upgrading to bld 3249
sux

I used your html line from the first post.
here it is in my text field.
mark2.png
mark2.png (25.39 KiB) Viewed 354 times

here's how the report looks
mark1.png
mark1.png (13.82 KiB) Viewed 354 times

after being sized up - maybe 12px
mark3.png
mark3.png (26 KiB) Viewed 354 times
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Posts: 2454
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: HTML in a PDF Report

Post by Jaymer »

But the fonts are crap.
Always "blocky", jagged

can't find ANY combination of 'font-family' that it will accept.
got a couple of hours in it just tonight, after the new build

It does change typeface... just not very well. And never to a smooth font. Always a poor bitmap.
font1.png
font1.png (127.38 KiB) Viewed 354 times
font2.png
font2.png (200.95 KiB) Viewed 354 times
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Post Reply