know number of pages in end pdf without actually making it
Is there a way to know the number of pages in the final pdf document generated from FOP without actually doing its generation? The XML content being pulled in for the pdf generation is dynamic and so the number of pages being generated at the end would change too based on this. Was wondering if there was someway of grabbing the number of pages being generated in a 2 pass sequence. As in 1st pass: XML + XSL - FO 2nd pass: FO - PDF Any help would be appreciated. Regards Abhishek - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: table overflow onto page 2 into specific region
Thanks loads I put my header and footer into the region-before and region-after of the page and problem solved (for now.) -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Friday, December 19, 2008 3:27 PM To: fop-users@xmlgraphics.apache.org Subject: Re: table overflow onto page 2 into specific region Not sure I've understood exactly what it is you need. But I'll try. First of all, you simple need fo:table-header [1] and fo:table-footer [2] before your fo:table-body. That gives you headers and footers for the table that is repeated on each page. [1] http://www.w3.org/TR/xsl11/#fo_table-header [2] http://www.w3.org/TR/xsl11/#fo_table-footer An example: fo:table table-layout=fixed width=100% fo:table-column number-columns-repeated=2 column-width=proportional-column-width(1)/ fo:table-header fo:table-row fo:table-cell fo:blockheader1/fo:block /fo:table-cell fo:table-cell fo:blockheader2/fo:block /fo:table-cell /fo:table-row /fo:table-header fo:table-footer fo:table-row fo:table-cell fo:blockfooter1/fo:block /fo:table-cell fo:table-cell fo:blockfooter2/fo:block /fo:table-cell /fo:table-row /fo:table-footer fo:table-body fo:table-row fo:table-cell fo:blockcell1/fo:block /fo:table-cell fo:table-cell fo:blockcell2/fo:block /fo:table-cell /fo:table-row fo:table-row fo:table-cell fo:blockcell3/fo:block /fo:table-cell fo:table-cell fo:blockcell4/fo:block /fo:table-cell /fo:table-row /fo:table-body /fo:table Only now, it's getting tricky. You say you need changing content in the header and footer. That's what table-markers [3][4] from XSL 1.1 are for. But unfortunately, this hasn't been implemented, yet. So the only thing you can try is putting your header and footer content in the region-before and the region-after of the page. There you can work with fo:retrieve-marker [5] to access content you specify in fo:marker [6] elements. [3] http://www.w3.org/TR/xsl11/#fo_retrieve-table-marker [4] http://www.w3.org/TR/xsl11/#d0e14681 [5] http://www.w3.org/TR/xsl11/#fo_retrieve-marker [6] http://www.w3.org/TR/xsl11/#fo_marker HTH On 18.12.2008 16:24:11 Chakravarty, Abhishek wrote: Hi Is there a way to ensure in my stylesheet that a table overflows into second page into the area which is prespecified for it only? As in I have the page setup as the header followed by a table followed by footer. But if the table overflows then is it possible to have it onto the second page in the same region so that my second page would now look like header followed by table (the content of which is from the previous page table overflow) and then the footer. Also none of the info is static i.e. headers and footers can change depending on the content being pulled in from the xml (but the table layout remains the same). Regards Abhishek Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Populate table with blank cells/rows
Is there a way to populate a table (which overflows onto page 2) with empty rows/cells until a particular margin(..in this case until the footer i.e. the region-after section) when the contents have already been obtained from the xml? Sometimes data in the xml can wrap onto the next line in the resulting pdf (as the column width is smaller in the table specs). So it creates a problem where just simply counting the number of lines which have been populated so far doesn't work. Have tried setting a row height with blank data to make the empty row(s) but setting a static height to fill is only possible when it is known how much of the region -body has already been filled, which in this case won't be possible to know due to the word wrapping issue. Regards Abhishek - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
table overflow onto page 2 into specific region
Hi Is there a way to ensure in my stylesheet that a table overflows into second page into the area which is prespecified for it only? As in I have the page setup as the header followed by a table followed by footer. But if the table overflows then is it possible to have it onto the second page in the same region so that my second page would now look like header followed by table (the content of which is from the previous page table overflow) and then the footer. Also none of the info is static i.e. headers and footers can change depending on the content being pulled in from the xml (but the table layout remains the same). Regards Abhishek - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Force page break to skip immediate next page and continue writing on third page
Yes. I had gone through the mailing list as well but was hoping that this had been fixed since then. Unfortunately that does not seem to be the case. :-( Thanks Eric, Jeremias and Barry for all those inputs. From: Amick, Eric [mailto:eric.am...@mail.house.gov] Sent: Tuesday, December 16, 2008 8:37 AM To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page I found this in the mailing list archives, for what it's worth From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Friday, June 15, 2007 1:28 AM To: fop-users@xmlgraphics.apache.org Subject: Re: flow does not map to the region-body error Well, as the error message says, FOP doesn't support that, yet. FOP currently expects that the flow-name of the fo:flow maps to the region-body in the simple-page-master. If it were: fo:flow flow-name=xsl-region-body it would work. I know this is generally possible, but I guess it is too exotic and nobody cared to implement that possibility, yet. Obviously no one has implemented it since then. Eric Amick Legislative Computer Systems Office of the Clerk From: Chakravarty, Abhishek [mailto:abhis...@accidentfund.com] Sent: Tuesday, December 16, 2008 8:17 To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page I ran the transform just to generate the FO and subsequently tried to generate the pdf from that fo and found that as long as the header text was limited and not overflowing into the next page it was doing fine(i.e. pdf generated) but as soon as the header overflowed from page 1 ('simple') then I ran into the same error as previous... Error: Flow 'xsl-region-body' does not map to the region-body in page-master 'blank-page'. FOP presently does not support this. The FO generated from the transform is below. Plz let me know if there is something that needs to be corrected in this. ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:page-sequence-master master-name=document fo:single-page-master-reference master-reference=simple/ fo:single-page-master-reference master-reference=blank-page/ fo:repeatable-page-master-reference master-reference=simple/ /fo:page-sequence-master fo:simple-page-master page-width=21.6cm page-height=18.5cm master-name=simple fo:region-body/ fo:region-after/ /fo:simple-page-master fo:simple-page-master page-width=21.6cm page-height=18.5cm master-name=blank-page fo:region-body region-name=blank/ fo:region-after/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=document fo:static-content flow-name=blank fo:block font-family=Helvetica font-weight=bold font-size=32pt FOOTER TEXT /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:block font-family=Helvetica font-weight=bold font-size=32pt HEADER TEXT..Sample TextSample TextSample TextSample TextSample TextSample Text Sample TextSample TextSample TextSample TextSample TextSample TextSample Text.. ..Sample TextSample TextSample TextSample TextSample TextSample TextSample Text.. ..Sample TextSample TextSample TextSample TextSample TextSample TextSample Text.. ..Sample Text /fo:block /fo:flow /fo:page-sequence /fo:root -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Tuesday, December 16, 2008 3:38 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Force page break to skip immediate next page and continue writing on third page Abhishek, I don't think you're hitting a limitation of FOP. Eric has a point. It appears that the FO you're generating is not valid and that's why FOP shows errors. To debug the situation I suggest you take FOP out of the picture for the moment and just run your XSLT transformation. Then take a look at the FO file that is generated and fix your stylesheet as necessary. As a convenience, FOP offers to run just the XSLT transformation on the command-line: fop -xml my.xml -xsl my.xml -foout out.fo It can be difficult to debug problems if you always run both the XSLT transformation and the FO layout at the same time. Good luck! On 15.12.2008 21:10
RE: Force page break to skip immediate next page and continue writing on third page
I ran the transform just to generate the FO and subsequently tried to generate the pdf from that fo and found that as long as the header text was limited and not overflowing into the next page it was doing fine(i.e. pdf generated) but as soon as the header overflowed from page 1 ('simple') then I ran into the same error as previous... Error: Flow 'xsl-region-body' does not map to the region-body in page-master 'blank-page'. FOP presently does not support this. The FO generated from the transform is below. Plz let me know if there is something that needs to be corrected in this. ?xml version=1.0 encoding=UTF-8? fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:page-sequence-master master-name=document fo:single-page-master-reference master-reference=simple/ fo:single-page-master-reference master-reference=blank-page/ fo:repeatable-page-master-reference master-reference=simple/ /fo:page-sequence-master fo:simple-page-master page-width=21.6cm page-height=18.5cm master-name=simple fo:region-body/ fo:region-after/ /fo:simple-page-master fo:simple-page-master page-width=21.6cm page-height=18.5cm master-name=blank-page fo:region-body region-name=blank/ fo:region-after/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=document fo:static-content flow-name=blank fo:block font-family=Helvetica font-weight=bold font-size=32pt FOOTER TEXT /fo:block /fo:static-content fo:flow flow-name=xsl-region-body fo:block font-family=Helvetica font-weight=bold font-size=32pt HEADER TEXT..Sample TextSample TextSample TextSample TextSample TextSample Text Sample TextSample TextSample TextSample TextSample TextSample TextSample Text.. ..Sample TextSample TextSample TextSample TextSample TextSample TextSample Text.. ..Sample TextSample TextSample TextSample TextSample TextSample TextSample Text.. ..Sample Text /fo:block /fo:flow /fo:page-sequence /fo:root -Original Message- From: Jeremias Maerki [mailto:d...@jeremias-maerki.ch] Sent: Tuesday, December 16, 2008 3:38 AM To: fop-users@xmlgraphics.apache.org Subject: Re: Force page break to skip immediate next page and continue writing on third page Abhishek, I don't think you're hitting a limitation of FOP. Eric has a point. It appears that the FO you're generating is not valid and that's why FOP shows errors. To debug the situation I suggest you take FOP out of the picture for the moment and just run your XSLT transformation. Then take a look at the FO file that is generated and fix your stylesheet as necessary. As a convenience, FOP offers to run just the XSLT transformation on the command-line: fop -xml my.xml -xsl my.xml -foout out.fo It can be difficult to debug problems if you always run both the XSLT transformation and the FO layout at the same time. Good luck! On 15.12.2008 21:10:42 Chakravarty, Abhishek wrote: Yes, I am using an xsl and xml to generate my pdf through FOP 0.95 instead of using only an FO file. However I am able to generate an FO from my xsl and xml but unable to generate the pdf itself either by a combination of the xsl and xml or just through fo alone. So this may just be a limitation of FOP. If nothing else works, I will probably be looking at iText to solve this issue now. From: Amick, Eric [mailto:eric.am...@mail.house.gov] Sent: Monday, December 15, 2008 3:02 PM To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page It may well be true for FOP. I believe what I have in mind is legal FO; maybe someone else knows for certain. Eric Amick Legislative Computer Systems Office of the Clerk snip/ Jeremias Maerki - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Force page break to skip immediate next page and continue writing on third page
I tried to use a second simple page master now however I am getting stuck with the error as fo:Validation Exception: Error(Unknown location): fo:page-sequence is missing child elements. Required Content Model: (title?,static-content*,flow) The updated stylesheet is below. Please tell me what exactly am doing wrong over here xsl:template match=/ fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=simple page-height=18.5cm page-width=21.6cm fo:region-body / fo:region-after/ /fo:simple-page-master fo:simple-page-master master-name=blank-page page-height=18.5cm page-width=21.6cm fo:region-body region-name=blank/ fo:region-after/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=blank-page fo:static-content flow-name=blank fo:block font-size=32pt font-weight=bold font-family=Helvetica xsl:value-of select=data/footer/ /fo:block /fo:static-content /fo:page-sequence fo:page-sequence master-reference=simple fo:flow flow-name=xsl-region-body fo:block font-size=32pt font-weight=bold font-family=Helvetica xsl:value-of select=data/header/ /fo:block /fo:flow /fo:page-sequence /fo:root fo:page-sequence-master master-name=document fo:single-page-master-reference master-reference=simple/ fo:single-page-master-reference master-reference=blank-page/ fo:repeatable-page-master-reference master-reference=simple/ /fo:page-sequence-master /xsl:template From: Amick, Eric [mailto:eric.am...@mail.house.gov] Sent: Monday, December 15, 2008 8:34 AM To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page That isn't necessarily a problem. Is there only one data/footer element? If so, you can just put the needed xsl:value-of in the fo:static-content. Eric Amick Legislative Computer Systems Office of the Clerk From: Chakravarty, Abhishek [mailto:abhis...@accidentfund.com] Sent: Friday, December 12, 2008 16:35 To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page Yes, unfortunately the footer content is dynamic and will change depending on the content being pulled in by the xml. :-( From: Amick, Eric [mailto:eric.am...@mail.house.gov] Sent: Friday, December 12, 2008 4:26 PM To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page I assume that simple is a simple-page-master. Create a second simple-page-master called, say, blank-page which is a copy of simple with one difference: Define the region-body in blank-page as fo:region-body region-name=blank/ You'll then need an fo:page-sequence-master that looks something like this: fo:page-sequence-master master-name=document fo:single-page-master-reference master-reference=simple/ fo:single-page-master-reference master-reference=blank-page/ fo:repeatable-page-master-reference master-reference=simple/ /fo:page-sequence-master Take the page break off the fo:block as well. If you use that page-sequence-master, you will get a blank second page if and only if the data overflows the first page. Putting the footer on the second page is trickier and depends on whether that footer can change. If this was FO 1.1, you could use flow maps; you may have to resort to having fo:static-content in blank-page instead. Eric Amick Legislative Computer Systems Office of the Clerk From: Chakravarty, Abhishek [mailto:abhis...@accidentfund.com] Sent: Friday, December 12, 2008 14:53 To: fop-users@xmlgraphics.apache.org Subject: Force page break to skip immediate next page and continue writing on third page Hi I need to force page break within my fo block such that If there is content from page 1('header') which is overflowing onto page 2 then it skips page 2 but continuous onto page 3 while at the same time the 'footer' is written on page 2. This is what my XSL looks like fo:page-sequence master-reference=simple fo:flow flow-name=xsl-region-body fo:block break-after=page xsl:apply
RE: Force page break to skip immediate next page and continue writing on third page
I tried moving the fo:page-sequence master-reference=blank-page and fo:page-sequence master-reference=simple into the fo:layout-master-set but this time around I am getting stuck with the error as fo:page-sequence is not a valid child element of fo:layout-master-set. I even tried moving the fo:page-sequence-master master-name=document into the fo:layout-master-set and keeping the other fo:page-sequence master-reference(s) as the same but then I am back to the same error as fo:Validation Exception: Error(Unknown location): fo:page-sequence is missing child elements. Required Content Model: (title?,static-content*,flow) From: Barry Whiting [mailto:barry_whit...@londonmarketing.com] Sent: Monday, December 15, 2008 11:17 AM To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page Try putting your fo:page-sequence-master node in the fo:layout-master-set Thanks Barry From: Chakravarty, Abhishek [mailto:abhis...@accidentfund.com] Sent: 15 December 2008 15:22 To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page I tried to use a second simple page master now however I am getting stuck with the error as fo:Validation Exception: Error(Unknown location): fo:page-sequence is missing child elements. Required Content Model: (title?,static-content*,flow) The updated stylesheet is below. Please tell me what exactly am doing wrong over here xsl:template match=/ fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=simple page-height=18.5cm page-width=21.6cm fo:region-body / fo:region-after/ /fo:simple-page-master fo:simple-page-master master-name=blank-page page-height=18.5cm page-width=21.6cm fo:region-body region-name=blank/ fo:region-after/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=blank-page fo:static-content flow-name=blank fo:block font-size=32pt font-weight=bold font-family=Helvetica xsl:value-of select=data/footer/ /fo:block /fo:static-content /fo:page-sequence fo:page-sequence master-reference=simple fo:flow flow-name=xsl-region-body fo:block font-size=32pt font-weight=bold font-family=Helvetica xsl:value-of select=data/header/ /fo:block /fo:flow /fo:page-sequence /fo:root fo:page-sequence-master master-name=document fo:single-page-master-reference master-reference=simple/ fo:single-page-master-reference master-reference=blank-page/ fo:repeatable-page-master-reference master-reference=simple/ /fo:page-sequence-master /xsl:template From: Amick, Eric [mailto:eric.am...@mail.house.gov] Sent: Monday, December 15, 2008 8:34 AM To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page That isn't necessarily a problem. Is there only one data/footer element? If so, you can just put the needed xsl:value-of in the fo:static-content. Eric Amick Legislative Computer Systems Office of the Clerk From: Chakravarty, Abhishek [mailto:abhis...@accidentfund.com] Sent: Friday, December 12, 2008 16:35 To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page Yes, unfortunately the footer content is dynamic and will change depending on the content being pulled in by the xml. :-( From: Amick, Eric [mailto:eric.am...@mail.house.gov] Sent: Friday, December 12, 2008 4:26 PM To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page I assume that simple is a simple-page-master. Create a second simple-page-master called, say, blank-page which is a copy of simple with one difference: Define the region-body in blank-page as fo:region-body region-name=blank/ You'll then need an fo:page-sequence-master that looks something like this: fo:page-sequence-master master-name=document fo:single-page-master-reference master-reference=simple/ fo:single-page-master-reference master-reference=blank-page/ fo:repeatable-page-master-reference master-reference=simple
Force page break to skip immediate next page and continue writing on third page
Hi I need to force page break within my fo block such that If there is content from page 1('header') which is overflowing onto page 2 then it skips page 2 but continuous onto page 3 while at the same time the 'footer' is written on page 2. This is what my XSL looks like fo:page-sequence master-reference=simple fo:flow flow-name=xsl-region-body fo:block break-after=page xsl:apply-templates select=data/header/ /fo:block fo:block xsl:apply-templates select=data/footer/ /fo:block /fo:flow /fo:page-sequence /fo:root /xsl:template xsl:template match=header fo:block font-size=32pt font-weight=bold font-family=Helvetica xsl:value-of select=./ /fo:block /xsl:template xsl:template match=footer fo:block font-size=32pt font-weight=bold font-family=Helvetica xsl:value-of select=./ /fo:block /xsl:template Regards Abhishek Regards Abhishek
RE: Force page break to skip immediate next page and continue writing on third page
Yes, unfortunately the footer content is dynamic and will change depending on the content being pulled in by the xml. :-( From: Amick, Eric [mailto:eric.am...@mail.house.gov] Sent: Friday, December 12, 2008 4:26 PM To: fop-users@xmlgraphics.apache.org Subject: RE: Force page break to skip immediate next page and continue writing on third page I assume that simple is a simple-page-master. Create a second simple-page-master called, say, blank-page which is a copy of simple with one difference: Define the region-body in blank-page as fo:region-body region-name=blank/ You'll then need an fo:page-sequence-master that looks something like this: fo:page-sequence-master master-name=document fo:single-page-master-reference master-reference=simple/ fo:single-page-master-reference master-reference=blank-page/ fo:repeatable-page-master-reference master-reference=simple/ /fo:page-sequence-master Take the page break off the fo:block as well. If you use that page-sequence-master, you will get a blank second page if and only if the data overflows the first page. Putting the footer on the second page is trickier and depends on whether that footer can change. If this was FO 1.1, you could use flow maps; you may have to resort to having fo:static-content in blank-page instead. Eric Amick Legislative Computer Systems Office of the Clerk From: Chakravarty, Abhishek [mailto:abhis...@accidentfund.com] Sent: Friday, December 12, 2008 14:53 To: fop-users@xmlgraphics.apache.org Subject: Force page break to skip immediate next page and continue writing on third page Hi I need to force page break within my fo block such that If there is content from page 1('header') which is overflowing onto page 2 then it skips page 2 but continuous onto page 3 while at the same time the 'footer' is written on page 2. This is what my XSL looks like fo:page-sequence master-reference=simple fo:flow flow-name=xsl-region-body fo:block break-after=page xsl:apply-templates select=data/header/ /fo:block fo:block xsl:apply-templates select=data/footer/ /fo:block /fo:flow /fo:page-sequence /fo:root /xsl:template xsl:template match=header fo:block font-size=32pt font-weight=bold font-family=Helvetica xsl:value-of select=./ /fo:block /xsl:template xsl:template match=footer fo:block font-size=32pt font-weight=bold font-family=Helvetica xsl:value-of select=./ /fo:block /xsl:template Regards Abhishek Regards Abhishek