R: 'conditional-page-master-reference' default required?

2008-01-04 Thread Roberto Bonsignori
try this:

?xml version=1.0 encoding=utf-8?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
fo:layout-master-set
  fo:simple-page-master master-name='simple'
  page-height='246mm'
  page-width='349mm'
  margin-top='10mm'margin-bottom='10mm'
  margin-left='10mm'   margin-right='10mm'
fo:region-body margin-top='10mm' margin-bottom='10mm'/
fo:region-before extent='10mm'/
fo:region-after extent='10mm'/
  /fo:simple-page-master
/fo:layout-master-set

fo:page-sequence master-name='simple'
  fo:static-content flow-name='xsl-region-before'
fo:table font-size='10pt' width='auto'
  fo:table-column column-width='269mm'/
  fo:table-column column-width='60mm'/
  fo:table-body
fo:table-row height='10pt'
  fo:table-cell text-align='start'
fo:block start-indent='1mm' end-indent='1mm'
padding-top='0.5mm'
  HEADER TITLE/fo:block
  /fo:table-cell
  fo:table-cell text-align='end'
fo:block start-indent='1mm' end-indent='1mm'
padding-top='0.5mm'
  Pag. fo:page-number//fo:block
  /fo:table-cell
/fo:table-row
  /fo:table-body
/fo:table
  /fo:static-content

  fo:static-content flow-name='xsl-region-after'
fo:table font-size='8pt' width='auto'
  fo:table-column column-width='269mm'/
  fo:table-column column-width='60mm'/
  fo:table-body
fo:table-row height='10pt'
  fo:table-cell text-align='start'
fo:block start-indent='1mm' end-indent='1mm'
padding-top='0.5mm'
  FOOTER LEFT TITLE/fo:block
  /fo:table-cell
  fo:table-cell text-align='end'
fo:block start-indent='1mm' end-indent='1mm'
padding-top='0.5mm'
  FOOTER RIGHT TITLE/fo:block
  /fo:table-cell
/fo:table-row
  /fo:table-body
/fo:table
  /fo:static-content

  fo:flow flow-name='xsl-region-body'
fo:block font-size='10pt' start-indent='1mm' end-indent='1mm'
padding-top='0.5mm' space-before.optimum='3mm' space-after.optimum='5mm'
SUBTITLE/fo:block
  /fo:flow
/fo:page-sequence
/fo:root

