Welcome Guest Search | Active Topics | Sign In | Register

[EO.PDF 17.1.65.0] png/svg used as patterns (and not only) render with very low quality Options
Ter
Posted: Sunday, June 4, 2017 7:30:04 AM
Rank: Newbie
Groups: Member

Joined: 6/4/2017
Posts: 1
Hello, EO support

I am having the following trouble with png/svgs. I searched on Google and your forums and was not able to find a resolution.
This must be an issue that "pops up" easily and I am quite surprised it exists + not finding a thread with s.o else asking about it.
So, here it is:

I have a default configuration of latest EO.pdf. Using it to export HTML to PDF. The html layout can get very complex (so far I have not noticed any issues with that), and it often uses some background color, on top of which a png/svg pattern image is overlayed.
The png/svg are always defined in the css using the background-image property. It is never used with a direct <img> tag or a <svg> declaration inside the html.

Most often the image is very small and is repeated, but occasionally the problem occurs with a large (png) image.

The problem is that in the PDF the image is rendered with very very low quality. Originally I thought that the issue could be worked around if I used svg (which is vector after all). Unfortunately, the end result is the same...

I am providing here a pdf sample and a png file. I am ripping this thing from a more complex system and it is not so easy to provide you the original HTML too - but I can surely do it should you request it. That said, I believe the info + attachments are enough to reproduce the problem on your end, but if you need something more please let me know.

Png image : PNG image
Output pdf: OUTPUT PDF


Needless to say, application-wise, ensuring a good quality image result is very important so I am very hopeful there is a fix for that.
Best regards!



eo_support
Posted: Sunday, June 4, 2017 5:03:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,225
Hi,

This can be normal when you use it as background or anything else that can trigger alpha blending between different HTML elements --- for example, a SVG as background and then some text on top of it (not the text element in SVG, but some text rendered with other HTML elements on top of the SVG). Generally, the browser engine would render SVG in vector format, which will retain high quality. However when alpha blending is involved, the browser engine must rasterize it --- by converting the SVG output into a bitmap and then perform alpha blending on that bitmap with other contents. This will produce the output at screen resolution and if you zoom in you will see noticeable quality degrading. Since browser engine's primary goal is to render the output on screen, such rasterizing is acceptable to the browser engine and we are not in a position to modify such behavior. So the best option for you would be to avoid using SVG in such a way in your HTML.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.