Forum Replies Created
-
AuthorPosts
-
in reply to: General questions / FAQ March 25, 2014 at 04:48#26905
Hello People,
I have downloaded a trial version demonstrating documents to PDF. Which contains ss_css2.jar file, but this is throwing error org.w3c.css.sac.CSSException & at com.steadystate.css.parser.SACParser.parseStyleSheet……. One of my friend told me that its because ss_css2.jar i am using is not updated one. We have licenced users of pd4ml. What should we do now..??
Regards,
Mohitin reply to: where do i find updated ss_css2.jar file March 25, 2014 at 12:33#29482The most recent PD4ML versions include the most actual ss_css2.jar we have. if you experience troubles with CSS parsing it would make sense to analyze the problem reason and to adjust CSS stylesheet correspondingly. Unfortunately ss_css2.jar “understands” not all CSS3 syntax constructs may appear in stylesheets.
in reply to: Possible memory leak in finalizers March 25, 2014 at 15:18#29494PD4ML caches objects using soft references in a static hash table. As soon as there is a shortage of RAM, JVM must automatically release such objects and deallocate consumed RAM. If there is no allocation requests, it is up to JVM either to keep the objects cached or garbage-collect them.
There is an API call pd4ml.clearCache() forces to clean cache (and consumed RAM). The JVM setting -Dpd4ml.cache.enable=false disables caching at all.
After a particular image is loaded by PD4ML it is also instantiated as Imager object. If AWT also caches images of not – depends on a particular JVM implementation.
As for me it is suspicious, that the data is accumulated somewhere in the internals sun.awt.image.ToolkitImage.
in reply to: HTML/CSS rendering issues March 26, 2014 at 12:39#26913Hi!
Before phurcase this product I must know, if it is possible to convert string array to pdf. The string array contains the html source and every string is the array should be in a new page. Thanks in advance!
Viragin reply to: Convert html source to pdf March 26, 2014 at 12:42#29508There is an API method
pd4ml.render(StringReader[] isrs, OutputStream os, URL base)
which is more-less what you need.
Alternatively I would recommend to merge the string array into a single string, delimited by
<pd4ml:page.break>tags, and to pass it to render() method as a StringReader.in reply to: Convert html source to pdf March 26, 2014 at 12:57#29509I try what you mention, but only one page were generated, maybe because I use the trial library. The other problem is that the generated page is a, A4 landscape but I set the page orientatio as it is mantioned is the cookbook
in reply to: Convert html source to pdf March 26, 2014 at 13:03#29510A trial library has no such limitations.
probably there are closing
</body>and</html>tags somewhere in the middle of document. The tags implicitly stop further document parsing.in reply to: Convert html source to pdf March 26, 2014 at 13:12#29511you are right, iremove the close tags and I have the pages.
in reply to: Convert html source to pdf March 26, 2014 at 13:21#29512But it still landscape I use the cookbook for try:
pd4ml.setPageSize(pd4ml.changePageOrientation(PD4Constants.A4));in reply to: Convert html source to pdf March 26, 2014 at 13:37#29513Yes, the code
pd4ml.setPageSize(pd4ml.changePageOrientation(PD4Constants.A4));
forces landscape.For portrait use
pd4ml.setPageSize(PD4Constants.A4);Also you may change the orientation for particular pages with a dedicated parameter of
<pd4ml:page.break>in reply to: Convert html source to pdf March 26, 2014 at 13:38#29514sorry
in reply to: Convert html source to pdf March 26, 2014 at 13:59#29515Just one last question. We have text in the html source like this:
<font size="6" face="Arial">ŐŐŐŐŐőőőőőááéűúöüópőúéáűí </font>
But in the pdf it is wrong. The size is good, but the font is wrond and of course the encoding also wrong (hungarian).
I try to set :
pd4ml.useTTF("c:/Windows/Fonts", true);in warious format (case sensitive, use java font etc), but nothing helps. Thanks!
in reply to: Convert html source to pdf March 26, 2014 at 14:04#29516First you would need to index the fonts in /Windows/Fonts (to generate pd4fonts.properties). See https://pd4ml.com/cookbook/pd4ml_pdf_true_type_fonts.htm
A quick solution would be to place fonts.jar (i.e. from https://pd4ml.com/i/easyfonts/fonts.jar ) to WEB-INF/lib of your web app (or to a shared lib of your desktop application) and to refer to it with:
pd4ml.useTTF(“java:fonts”, true);
in reply to: Convert html source to pdf March 26, 2014 at 18:35#29517Is this generation also work with demo jar?
in reply to: Convert html source to pdf March 26, 2014 at 19:02#29518Thanks for your patient! I forgot to tell that I want to use this generation for an applet. I ti add the jad to my project and in the builder it seems that it is succesful, the fonts.jar has been signed and added to the lib folder of the applet. But when I try to create a pdf with the applet the fonts are not used. The color the size and every formatting is good but the font is wrong. What shuold be wrong? Thanks in advance!
-
AuthorPosts
