HTML to PDF / DOCX / RTF Java converter library › Forums › PD4ML v3 Archived Forums (Read Only) › General questions / FAQ › Newbie question: How to page break
- This topic has 6 replies, 3 voices, and was last updated Dec 29, 2016
20:54:26 byAnonymous.
-
AuthorPosts
-
February 18, 2010 at 21:11#26336
Our company has a license for this product which was evaluated by someone else who has since left, so I am having to learn from scratch.
The way we present web pages is they are coded in XHTML with other proprietary code that goes through a pre-processor before it is rendered to the screen.
I am trying to understand how to incorporate page breaks into our code. I am assuming that if I add the following:
<pd4ml:page_break>(or<pd4ml:page_break/>?)to my html code, that when the pdf is generated, a page break will be implemented at that line in the code.
So far, I haven’t had any luck, because unfortunately, if I use the tag as above, our processor declares it as invalid and will not render the screen at all.
So, my first question: Am I correct in my assumption that in order to add a page break to my pdf, I only need to add the page break tag to the html?
(see below for a larger example of how we are using it.)My second question is: Which form of the tag is correct? I have seen the one with and without the slash used in different examples.
sample html usage:
Here is some text on one page... <pd4ml:page_break> ...and this text will begin at the top of the following page
February 19, 2010 at 13:49#27862The main PD4ML page break tag is
<pd4ml:page.break>, however there are environments where the tag syntax may be reported as an error.- Some JSP containers do not allow dots in the tag name, so PD4ML JSP taglib includes the tag synonym
<pd4ml:page_break>. But take into account: the tag works only in JSP. - In XHTML and XSL world “pd4ml” namespace may cause validation problems. For the case later we introduced yet another tag synonym
<pd4ml-page-break>
Also CSS offers some ways to break page. For example: page-break-before: always applied to a block element (
<div>, <table>etc)February 19, 2010 at 17:31#27863Thanks for the reply. Unfortunately, using
<pd4ml-page-break>also causes our processor to barf. I’ve got a workaround in the Java code, but I would have preferred not to have to go that route. But, at least it works.Thanks again.
February 19, 2010 at 17:36#27864Well, XHTML tries to close tags. Try
<pd4ml-page-break/>February 19, 2010 at 18:25#27865Yup tried that and a few other permutations…didn’t work, but thanks again.
October 30, 2012 at 07:01#27866I dint get one point in above query , if you wantto export data to PDF , why do you wantt o render it as HTML(or any other presentation file you are using).
Just put your HTML code generated in a StringBuffer and pass it to render() method of PD4ML class. The BYTEOUTPUTARRAYSTREAM recieved from this method can be passed to OUTPUTSTREAM and your PDF will be downloaded.
December 29, 2016 at 20:54#27867@tpdietz wrote:
Thanks for the reply. Unfortunately, using
<pd4ml-page-break>also causes our processor to barf. I’ve got a workaround in the Java code, but I would have preferred not to have to go that route. But, at least it works.Thanks again.
Will you able to share the java code that fixed your issue.
- Some JSP containers do not allow dots in the tag name, so PD4ML JSP taglib includes the tag synonym
-
AuthorPosts
The forum ‘General questions / FAQ’ is closed to new topics and replies.
