Re: unwanted blank page because of page count
Clay Leeds wrote: snip/ I guess that's possible. It's also possible that whatever problem you're having is due to portions of fop-0.20.5 not yet in compliance with the spec (FOP is 'moving towards' the spec, but check the Compliance page[1] to (currently shows 'basic' compliance, but not 'extended' nor 'complete' compliance with force-page-count object). Compliance is either Yes, No or Partial. The basic/extended/complete columns refer to which part of the spec that FO is categorised under. I know this has confused people before. Nonetheless, trying every value for force-page-count might yield different/better results.. Alas, I feel that what Paul is trying to achieve may not be possible with XSL-FO. Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
unwanted blank page because of page count
I need to insert just one blank page after page 6. The problem is, the next page after page 7 must be page iii, which is an odd page. That means that xsl-fo inserts *two* blank pages in order to make sure that page iii starts on the right side. The requirements for the thesis insist that one blank page be inserted after page 6. Is there any way I can get xsl-of to insert just one blank page? My code is below. Thanks Paul ** fo:page-sequence master-reference=acknowledgements format=i initial-page-number=3 force-page-count=no-force -- *Paul Tremblay * [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unwanted blank page because of page count
Paul, On May 25, 2004, at 8:29 AM, Paul Tremblay wrote: I need to insert just one blank page after page 6. The problem is, the next page after page 7 must be page iii, which is an odd page. That means that xsl-fo inserts *two* blank pages in order to make sure that page iii starts on the right side. The requirements for the thesis insist that one blank page be inserted after page 6. Is there any way I can get xsl-of to insert just one blank page? My code is below. Thanks Paul ** fo:page-sequence master-reference=acknowledgements format=i initial-page-number=3 force-page-count=no-force Can you confirm that the issue is not related to this FAQ: http://xml.apache.org/fop/faq.html#blank-page-between-page-sequences Perhaps there is something there which may help. Thanks! Web Maestro Clay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unwanted blank page because of page count
On Tue, May 25, 2004 at 08:55:20AM -0700, Clay Leeds wrote: fo:page-sequence master-reference=acknowledgements format=i initial-page-number=3 force-page-count=no-force Can you confirm that the issue is not related to this FAQ: http://xml.apache.org/fop/faq.html#blank-page-between-page-sequences Perhaps there is something there which may help. Thanks! Web Maestro Clay Thanks for your response. I had already looked at that FAQ. That's how I knew to put the force-page-count=no-force in the page sequence element. Perhaps my problem is an issue with xsl-fo and not with fop? Maybe xsl-fo *always* forces odd pages to start on odd pages, regardless of the force-page-count attribute? Thanks Paul -- *Paul Tremblay * [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: unwanted blank page because of page count
Paul, On May 25, 2004, at 9:20 AM, Paul Tremblay wrote: On Tue, May 25, 2004 at 08:55:20AM -0700, Clay Leeds wrote: fo:page-sequence master-reference=acknowledgements format=i initial-page-number=3 force-page-count=no-force Can you confirm that the issue is not related to this FAQ: http://xml.apache.org/fop/faq.html#blank-page-between-page-sequences Perhaps there is something there which may help. Thanks! Web Maestro Clay Thanks for your response. I had already looked at that FAQ. That's how I knew to put the force-page-count=no-force in the page sequence element. Perhaps my problem is an issue with xsl-fo and not with fop? Maybe xsl-fo *always* forces odd pages to start on odd pages, regardless of the force-page-count attribute? Thanks Paul I guess that's possible. It's also possible that whatever problem you're having is due to portions of fop-0.20.5 not yet in compliance with the spec (FOP is 'moving towards' the spec, but check the Compliance page[1] to (currently shows 'basic' compliance, but not 'extended' nor 'complete' compliance with force-page-count object). Nonetheless, trying every value for force-page-count might yield different/better results.. Web Maestro Clay [1] http://xml.apache.org/fop/compliance.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page count
Kuba Królikowski wrote: Hi I'm using PCL renderer in FOP. I have to count document pages. I know that I can render my document and get page count with this way. But I'm not sure that there isn't any little faster way, for example without writing PCL commands to PCL stream. Do you know where exactly there is a moment in rendering process when page count is calculated? How can I calculate it in the fastest way? Have you tried using fo:page-number-citation ref-id=end/ of course, dont forget to put id=end on your last FO in the flow, e.g. fo:block id=end This is the last block /fo:block Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page count
Yes, I know about that, but I have to write universal mechanism, which will calculate page count of every document, even without those fo tags. Besides if I only need to count pages I don't have to render document to PDF or PCL - I wonder if there exists any moment in FOP rendering process when I can get page count. Maybe I should write my own simple Renderer? Kuba Kuba Królikowski wrote: Hi I'm using PCL renderer in FOP. I have to count document pages. I know that I can render my document and get page count with this way. But I'm not sure that there isn't any little faster way, for example without writing PCL commands to PCL stream. Do you know where exactly there is a moment in rendering process when page count is calculated? How can I calculate it in the fastest way? Have you tried using fo:page-number-citation ref-id=end/ of course, dont forget to put id=end on your last FO in the flow, e.g. fo:block id=end This is the last block /fo:block Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page count
Kuba Królikowski wrote: Yes, I know about that, but I have to write universal mechanism, which will calculate page count of every document, even without those fo tags. Besides if I only need to count pages I don't have to render document to PDF or PCL - I wonder if there exists any moment in FOP rendering process when I can get page count. Maybe I should write my own simple Renderer? I dont follow exactly what you are trying to do. You need the number of pages, but not the rendered document? You could write a simple renderer that implements all the methods in the AbstractRenderer and does nothing in those methods, to keep processing to a minimum. To be honest I dont think it will save more than 10%-20% of the time. Most of the processing time is taken up by layout, not the renderer. Chris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: page count
Henrik Holle wrote: can you please explain me how to count the page in a fo with an xslt? You have to render the XML with a placeholder, count pages, and render again with the actual number of pages. FOP provides a method to access the total number of pages rendered, this allows automation (note: code can be optimized): public static void main(String args[]) { try { Driver driver =new Driver(); driver.setOutputStream(new FileOutputStream(args[2])); driver.setRenderer(Driver.RENDER_PDF); Transformer transformer=TransformerFactory.newInstance() .newTransformer(new StreamSource(new File(args[1]))); transformer.setParameter(page-count,#); transformer.transform(new StreamSource(new File(args[0])), new SAXResult(driver.getContentHandler())); String pageCount=Integer.toString(driver.getResults().getPageCount()); driver =new Driver(); driver.setOutputStream(new FileOutputStream(args[2])); driver.setRenderer(Driver.RENDER_PDF); transformer=TransformerFactory.newInstance(). newTransformer(new StreamSource(new File(args[1]))); transformer.setParameter(page-count,pageCount); transformer.transform(new StreamSource(new File(args[0])), new SAXResult(driver.getContentHandler())); } catch( Exception e) { e.printStackTrace(); } } A sample XSL: ?xml version=1.0 encoding=ISO-8859-1? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:strip-space elements=*/ xsl:param name=page-count select='#'/ xsl:template match=doc fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=content page-width=210mm page-height=297mm margin-left=25mm margin-right=25mm margin-top=25mm margin-bottom=15mm fo:region-body margin-bottom=10mm/ fo:region-after extent=10mm/ /fo:simple-page-master /fo:layout-master-set fo:page-sequence master-reference=content fo:static-content flow-name=xsl-region-after fo:block text-align=end fo:page-number/ xsl:text of /xsl:text xsl:value-of select=$page-count/ /fo:block /fo:static-content fo:flow flow-name=xsl-region-body xsl:apply-templates/ /fo:flow /fo:page-sequence /fo:root /xsl:template xsl:template match=sect1 fo:block space-before=12pt xsl:apply-templates select=title/ /fo:block fo:block space-before=3pt xsl:apply-templates select=title/following-sibling::*/ /fo:block /xsl:template xsl:template match=p fo:block space-before=3pt xsl:apply-templates/ /fo:block /xsl:template /xsl:stylesheet Note the parameter page-count. A sample XML, just for completeness:?xml version=1.0? doc sect1 titlePassword/title pThe users password, as an MD5 hash. The hash is calculated as follows: First the password String is converted into an UTF8 encoded array of bytes: String.getBytes(UTF8). The MD5 digest is calculated over the given array of bytes and stored as a hex string./p /sect1 /doc HTH J.Pietschmann
Re: Re: page count
can you please explain me how to count the page in a fo with an xslt? -Ursprungliche Nachricht- Von: Chuck Paussa [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 25. April 2002 17:03 An: [EMAIL PROTECTED] Betreff: Re: AW: page count Henrik, There is no way to do what you want in FO in one pass. What you'll need to do is generate the fo: document with some marked up place holders in it. Something like fo:block placeholder=PutTotalPagesHere/. Then run that document through an XSLT transformation that adds up the total number of pages and replaces those special blocks with the information you want. (You'll see this technique referred to in the archives as Making a second pass over the document.) You can then use FOP to generate the output you want. Chuck Henrik Holle wrote: I have various page-sequences in my document: fo:page-sequence master-reference=NameOfMasterReference initial-page-number=1 but at the end of the document i need to count the whole pages of all page-sequences. !fo:page-number-citation ref-id = lastBlock/! does not work! -Ursprungliche Nachricht- Von: Ian Taylor [mailto:[EMAIL PROTECTED] Betreff: Re: page count I put this in my xsl:region-after fo:block font-size=9pt line-height=11pt text-align=end Page no: fo:page-number/ of fo:page-number-citation ref-id = lastBlock/ /fo:block where the last block in the document looks like this fo:block id = lastBlock/ Ian At 12:54 PM 4/24/2002 +0200, you wrote: Hello, I want to write something like page x of y where y is the number of pages in my document. x is generated by fo:page-number/ but how do I get y?? Harald
Re: page count
Henrik, Your .fo file is an XML document. So, you need to write an XSL that can rewrite the .fo document with some minor changes. Lets say you follow my suggestion and your first XSL generates an .fo with fo:inline placeholder=PutTotalPagesHere1234/fo:inline in those spots where you want the page total. (. . . hm that is a tough problem isn't it?) OK. You have to then render the document using FOP because FOP is the only thing that's going to know how many pages are rendered. You'll have to capture the total number of pages from FOP using that Java variable which I saw referred to in a post about 3 weeks ago (anyone?) and then rewrite the .fo using an XSL like this. Passing in the value for the number of pages as a parameter to your stylesheet. I use saxon and the command line is something like saxon -o output.fo input.fo rewrite.xsl TotalPages=24 There's a Java interface on most XSL processors that allow you to do the same thing. (Or, you could dynamically generate this XSL with the number of pages embedded) ?xml version=1.0? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; exclude-result-prefixes=fo xsl:output method=xml version=4.0 omit-xml-declaration=yes indent=yes/ xsl:param name=TotalPages/ xsl:template match=/ xsl:apply-templates mode=output/ /xsl:template xsl:template match=* mode=output !-- This template outputs the XML document as text -- xsl:element name={name()} xsl:for-each select=@* xsl:attribute name={name(.)} xsl:value-of select=./ /xsl:attribute /xsl:for-each xsl:if test=count(./*) gt; 0 xsl:for-each select=. xsl:apply-templates mode=output/ /xsl:for-each /xsl:if xsl:if test=string-length(.) gt; 0 xsl:if test=count(./*) = 0 xsl:value-of select=./ /xsl:if /xsl:if /xsl:element /xsl:template xsl:template match=fo:[EMAIL PROTECTED] mode=output xsl:value-of select=$TotalPages/ /xsl:template /xsl:stylesheet Chuck Paussa Henrik Holle wrote: can you please explain me how to count the page in a fo with an xslt? -Ursprungliche Nachricht- Von: Chuck Paussa [mailto:[EMAIL PROTECTED] Henrik, There is no way to do what you want in FO in one pass. What you'll need to do is generate the fo: document with some marked up place holders in it. Something like fo:inline placeholder=PutTotalPagesHere/. Then run that document through an XSLT transformation that adds up the total number of pages and replaces those special blocks with the information you want. (You'll see this technique referred to in the archives as Making a second pass over the document.) You can then use FOP to generate the output you want. Chuck Henrik Holle wrote: I have various page-sequences in my document: fo:page-sequence master-reference=NameOfMasterReference initial-page-number=1 but at the end of the document i need to count the whole pages of all page-sequences. !fo:page-number-citation ref-id = lastBlock/! does not work! -Ursprungliche Nachricht- Von: Ian Taylor [mailto:[EMAIL PROTECTED] I put this in my xsl:region-after fo:block font-size=9pt line-height=11pt text-align=end Page no: fo:page-number/ of fo:page-number-citation ref-id = lastBlock/ /fo:block where the last block in the document looks like this fo:block id = lastBlock/ Ian At 12:54 PM 4/24/2002 +0200, you wrote: Hello, I want to write something like page x of y where y is the number of pages in my document. x is generated by fo:page-number/ but how do I get y?? Harald
AW: page count
I have various page-sequences in my document: fo:page-sequence master-reference=NameOfMasterReference initial-page-number=1 but at the end of the document i need to count the whole pages of all page-sequences. !fo:page-number-citation ref-id = lastBlock/! does not work! -Ursprungliche Nachricht- Von: Ian Taylor [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 24. April 2002 13:08 An: [EMAIL PROTECTED] Betreff: Re: page count I put this in my xsl:region-after fo:block font-size=9pt line-height=11pt text-align=end Page no: fo:page-number/ of fo:page-number-citation ref-id = lastBlock/ /fo:block where the last block in the document looks like this fo:block id = lastBlock/ Hope this helps Ian At 12:54 PM 4/24/2002 +0200, you wrote: Hello, I want to write something like page x of y where y is the number of pages in my document. x is generated by fo:page-number/ but how do I get y?? Harald
Re: AW: page count
Henrik, There is no way to do what you want in FO in one pass. What you'll need to do is generate the fo: document with some marked up place holders in it. Something like fo:block placeholder=PutTotalPagesHere/. Then run that document through an XSLT transformation that adds up the total number of pages and replaces those special blocks with the information you want. (You'll see this technique referred to in the archives as Making a second pass over the document.) You can then use FOP to generate the output you want. Chuck Henrik Holle wrote: I have various page-sequences in my document: fo:page-sequence master-reference=NameOfMasterReference initial-page-number=1 but at the end of the document i need to count the whole pages of all page-sequences. !fo:page-number-citation ref-id = lastBlock/! does not work! -Ursprungliche Nachricht- Von: Ian Taylor [mailto:[EMAIL PROTECTED] Betreff: Re: page count I put this in my xsl:region-after fo:block font-size=9pt line-height=11pt text-align=end Page no: fo:page-number/ of fo:page-number-citation ref-id = lastBlock/ /fo:block where the last block in the document looks like this fo:block id = lastBlock/ Ian At 12:54 PM 4/24/2002 +0200, you wrote: Hello, I want to write something like page x of y where y is the number of pages in my document. x is generated by fo:page-number/ but how do I get y?? Harald
Re: page count
I put this in my xsl:region-after fo:block font-size=9pt line-height=11pt text-align=end Page no: fo:page-number/ of fo:page-number-citation ref-id = lastBlock/ /fo:block where the last block in the document looks like this fo:block id = lastBlock/ Hope this helps Ian At 12:54 PM 4/24/2002 +0200, you wrote: Hello, I want to write something like page x of y where y is the number of pages in my document. x is generated by fo:page-number/ but how do I get y?? Harald
Re: force-page-count, blank page and text in this blank page
On Wednesday 10 April 2002 05:00, you wrote: Hy I'm on a document composed with diferent page sequences. Those sequences are put together to realise a final document. So I have to generate sequences with a force-count-page to have an even number of pages in each sequence. The problem is that when a page is forced it appears without text in, and I would like this page to contain a text like : normal blank page . How can I do such a thing ? This is discussed in The XSL Companion by Neil Bradley; http://www.awl.com/cseng pup 2000. Chapter 17: XSL. You can also get the gist of this from Elliot rusty Harold's XML book or from the tutorials on the www.renderx.com, antennahouse.com or from IBM.com's developerworks or alphaworks sites. Specifically see pp 150-155. root ... layout-master-set simple-page-master master-name=first-page !-- TEMPLATE 1 -- /simple-page-master ... more s-p-m's for right-page, left-page and blank-page ... page-sequence-master master-name=ChapterSequence repeatable-page-master-alternatives conditional-page-master-reference page-position=first master-reference='first-page ... blank, odd and even pages omitted /repeatable- ... /page-seq... /layout-master-set page-sequence master-reference=ChapterSequence ... repeat static content blocks and a single flow/ object /page-sequence root
how to print page count ?
I've to print page X of Y, where Y is a total number of pages. how?
RE: how to print page count ?
This is in Dave Pawson's FAQ: For example, suppose we wish to write a report this way Page 3 of 67. fo:page-number-citation ref-id=endofdoc/ will produce it, if the last thing in your document is something with 'id=endofdoc', e.g. fo block id=endofdoc/fo:block http://www.dpawson.co.uk/xsl/sect3/N8703.html#d246e33 -Original Message- From: Argyn Kuketayev [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 02, 2002 4:28 PM To: [EMAIL PROTECTED] Apache. Org (E-mail) Subject: how to print page count ? I've to print page X of Y, where Y is a total number of pages. how?
RE: how to print page count ?
Put something like fo:block id=EndOfDocument/ at the end of your document. Then wherever you need page X of Y insert, page fo:page-number/ of fo:page-number-citation ref-id=EndOfDocument/ You might find http://zvon.org/xxl/xslfoReference/Output/index.html useful. Matthew L. Avizinis mailto:[EMAIL PROTECTED] Gleim Publications, Inc. 4201 NW 95th Blvd. Gainesville, FL 32606 (352)-375-0772 ext. 101 www.gleim.com http://www.gleim.com -Original Message- From: Argyn Kuketayev [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 02, 2002 4:28 PM To: [EMAIL PROTECTED] Apache. Org (E-mail) Subject: how to print page count ? I've to print page X of Y, where Y is a total number of pages. how?
RE: how to print page count ?
thank you, guys. it works. I thought it had to be a standard formatting property for fo:page-number -Original Message- From: Argyn Kuketayev [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 02, 2002 4:28 PM To: [EMAIL PROTECTED] Apache. Org (E-mail) Subject: how to print page count ? I've to print page X of Y, where Y is a total number of pages. how?