Forum Replies Created
-
AuthorPosts
-
in reply to: Header problem using mixed Portrait and Landscape September 10, 2012 at 13:45#29107
We publish a version, which fixes the issue, later today or tomorrow.
in reply to: Convert ASP.Net page with Java Applet forms authentication September 12, 2012 at 07:54#29113You need to determine how the ASP.Net application propagates session ID. It could be a session ID embedded to URL or (most probably) a cookie.
Cookie can be added to HTTP request this way:
pd4ml.setCookie( “JSESSIONID”, cookieValue );
where cookieValue is something like that: “9034657927465;path=/”JSESSIONID keyword is specific for Java, .Net uses anything else.
in reply to: General questions / FAQ September 14, 2012 at 07:19#26778Hi,
I’m new to PD4ML and I need your help with a little issue.
Is there a way in PD4ML to set the pdf page margins? I can’t find it.
I use the following HTML:
<!doctype html><br /> <html lang="en"><br /> <head><br /> <meta charset="UTF-8"><br /> <title>Export</title><br /> <style><br /> body {margin:0;padding:0;}<br /> </style><br /> </head><br /> <body><br /> <table width="8.125in" cellpadding="0" cellspacing="0" border="0" align="center"><br /> <tr><td>test</td></tr><br /> </table><br /> </body><br /> </html><br />
Thanks in advance!in reply to: Pd4ml – Page Margins September 14, 2012 at 07:22#29115The following info should help:
http://pd4ml.com/cookbook/pdf_page_formatting.htmin reply to: SVG or embedded pdf Images September 14, 2012 at 14:52#27432Have there been any updates/changes with regard to this? I’m considering using a charting library that generates SVG charts. I could use Batik to convert those to JPEG/PNG, but it would be great if I could instead embed the SVG in the PDF.
Thanks,
Mattin reply to: Troubleshooting September 17, 2012 at 22:08#26779When an certain snippet of HTML exists in a document, it will make the renderer enter some kind of death spiral where it will fill up the heap until the machine stops responding.
The snippet seems to be
<br /> <SPAN style="white-space:pre" class="Apple-tab-span"> </SPAN><br />
In context of a very simple example:
<br /> <table><br /> <tr><br /> <td><br /> TEXT<br /> <!--<SPAN style="white-space:pre" class="Apple-tab-span"> </SPAN>--><br /> MORE TEXT<br /> <SPAN style="white-space:pre" class="Apple-tab-span"> </SPAN><br /> FINAL TEXT<br /> </td><br /> </tr><br /> </table><br />
Here’s a histogram of my heap after trying to render this HTML:
<br /> num #instances #bytes class name <hr class="bbcode_rule" /> 1: 12253005 784192320 org.zefer.html.doc.view.b<br /> 2: 517 55412344 [Ljava.lang.Object;<br /> 3: 26309 3785624 <constMethodKlass><br /> 4: 26309 3590760 <methodKlass><br /> 5: 2671 2474760 [B<br /> 6: 1786 2400848 <constantPoolKlass><br /> 7: 1786 1494536 <instanceKlassKlass><br /> 8: 1504 1396576 <constantPoolCacheKlass><br /> 9: 18028 1279584 [C<br /> 10: 8536 603344 [I<br /> 11: 18388 588416 java.lang.String<br /> 12: 12400 396800 java.util.HashMap$Entry<br /> 13: 457 321504 <methodDataKlass><br /> 14: 1966 242192 java.lang.Class<br /> 15: 2781 204224 [S<br /> 16: 2765 173064 [[I<br /> 17: 6991 111856 java.lang.Integer<br /> 18: 304 108560 [Ljava.util.HashMap$Entry;<br /> 19: 163 95192 <objArrayKlassKlass><br /> 20: 1761 56352 java.util.concurrent.ConcurrentHashMap$HashEntry<br />
And the following is a very short Java program to demonstrate the issue:
<br /> String html = "<table><tr><td>TEXT<SPAN style="white-space:pre" class="Apple-tab-span"> </SPAN>MORE TEXT<SPAN style="white-space:pre" class="Apple-tab-span"> </SPAN>FINAL TEXT</td></tr></table>";<br /> StringReader sr = new StringReader(html);<br /> OutputStream os = new ByteArrayOutputStream();<br /> <br /> PD4ML pd4ml = new PD4ML();<br /> pd4ml.enableDebugInfo();<br /> pd4ml.useTTF( "java:", true );<br /> pd4ml.setHtmlWidth(1050);<br /> pd4ml.enableSmartTableBreaks(true);<br /> <br /> try {<br /> pd4ml.render(sr, os);<br /> } catch (Exception e) { }<br /> <br /> sop(((ByteArrayOutputStream)os).toByteArray());<br />
in reply to: General questions / FAQ September 18, 2012 at 05:59#26780My colleague wrote two JAVA programs, one is JAVA agent in Lotus Notes that will convert email into HTML. Another one is a web service, which will receive the HTML and convert it into PDF by pd4ml.
When the email got a attachment which filename is non-English (In my test case, it is Traditional Chinese characters.), the PDF converted from it cannot show the correct filename of the attachment while the filenames as a text in the content of the email can be showed correctly.I have checked that the “description” of the attachment still got the correct filename and the HTML header had already specified the encoding in UTF-8. Also, the JAVA program for changing the HTML to PDF has set the TTF and the property file had been created for the fonts.
I have also tried the latest version PD4ML Java v3.8.0fx7.
What should I do?
Thank you very much.in reply to: Render crashes and heap space fills September 18, 2012 at 14:14#29116We reproduced the problem and work on it.
in reply to: watermark in JSP September 18, 2012 at 17:16#29097Did you try to add debug=”true” attribute to (I suppose you use PD4ML JSP taglib) and inspect the server log? Are there any traces it tries to load the image and fails?
in reply to: Troubleshooting September 19, 2012 at 16:26#26781I am using PD4ML 380fx6 taglibs which generates a PDF. This works fine in Chrome, Firefox and IE9 +.
But when I do it in IE8 I get the attached error.
This is the transform tag I am using
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>Http Response headers
Cache-Control:private
Cache-Control:no-cache
Connection:close
Content-disposition:attachment; filename=Report.pdf
Content-Length:10646
Content-Type:application/pdf
Date:Wed, 19 Sep 2012 16:07:16 GMT
Expires:0
Pragma:no-cache
Pragma:cache
Server:Apache-Coyote/1.1Anyone have any ideas?
in reply to: IE8 PDF wont download September 19, 2012 at 16:37in reply to: Junk filenames of the attachments in PDF September 20, 2012 at 12:12#29118Here are more details of the problem.
The original filenames of the attachments in the email:
The filenames of the attachments in the rendered PDF, please note that the filenames in the content are correct:
Thanks.
in reply to: HTML/CSS rendering issues September 24, 2012 at 16:46#26782In the latest version (3.80fx7), when using background-color: transparent the rendering can be incorrect.
For the sample HTML given:
<br /> <table style='background-color: white; color: black; border: 2px solid red;'><br /> <tr><br /> <td style='background-color: transparent'>TEXT MORE TEXT FINAL TEXT</td><br /> </tr><br /> <tr><br /> <td>2 TEXT MORE TEXT FINAL TEXT</td><br /> </tr><br /> <tr><br /> <td style='background-color: transparent; color: yellow'>TEXT MORE TEXT FINAL TEXT</td><br /> </tr><br /> </table><br />
I would expect a table with a 2 pixel border, white background and black text. It should have three rows, each with a white background, and the first two rows black text while the third has yellow text. Instead, what I get is the rows that have background-color: transparent are getting BLACK background – I’m guessing it has something to do with how the tables are rendered using layering in the Java graphics package.
in reply to: Junk filenames of the attachments in PDF September 24, 2012 at 17:28#29119It looks like the file names are UTF-8-encoded, but treated as Latin by PD4ML.
Please make sure you use the most recent dxl4pd4ml.xsl and pd4ml(_demo).jar. The actual stylesheet can be obtained from http://pd4ml.com/command-line-dxl-to-pdf-converter.htm
Also it is a good idea to dump the document source as DXL and to try to convert it offline with the command line tool. It simplifies debug a lot. -dumphtml switch should help you to analyse if the names in HTML are correct, before the doc passed to PDF converter.
in reply to: IE8 PDF wont download September 24, 2012 at 18:04#29124It looks like the problem is caused by a caching of documents, downloaded by HTTPS. Please correct if I am wrong.
It was a known issue of older PD4ML JSP taglib versions, until we found a safe HTTP header directives set.Currently PD4ML taglib sets only the following HTTP cache control directives:
[language=java:1134zpa4]((HttpServletResponse) sr).setHeader(“Pragma”, “cache”);
((HttpServletResponse) sr).setHeader(“Expires”, “0”);
((HttpServletResponse) sr).setHeader(“Cache-control”, “private”);[/language:1134zpa4]In your case there are some other cache controls (including conflicting with the above) – probably the hosting application is configured to add them to each reply. Try to switch it off for PDF generating JSPs.
-
AuthorPosts