HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › Troubleshooting › fmt library is ignored
- This topic has 5 replies, 2 voices, and was last updated Jan 08, 2010
11:47:25 byPD4ML.
-
AuthorPosts
-
January 7, 2010 at 14:08#26312
Hi !
I use PD4ML with pd4ml.render(URL[] , OutputStream). Server is Tomcat.I have two issues:
1- PD4ML ignore the JSTL library fmt.
<fmt:formatNumber>seems to be ignored. So my numeric datas aren’t formatted.
How can I formatting datas ?2- I’ve a lot of different JSP, so I don’t want to create JSP especialy for PDF.
Some parts of JSP are only usefull for screen: buttons, navigation toolbar, etc …..
Is it possible to add a pd4ml tag in JSP to avoid the rendering of a piece of jsp/html code ?Regards,
January 7, 2010 at 14:27#277631. PD4ML does not implement JSP container functionality, so any custom tags or JSP code is ignored. If you need to convert a JSP page, you should let Tomcat to process it before it is passed to PD4ML. For example:
pd4ml.render( "http://myserver.com/webapp/source.jsp", os );assuming that “http://myserver.com/webapp/source.jsp” returns HTML document with
<fmt:*>already resolved/interpreted.Another option is to enclose source.jsp content within
<pd4ml:transform>and</pd4ml:transform>tags. (see https://www.pd4ml.com/reference.htm#6.1)2. CSS properties “pd4ml-visibility: hidden; pd4ml-display: none” should help.
January 7, 2010 at 15:42#27764thanks a lot for your response.
I don’t understand very well your response for my issue #1:
I’ve to compute in a sigle pdf doc severals jsp pages. What’s why I use the pd4ml.render(URL[], OutputStram) syntax. Moreover those jsp can by used in a “screen” mode so I can’t use the tag
<pd4ml:transform>My array of URL is:
https://my_server/ctx/struts_action.do?arg=val1
https://my_server/ctx/struts_action.do?arg=val2
…..
https://my_server/ctx/struts_action.do?arg=valnwhere struts_action is the name of an action in my struts-config.xml file and ctx the name of my web app
I can’t address directly the JSP, I’ve to invoke a struts action before.
So I thought Tomcat will interpret jstl tag before giving the result to pd4ml.
Do you have an idea why it is not the case ?Regards,
January 7, 2010 at 16:28#27765So
<fmt:formatNumber>is interpreted (and does not appear in the HTML, passed to PD4ML), but the resulting numeric data format is invalid?Does
<fmt:formatNumber>depend on Locale settings of user session? If so, you need to propagate the session ID with https://my_server/ctx/struts_action.do?arg=val1 and other URLs.Here is some info how to do that:
https://pd4ml.com/support/post500.html?hilit=jsessionid#p500January 8, 2010 at 11:37#27766Hi !
Thanks for your response.It’s exactly that:
<fmt:formatNumber>is interpreted (and does not appear in the HTML, passed to PD4ML), but the resulting numeric data format is invalid.You were right ! It was a problem about the Locale.
But I can’t understand why. Sessions are correctly propagated. I’m sure of this since I use them in my struts action. I use
pd4Ml.setSessionId(), I put explicitly the sessionid in the url, I usepd4ml.setCookie("JSESSIONID", sessionId)but nothing works, numeric datas aren’t formatted !Finally, I ‘ve added the definition of locale directly in my JSP:
<fmt:setLocale value="FR_fr"/>and now it works fine !!!I don’t understand why I need to do that since Sessions are correctly propagated ….
Anyway, It works fine now.Thank you very much for your help.
Best Regards,January 8, 2010 at 11:47#27767cookie format requires path information, so the value should look like “9034657927465;path=/”
pd4ml.setSessionID() does not add session ID to the original document URL, but to referenced resource URLs only (images, CSS).
You need to add the session ID to the document URL manually:
https://pd4ml.com/document.jsp;jsessionid=9034657927465?other=params&if=any
-
AuthorPosts
The forum ‘Troubleshooting’ is closed to new topics and replies.
