Forum Replies Created
-
AuthorPosts
-
in reply to: Template for toc January 28, 2011 at 13:03#28383
The trick with a background image seems to be the only solution for the time being.
In theory it is possible to define the template with CSS using “content” property, but it is not supported by PD4ML yet.
in reply to: HTML5 Canvas – Anyone working on such a thing for PD4ML? January 28, 2011 at 14:48#28379We need some time to estimate efforts. Most probably we’ll introduce an API to plug to any HTML tag (not only to
in reply to: colored small empty table rows not visible January 28, 2011 at 14:50#28375Does not “TABLE { empty-cells: show }” CSS style help?
in reply to: HTML5 Canvas – Anyone working on such a thing for PD4ML? January 28, 2011 at 16:03#28380Excellent, that’s fine by me – when it arrives I’ll put some effort into implementing a tag replacer and let you know how it goes.
Cheers
Stevein reply to: Troubleshooting February 9, 2011 at 10:58#26514Hi Gurus, we use PD4ML within a Servlet to generate PDF from JSPs. Intermittent we get the exception you can see below.
The code we use to generate the output is as follows:ServletOutputStream os = res.getOutputStream();<br /> pd4ml.render(new URL(urlString), os);<br /> os.flush();<br /> os.close();<br />
Does anybody have an idea what the reason for this error?
Greetings from LutzWARNUNG: Unable to send headers<br /> java.net.SocketException: Socket closed<br /> at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)<br /> at java.net.SocketOutputStream.write(SocketOutputStream.java:136)<br /> at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:531)<br /> at org.apache.jk.common.JkInputStream.appendHead(JkInputStream.java:313)<br /> at org.apache.jk.core.MsgContext.action(MsgContext.java:266)<br /> at org.apache.coyote.Response.action(Response.java:183)<br /> at org.apache.coyote.Response.sendHeaders(Response.java:379)<br /> at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:305)<br /> at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:273)<br /> at org.apache.catalina.connector.CoyoteOutputStream.close(CoyoteOutputStream.java:104)<br /> at org.zefer.pd4ml.pdf.PD4Device.dispose(Unknown Source)<br /> at org.zefer.pd4ml.pdf.PD4Device.finalize(Unknown Source)<br /> at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)<br /> at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)<br /> at java.lang.ref.Finalizer.access$100(Finalizer.java:14)<br /> at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
in reply to: SocketException: Socket closed on PD4Device.finalize February 10, 2011 at 07:52#28384Some analysis shoes, that the class PD4ML calls the PD4Device method “dispose()” after completing the current rendering.
This method will close the the output stream member within the PD4Device instance, but does not set it to null.
The PD4Device class has a finalize method too. Now, the gc is collecting and calls the finalize method and tries to close the output stream again.
Maybe that´s the problem causing the the raised exception.
How can we get rid of this?
Any idea?@Lutz.Strobel wrote:
Hi Gurus, we use PD4ML within a Servlet to generate PDF from JSPs. Intermittent we get the exception you can see below.
The code we use to generate the output is as follows:ServletOutputStream os = res.getOutputStream();<br /> pd4ml.render(new URL(urlString), os);<br /> os.flush();<br /> os.close();<br />
Does anybody have an idea what the reason for this error?
Greetings from LutzWARNUNG: Unable to send headers<br /> java.net.SocketException: Socket closed<br /> at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99)<br /> at java.net.SocketOutputStream.write(SocketOutputStream.java:136)<br /> at org.apache.jk.common.ChannelSocket.send(ChannelSocket.java:531)<br /> at org.apache.jk.common.JkInputStream.appendHead(JkInputStream.java:313)<br /> at org.apache.jk.core.MsgContext.action(MsgContext.java:266)<br /> at org.apache.coyote.Response.action(Response.java:183)<br /> at org.apache.coyote.Response.sendHeaders(Response.java:379)<br /> at org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:305)<br /> at org.apache.catalina.connector.OutputBuffer.close(OutputBuffer.java:273)<br /> at org.apache.catalina.connector.CoyoteOutputStream.close(CoyoteOutputStream.java:104)<br /> at org.zefer.pd4ml.pdf.PD4Device.dispose(Unknown Source)<br /> at org.zefer.pd4ml.pdf.PD4Device.finalize(Unknown Source)<br /> at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)<br /> at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)<br /> at java.lang.ref.Finalizer.access$100(Finalizer.java:14)<br /> at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
in reply to: SocketException: Socket closed on PD4Device.finalize February 10, 2011 at 18:55#28385Yes, you are right: there is a possibility PD4ML tries to close output stream twice, however we never faced with such kind of exceptions in our test scenarios.
We’ve just implemented a fix in the development build.
On the other hand we would recommend to use ByteArrayOutputStream as a receiver for generated PDF bytes and to send the buffer content to ServletOutputStream at once.
in reply to: Deployment / Configuration issues February 11, 2011 at 08:18#26516Hi,
I work with a web-application that creates PDF’s from HTML with the library “PD4ML pro”. It works like a charm, it’s really much easier than coding on iText, thank you guys!I want to integrate chinese and other languages strange characters, but I’ve problems with .ttf files in prod.
I’ve created use a “fonts.jar” file that is in my WEB-INF/lib folder.
That font.jar file contains:
– all my .ttf files
– “fonts.properties” file that contains :<br /> #this is an autogenerated file. please remove manually any references to copyrighted fonts<br /> #Sun Feb 06 11:45:00 CET 2011<br /> =Helvetica.ttf<br /> Arial=arial.ttf<br /> Arial Black=ariblk.ttf<br /> Arial Bold=arialbd.ttf<br /> Arial Bold Italic=arialbi.ttf<br /> Arial Italic=ariali.ttf<br /> Courier New=cour.ttf<br /> Courier New Bold=courbd.ttf<br /> Courier New Bold Italic=courbi.ttf<br /> Courier New Italic=couri.ttf<br /> Helvetica Cyrillic Bold=Helvetica Bold.Ttf<br /> Helvetica Cyrillic Bold Oblique=Helvetica Bold Oblique.Ttf<br /> Helvetica Cyrillic Oblique=Helvetica Oblique.Ttf<br /> KaiTi_GB2312=SIMKAI.TTF<br /> font.dir.location=/fonts/<br />
In a development mode on Windows, I don’t have any problem, my application works perfectly. But in a production mode on a UNIX system, special characters (like arrows) as not displayed well.
Must I absolutely copy my ttf files on the folder jre/lib/font server-side as mentionned here: http://download.oracle.com/javase/1.3/docs/guide/intl/addingfonts.html#adding ?in reply to: unix : fonts deployment ? February 11, 2011 at 13:46#28402Try to enable debug output on the problem platform (pd4ml.enableDebugOutput()) and inspect STDOUT/server’s log. Does it try to load TTF files? Are the TTF URI correct?
in reply to: PD4ML Tips & Tricks February 11, 2011 at 15:51#26515Hello,
i’m wondering, if it is possible to set the initial page number to something specific, if a passthru within a php page is used, something along the lines:
passthru(‘java -Xmx512m -Djava.awt.headless=true ‘ . ‘-cp ../pd4ml/pd4ml_demo.jar Pd4Cmd ” . $url . ” 800 A4 -smarttablesplit -author ‘Author’ -insets 7,7,10,10,mm’ -param initialPageNumber ‘2’);
Thanks for the help!
Kind regards
Niels Göranin reply to: initialPageNumber February 11, 2011 at 15:58#28386Unfortunately, currently there is no such parameter.
In theory you may add the feature by yourself: Pd4Cmd utility source code is available for free download; PD4ML header/footer Java API has a method to set the page counter initial value.
If you are already our customer, we could add the feature to the main PD4ML development branch.
in reply to: initialPageNumber February 11, 2011 at 16:14#28387Hey…
Thank you for your answer…
The idea to add the feature myself sounds good.Could give me some advice regarding the general structure of such an implementation?
Do I understand you correctly, that I would need to modify the source code for pd4ml_demo.jar, so that the Pd4Cmd sections is able to pass a new parameter to the Java API?
In addition, what is the difference between Pd4Cmd and Pd4Php ?
Thank you for your help!
Kind regards
Niels Göranin reply to: initialPageNumber February 11, 2011 at 16:18#28388Hello,
one more question:
I’m using the smarttablesplit option and it works fine, with one exception:
It is not repeating thesection on the next page. Is there a reported problem with that function or is there another way to make this work? It would be really helpful !
Kind regards
Niels Göranin reply to: initialPageNumber February 11, 2011 at 17:01#28389> Could give me some advice regarding the general structure of such an implementation?
> Do I understand you correctly, that I would need to modify the source code for pd4ml_demo.jar, so that the Pd4Cmd sections is able to pass a new parameter to the Java API?You may rename the class, modify, compile and leave the original Pd4Cmd packed to pd4ml(_demo).jar untouched.
You need to invoke the method. But now I am not sure if it will work for inline headers/footers. Next week we’ll check that and most probably add the missing parameter to Pd4Cmd.
> In addition, what is the difference between Pd4Cmd and Pd4Php ?
Pd4Php was the first command line tool version. After we added more general purpose functions we renamed it to Pd4Cmd.in reply to: initialPageNumber February 11, 2011 at 17:04#28390> It is not repeating the
section on the next page. In the mode it repeats all leading
tags if they consist of
tags only.
-
AuthorPosts