-Messaggio originale-
Da: irene23 [mailto:[EMAIL PROTECTED]
Inviato: mercoledi 2 gennaio 2008 15.54
A: fop-users@xmlgraphics.apache.org
Oggetto: Re: 'conditional-page-master-reference' default required?



Hello,

I have made this, but when fop renders to a 1 page document, I get the any
page footer (instead of the last page footer), even though the  page is
the last page (when the fop renders to a 2+ page document, the last page
gets the last footer and the other pages get the other footer).

Could you give me any idea to get the same in other way? Is there some
attibute to place a block at the end of the body?


Thanks.



Jerzy Jalocha wrote:

 I have a two-page document with two 'simple-page-master's, one for the
 first page, and one for the last one. When I use a conditional
 sequence with 'repeatable-page-master-alternatives', and I don't
 provide a default 'conditional-page-master-reference', FOP complains
 about subsequences exhausted in page-sequence-master, and crashes.

 As seen in the example below, it is easy to circumvent the problem by
 providing a default, but I'm not sure if this behavior is expected, or
 a bug. The specification doesn't seem to require a default
 (http://www.w3.org/TR/xsl/#fo_conditional-page-master-reference).

 More in general, I have the following question. Since I'm new to both
 FOP and XSL-FO, I am quite prone to breaking things. Is it OK to
 report them here when I think I might have found a bug? Or shall I
 wait until I have more expertise?

 Thanks in advance,
 -Jerzy


 ?xml version=1.0 encoding=utf-8?
 fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;

fo:layout-master-set

   fo:simple-page-master master-name=first-page
 page-height=11in page-width=8.5in
 margin-top=0mm margin-left=0mm margin-right=0mm
 margin-bottom=0mm
  fo:region-body
border-style=none
margin-top=80mm margin-bottom=20mm
 margin-left=20mm margin-right=20mm/
  fo:region-before region-name=first-region-before
border-style=none/
  fo:region-after region-name=first-region-after
border-style=none/
   /fo:simple-page-master

   fo:simple-page-master master-name=last-page
 page-height=11in page-width=8.5in
 margin-top=0mm margin-left=0mm margin-right=0mm
 margin-bottom=0mm
  fo:region-body
border-style=none
margin-top=40mm margin-bottom=20mm
 margin-left=20mm margin-right=20mm/
  fo:region-before region-name=last-region-before
border-style=none/
  fo:region-after region-name=last-region-after
border-style=none/
   /fo:simple-page-master

   fo:page-sequence-master master-name=document-sequence
  fo:repeatable-page-master-alternatives
 

Detecting a page break before it happens

2008-01-04 Thread Trevor Keast

Hi,

I have a large table that spans many pages.  I need some way or 
detecting a page break before it happens so that I can write 
continued... at the bottom of the table.


How can I go about doing this?

Thanks in advance!

Regards,

Trevor.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to put batch process into background on Mac OS

2008-01-04 Thread Terry Ofner
Thanks for the ant tip Eric. The following build.xml does the trick  
for the fop part of my process. I notice that the process is much  
faster: 1 minute 45 seconds for 52 pdf documents. Before it was  
taking anywhere from 8 to 11 minutes.


Here is my build.xml file:

?xml version=1.0 encoding=ISO-8859-1?
project name=MyTask basedir=. default=generate-multiple-pdf

property name=fop.home value=/Applications/fop-0.94/
property name=build.dir value=pdf_files/
property name=source.dir value=fo_files/

taskdef name=fop
 classname=org.apache.fop.tools.anttasks.Fop
  classpath
fileset dir=${fop.home}/lib
  include name=*.jar/
/fileset
fileset dir=${fop.home}/build
  include name=fop.jar/
  !--include name=fop-hyph.jar /--
/fileset
  /classpath
/taskdef
target name=generate-multiple-pdf
description=Generates multiple PDF files
   fop format=application/pdf
outdir=${build.dir} messagelevel=debug
fileset dir=${source.dir}
   include name=*.fo/
/fileset
   /fop
/target
/project

I have not studied how to include the XSLT transformation. Here is  
how it would go:


source XML document xslt transform via saxon (xslt 2.0) --- 50 
+ .fo documents ---fop---50+ pdf documents.


The xslt automatically produces the 50 fo docs via xsl:result- 
document. Would all this go into one build.xml? If so, would I just  
call the xslt task first then call the generate_multiple-pdf task?


I am not sure that I need to bundle this all together. But it might  
make my life easier.


Thanks again,

Terry

On Jan 3, 2008, at 5:38 PM, Eric Vought wrote:





If you are doing that much formatting, you may really want to check  
out using ant for your build process, especially if doing multiple  
output formats. I use this on Mac OS X and have no problem with  
background running or anything else. My rule for PDF formatting is  
just:


  target name=pdf depends=-fo description=Produce the PDF
fop format=application/pdf basedir=${formatdir}
  fofile=${formatdir}/${basename}.fo
  outfile=${formatdir}/${basename}.pdf/
  /target

It is easy to adapt this to use a glob rule to build a list of  
files to format and I also have my process automatically validate  
DocBook inputs, produce single file and chunked HTML, ODF, convert  
graphics files from SVG as necessary, automatically check dates to  
only format what is needed, zip the formatted files and graphics  
for distribution,  clean up the working directories, and even do  
some dependency tracking on what versions of DocBook, the XSLT  
stylesheets, fop and other libraries I am using for a particular  
document so I don't have trouble when I check out an old one from  
version control. I have a template build file I include for each  
project and then customize. It took me a good bit of work to set up  
the environment but has been very easy to maintain.


This is not a huge matter. More on the line of an annoyance. And I  
may need to take this question to a java list rather than this  
list. If so, just point me in the right direction.


At any rate, I have an XSLT stylesheet that produces 50+ separate  
fo documents. I then run the shell script below to batch produce  
the pdf documents:


#!/bin/sh
for foo in *.fo
do
state=`basename $foo .fo`
/Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/$state.pdf
done

When I run this script on my Mac (OS X 10.4.11, java version  
1.5.0_13 fop-0.94), org.apache.fop.cli.main takes control of the  
desktop, stopping whatever it is I am doing for about 5 seconds. I  
gain control again for about 5 seconds until fop pumps out another  
pdf document. I basically have to step away from the computer for  
the 8 minutes that the batch process takes. Adding  and wait to  
the main line of the script does not seem to work:


/Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/$state.pdf 
wait
done

The first script above on Ubuntu linux runs in the background  
without interrupting other running process.


Any simple solutions?

Terry Ofner




Sincerely,

Eric Vought

Deserves Death? I daresay he does. Many who live deserve death.  
Many who die deserve life. Can you give it to them, Frodo? Do not  
be so quick to deal death in the name of justice. Even the very  
wise cannot see all ends. -- Gandalf the Grey





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Need image to render at higher DPI

2008-01-04 Thread Chris Bowditch

Glenn Brand wrote:
I have a graphic that is rendering at a low resolution. See below in the 
last several lines. How do I get the image to render at a higher 
resolution?


When including an image via fo:external-graphic tag the resolution can 
be controlled by making the content-width/height smaller so that the 
pixels are packed more densely. However, you can't set the size of a 
image included via background-image attribute. In this case I think FOP 
just assumes a default DPI of 72 DPI.


Chris



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to put batch process into background on Mac OS

2008-01-04 Thread J.Pietschmann

Terry Ofner wrote:
I have not studied how to include the XSLT transformation. Here is how 
it would go:


source XML document xslt transform via saxon (xslt 2.0) --- 50+ .fo 
documents ---fop---50+ pdf documents.


The xslt automatically produces the 50 fo docs via 
xsl:result-document. Would all this go into one build.xml? If so, 
would I just call the xslt task first then call the 
generate_multiple-pdf task?


Basically yes. You might have to figure out how to get Ant to use
Saxon instead of the XSLT processor bundled with the JVM on your
machine, which probably provides XSLT 1.0 only. Setting the classpath
might not be enough.
The Ant documentation has plenty of examples for Ant build file snippets
and complete build files, which might help you getting started.

J.Pietschmann

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How to supress page breaks between bullet and text?

2008-01-04 Thread J.Pietschmann

Jay Bryant wrote:
Try putting the image and text into two different cells in a one-row 
table and setting keep-together=always on the row.


A fo:list-block should do the trick too:
 http://www.w3.org/TR/xsl/#fo_list-block

J.Pietschmann

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Need image to render at higher DPI

2008-01-04 Thread Glenn Brand
Thanks Chris,

I am getting better results but the image still comes in bigger than
what I specifiy and at the lower DPI.
Can you spot the problem from the XSL-FO? 
fo:table-cell
border-style=none border-width=0pt background-repeat=no-repeat
display-align=center
fo:block
fo:block
 
fo:external-graphic background=transparent width=50pt height=50pt
src=url(file:///c:/CacheSys/CSP/qacahaba/ODprofessional_logo.gif)/
/fo:block
/fo:block
/fo:table-cell

-Original Message-
From: Chris Bowditch [mailto:[EMAIL PROTECTED] 
Sent: January 4, 2008 2:10 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: Need image to render at higher DPI

Glenn Brand wrote:
 I have a graphic that is rendering at a low resolution. See below in
the 
 last several lines. How do I get the image to render at a higher 
 resolution?

When including an image via fo:external-graphic tag the resolution can 
be controlled by making the content-width/height smaller so that the 
pixels are packed more densely. However, you can't set the size of a 
image included via background-image attribute. In this case I think FOP 
just assumes a default DPI of 72 DPI.

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: Detecting a page break before it happens

2008-01-04 Thread J.Pietschmann

Trevor Keast wrote:
I have a large table that spans many pages. I need some way or detecting 
a page break before it happens so that I can write continued... at the 
bottom of the table.


How can I go about doing this?


You can't detect a page break before it happens. Really, you can't.
There is a workaround using markers. The following should help you
getting started:

?xml version=1.0?
fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format;
  fo:layout-master-set
fo:simple-page-master master-name=default
  page-height=10cm page-width=10cm
  fo:region-body margin-top=1cm margin-bottom=1cm/
  fo:region-before extent=1cm /
  fo:region-after extent=1cm /
/fo:simple-page-master
  /fo:layout-master-set
  fo:page-sequence master-reference=default
fo:static-content flow-name=xsl-region-after
  fo:block
fo:retrieve-marker
retrieve-class-name=continued
retrieve-position=last-ending-within-page/
  /fo:block
/fo:static-content
fo:flow flow-name=xsl-region-body
  fo:block
Demonstratation of using markers for a page continuation
text.
  /fo:block
  fo:table table-layout=fixed width=9cm
fo:table-column column-width=9cm/
fo:table-body
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 marker-class-name=continuedcontinued.../fo:markerLorem 
Ipsum/fo:block

/fo:table-cell
  /fo:table-row
  fo:table-row
fo:table-cell border=solid 1pt black padding=2pt
  fo:blockfo:marker
 

Re: Need image to render at higher DPI

2008-01-04 Thread J.Pietschmann

Glenn Brand wrote:

I am getting better results but the image still comes in bigger than
what I specifiy and at the lower DPI.
Can you spot the problem from the XSL-FO?

...

fo:external-graphic background=transparent width=50pt height=50pt


I think you need
 fo:external-graphic content-width=50pt content-height=50pt

J.Pietschmann

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]