Forum Replies Created
-
AuthorPosts
-
in reply to: How to rename the auto generated pdf file before creation? December 23, 2009 at 15:21#27750
Got the solution:
Just accept the “fileName” from the request (from HTML) and store it in a global variable in JSP and set it in the name attribute of<pd4ml:save> Eg; <%String fileName = request.getParameter("fileName"); %> <pd4ml:savefile uri="abc" name="<%=fileName %>”
dir=”xyz”
redirect=”pdf”
debug=”false”/>in reply to: General questions / FAQ December 28, 2009 at 21:34#26309I am trying to create a 2-line footer, and was just wondering if it’s possible, and if anyone had done it?
Thanks!example:
footer1footer2
in reply to: Can I create multipe line/row header or footer? December 29, 2009 at 16:20#27752I guess you mean non-HTML, non-inline headers.
In the case you may define title- or page-number-template with “n” as line break character (in some contexts you would probably need to add an extra backslash: “\n”).
And do not forget to allocate a sufficient space for the multiline header with areaHeight property.
in reply to: General questions / FAQ January 2, 2010 at 14:12#26310I am trying to make a pdf from jsp page, that contains a table. The code for PD4ML i use is
<pd4ml:transform screenWidth="600" pageFormat="A4" pageOrientation="portrait" inline="true" enableTableBreaks="true" encoding="windows-1250"> and <pd4ml:header initialPageNumber="1" areaHeight="50" fontSize="30">
The problem is that in some amounts of lines in table. I get one more page than necessary and this page is free of content except the header. I don’t know hot to get rid of it?
The look of it is in added picture.
If you need more info, ask and I will try to give it.
Doeys anyone have any propositions?in reply to: PD4ML creates one more page than necessary January 4, 2010 at 14:21#27758First, to start the problem reason analyze, try to define BODY { border: 1 solid red } style to see where the real bottom edge of the document content is.
Normally an extra blank page appears because of accumulated bottom margins of block elements etc.
If in your case the reason is clear and cannot be solved (by a removal of the , ,
, bottom margins at the end of the doc) you have two options:- Downscale the document content to make it fit the page(s) by increasing of htmlWidth (screenWidth in JSP) converting parameter.
- If the resulting number of the document pages is known in advance, you may limit to it by the call pd4ml.outputRange(“1-3”)
in reply to: Can I create multipe line/row header or footer? January 4, 2010 at 18:44#27753it’s java.
footer.setAreaHeight( 15 );
footer.setFont(new java.awt.Font(“Arial”, java.awt.Font.PLAIN, 7));
footer.setColor( java.awt.Color.black );
footer.setPagesToSkip( 0 );
footer.setTitleTemplate( Title );
footer.setPageNumberTemplate( “277GG11-06” );
footer.setTitleAlignment( org.zefer.pd4ml.PD4PageMark.LEFT_ALIGN );
footer.setPageNumberAlignment(org.zefer.pd4ml.PD4PageMark.RIGHT_ALIGN);
pd4ml.setPageFooter( footer );
There is a footer called Title, and I need to add another footer above it.
Thanks!in reply to: Can I create multipe line/row header or footer? January 4, 2010 at 18:54#27754There is no way to define more than one footer with pd4ml.setPageFooter()
I would workaround that way:
…
footer.setAreaHeight( 30 );
footer.setTitleTemplate( “upper footer textn” + Title );
footer.setPageNumberTemplate( “n277GG11-06″ );
…Also PD4ML Pro allows you to define an inline footer, which will co-exist with your current footer.
in reply to: General questions / FAQ January 5, 2010 at 00:05#26311I’d like to discuss a possible security hole in pd4ml which can have devastating effect if pd4ml library is used in a specific way. I prefer not to list the bug/feature until pd4ml developers can comment on it.
Our organization wants to use it but this particular bug is big enough that we will start looking for an alternative product if there is no way out. Since the customer list of pd4ml is available online, its possible that those who figure out this bug could misuse this feature/bug in unintentional way as well.
Please respond to this thread or contact me by email at the earliest.
thanks,
RoyansApplication Services
Ingenuityin reply to: Possible security hole in pd4ml January 5, 2010 at 00:11in reply to: Regarding direct print through default printer & Preview January 6, 2010 at 19:22#27462In the release notes, it is said that it is already possible to create a pdf file which we open and the print dialog automatically opens.
Is this functionality ok?
What is the JSP taglib equivalent to do that?in reply to: General questions / FAQ January 6, 2010 at 19:28#26293I would like to know if it is possible to create a pdf file which we open, and the print dialog automatically opens too. It is said in the release notes that this functionality is already implemented.
If so, what is the JSP taglib equivalent to do so? Is it in the “permissions” tag?
Could you show me an example of usage?in reply to: Troubleshooting January 7, 2010 at 14:08#26312Hi !
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,
in reply to: fmt library is ignored 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.
in reply to: Automatically open print dialog January 7, 2010 at 15:16#27651In Java code it can be done like that:
Map m = new HashMap(); m.put(PD4Constants.PD4ML_PRINT_DIALOG_POPUP, "true"); pd4ml.setDynamicParams(m);
Unfortunately there is still no JSP taglib mapping for the method. Please check if your JSP environments allows to locate
<pd4ml:transform>tag instance:
<% org.zefer.pd4ml.taglib.PD4MLTransformerTag trt = (org.zefer.pd4ml.taglib.PD4MLTransformerTag) pageContext.getAttribute( "pd4ml.transformer.tag", javax.servlet.jsp.PageContext.REQUEST_SCOPE ); if ( trt != null ) { System.out.println("found"); } %>If it works you’ll be able to pass the dynamic params map to it
trt.setDynamicParams(m);
with the forthcoming PD4ML beta (v360b2).
The missing mapping custom tags (
<pd4ml:params>,<pd4ml:key>,<pd4ml:value>) for the method will be available with the final release v360.in reply to: fmt library is ignored 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,
-
AuthorPosts
