|
Rank: Member Groups: Member
Joined: 10/6/2014 Posts: 21
|
We are currently converting from version 6.0.31.2 to 18.1.41.0. One concern is that that the generated pdfs are generally significantly larger with the new version - up to 3 times larger. We use JpegQualityLevel=100, but the size doesn't change significantly if changed to 0 or 1. Setting EmbedFont=false reduces the size somewhat but not down to the level of the previous version.
Is there anything we can configure or is this just the behavior of the newer version? By looking at the generated pdf it looks like the increased size is about fonts.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, Check your CSS. The new version supports much more CSS3 styles and many CSS3 styles will cause vector output to be rasterized. For example, a CSS3 drop shadow on text would be ignored in old version (thus leave only simple text in the PDF which takes up very little space), however in the new version it would cause the whole text area to be converted into an image in order to render the shadow effect properly, which would significantly increase file size. To verify if this is the problem, remove all your CSS and see if the result file size reduce significantly. If it does, then you can comment out your CSS block by block until you find out what triggered the problem. Once you find specifically what style triggers the problem, consider modify that style to avoid the problem. You can also use different style for print media and then set this property to true for the converter to use print media instead: https://www.essentialobjects.com/doc/eo.pdf.htmltopdfoptions.useprintmedia.aspxThis way you can keep the "fancy" CSS effects for screen but avoid them when converting to PDF. Please let us know if this resolves the issue for you. Thanks!
|
|
Rank: Member Groups: Member
Joined: 10/6/2014 Posts: 21
|
Hi, Our system doesn't neither own or control the input html. It's generated by different government agencies and can be designed in many different ways - with no css or with very complex css.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, We have looked into the file you sent to us. The problem is related to the radio buttons. If you compare the old PDF file and the new PDF file, you will see the new PDF file renders the radio button much smoother with a shade. This is what takes up the space in the new file. You can try to override the default radio button style to replace it with a simpler look to reduce the file size. You can find sample code on how to inject custom CSS style from this thread: https://www.essentialobjects.com/forum/postst10864_Problems-with-ligatures.aspxWe are also planing to simply this to an HtmlToPdfOption property so that you can simply set it to a custom CSS rule in the next build. Thanks!
|
|
Rank: Member Groups: Member
Joined: 10/6/2014 Posts: 21
|
Hi,
Thanks for your response. Could you please advise a manual change to the demo sample html that will make at least one of the radio buttons have a simpler look? (Our html expert didn’t see any obvious solutions.)
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
Hi, You can search online on how to customize radio button appearance with CSS --- we consider this generic Web programming questions so we do not directly provide support on that. Once you have the CSS, you can download the latest build from our website and use this newly added property to apply the CSS: https://www.essentialobjects.com/doc/eo.pdf.htmltopdfoptions.userstylesheet.aspxThanks!
|
|
Rank: Member Groups: Member
Joined: 10/6/2014 Posts: 21
|
Regarding your suggestion to use css customized radio buttons I assume you mean that the original radio button element (<input type="radio">) should be hidden using css (e.g. display:none) and then using some kind of <label> and/or <span> elements to style and show a customized radio button? Can you verify that this is your suggested solution? If that is not the case, i.e. there are some styles that can be changed on the <input type="radio"> element that makes the pdf smaller, could you specify what those styles are?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,221
|
No. That's not what we meant. You should be able to use CSS to customize the appearance of the button. The default is a round circle with gradient as well as a slight drop shadow. You should be able to replace it with a "simpler" version, for example, a circle with a single solid fill color.
|
|