Forum Replies Created
-
AuthorPosts
-
in reply to: css parsing issues March 4, 2016 at 16:34#29850
1. Try to reformat the single-line CSS stylesheet into more readable content with a formatter tool. I googled http://www.cleancss.com/css-beautify/ – and it works fine.
2. Run PD4ML with debug switched on. Now it reports CSS errors with a reference to particular string number of the stylesheet.
2. Locate and comment unsupported directives out or fix syntax errors.
In the most recent version (v398fx4) we suppressed a lot of warning messages, caused by unimplemented popular media control functions (which are usually irrelevant by PDF generation). So check out the version – it produces less warnings on your HTML/CSS.
in reply to: Img html tag problem March 4, 2016 at 16:24#29858Did you try to specify a more detailed image path, i.e.
<IMG src="/webapp/ImgRead?file=" width="179" height="150">
?in reply to: Encoding problem (pdf only) March 4, 2016 at 16:21in reply to: Encoding problem (pdf only) March 4, 2016 at 16:04#29861Try to use
pd4ml.render(StringReader isr, OutputStream os, URL base, String encoding)
and explicitly give “UTF-8” as encoding parameter.
in reply to: Mangal font support March 4, 2016 at 15:48#29636> Could you please share more configuration details. With my code it is not able to comprehend hindi font at all.
By default PD4ML converts to PDF characters, belong to Latin-1 charset only using built-in Adobe fonts (Helvetica, Times New Roman and Courier New). In order to output national or special characters you would need to configure and utilize TTF embedding feature of PD4ML Pro. See:
https://pd4ml.com/reference.htm#7.1
pd4ml-html-css-pdf-tips-tricks-f7/ttf-embedding-t42.html
https://pd4ml.com/cookbook/pd4ml_pdf_true_type_fonts.htmin reply to: Mangal font support March 4, 2016 at 15:44#29637The issue is known. PD4ML does not implement a ligaturizing for Indic languages as we have found neither good tech description of the algorithm nor a reference implementation.
If you can point us to good info sources – we’ll be happy to implement and to include it to PD4ML.
in reply to: Pd4ml Pro UTF-8 and Adding TTF February 19, 2016 at 11:15#29859If you open tahoma.ttf in any of font viewer tools (i.e Cahacter Map on Win platform), you can see it does not define Thai glyphs.
For code like
<font face="Tahoma"> กกก </font>PD4ML (as any web browser) looks for a similar font substitution, which can render Thai.Below are substitution tables used by PD4ML. As far as I know Microsoft Sans Serif (micross.ttf) supports Thai.
You need to register Microsoft Sans Serif under any of names from sansFallback to let the font substitutions happen.For example, define in pd4fonts.properties
Arial=micross.ttfprivate static String[] serifFallback = new String[] { "Times New Roman", "MS Mincho", "MingLiU", "SimSun", "Mangal", "David", "Batang", "Wingdings", "Symbol", "Lucida Sans Regular", }; private static String[] sansFallback = new String[] { "Arial", "MS Gothic", "MingLiU", "SimSun", "Mangal", "David", "Gulim", "Wingdings", "Symbol", "Lucida Sans Regular", }; private static String[] monoFallback = new String[] { "Courier New", "MS Gothic", "MingLiU", "SimSun", "Mangal", "David", "GulimChe", "Wingdings", "Symbol", "Lucida Sans Regular", };in reply to: background-image resize February 9, 2016 at 15:58#29856PD4ML supports some proprietary CSS properties for the case:
background-repeat: scale-x background-repeat: scale-y background-repeat: scale-xy
They intended to shrink/stretch a background image to fit a containing block element.
in reply to: System Error: Stack Underflow February 2, 2016 at 14:38#29484Yes, it has been significantly changed: we switched from open source CSS Parser Project library to our own CSS parser/cascading engine. Obviously the issue is there.
[2015-11-02 16:46:17,947] java.lang.RuntimeException: stack underflow at org.zefer.css.y.Ã’00000(Unknown Source) at org.zefer.css.yb.o00000(Unknown Source) at org.zefer.css.f.Ã’00000(Unknown Source) at org.zefer.html.doc.css.c.Ã’0O000(Unknown Source) at org.zefer.html.doc.PD4MLHtmlParser.buildDocument(Unknown Source) at org.zefer.pd4ml.PD4ML.o00000(Unknown Source) at org.zefer.pd4ml.PD4ML.render(Unknown Source) at org.zefer.pd4ml.PD4ML.render(Unknown Source) at org.zefer.pd4ml.PD4ML.render(Unknown Source)
Even if the issue not in the new CSS parser, there is a lot of adjustments in the main converter code.
An HTML code sample (incl. its CSS resources) which 100% throws an exception on your site would help a lot to determine a problem reason.
(I am afraid, the blank HTML is not the right sample – the exception is thrown by CSS parsing and the HTML does not refer to any CSS resources)
in reply to: Error with Merge PDF problem, pd4ML.jar method mergeDFs January 19, 2016 at 12:42#29842We’ve just fixed the issue in the development build.
The reason is that in the problematic PDF an image size is unexpectedly given not as an integer, but as a reference to another object (which holds only an integer). Now the case is correctly worked around.
in reply to: ResourceProvider: replace byte array by inputstream January 19, 2016 at 12:39#29843We plan to optimize resource loading / caching in totally refactored v4.x
Your proposal would make sense only by attachment embedding. Other type of loaded resources do not win a lot:
CSS – should be instantly loaded and parsed anyway
images – PD4ML does not trust a file extension. It always loads an image and scans its bytes to determine image file type and dimensions. If explicitly configured, after that it unloads the image to a temp directory to free up RAM.
Despite the impression, that it allocates a lot of memory because of images and other resources, it is not always true. A specifics of HTML rendering is that it should allocate a number of Java objects even for a single standalone whitespace. So parsed HTML (with layouting info) is the main “RAM eater”.
in reply to: Bad Base64 input character 0x2e at 0 ([.]) January 19, 2016 at 12:25#29844Try to use an empty tag or remove the dot from
We’ll update the tag implementation to ignore tag content when dynvalue attribute is set.
in reply to: could no create pdf correctly January 8, 2016 at 13:44#29257In the problem case, PD4ML tries to access/load http://xxxxxxx/certificado/certificado4.php and receives back 403 error code instead of HTML content to convert.
First I would recommend to look through the server’s log files to determine, why PD4ML is not authorized to load the page.
in reply to: Empty IMG src hangs PD4ML December 29, 2015 at 14:44#29390On my test environment it does not hang, but in forthcoming v398fx3 we anyway worked potential issues around.
in reply to: How to define custom page size for HTML to PDF December 29, 2015 at 14:42#29349pd4ml.setPageSize() API call takes page dimensions in typographic points as a parameter.
public static final int POINTS_PER_INCH = 72; ... pd4ml.setPageSize( new java.awt.Dimension(15 * POINTS_PER_INCH, 11 * POINTS_PER_INCH) );
-
AuthorPosts
