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

2008-01-06 Thread Eric Vought

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



snip
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


Yes, I do everything inside ant, from building my initial project  
structure through the PDF generation. Here is one of my targets to  
produce the .fo output that is the input to Fop:


target name=-fo depends=init,convert-images
description=Produces the fo (needed for PDF production)  
formatted file


xslt in=${topdoc} out=${formatdir}/${basename}.fo
  style=${xsltdir}/fo/docbook.xsl
  factory  
name=org.apache.xalan.processor.TransformerFactoryImpl

  /factory

  xmlcatalog refid=catalog.docbook/

  !-- BUG: Fop 0.93 crashes with svg images in my environment.
   Have not been able to figure out why. Using pngs as stopgap-
   they create larger PDFs and worse printed output. (emv 09042007)
   --
  param name=graphic.default.extension expression=png/
  param name=fop1.extensions expression=1/

  param name=ulink.footnotes expression=1
unless=xslt.no.ulink.footnotes/
  param name=glossterm.auto.link expression=1
unless=xslt.no.glossterm.auto.link/
  param name=id.warnings expression=1
unless=xslt.no.id.warnings/

/xslt

  /target

It should be easy to modify to do multiple documents just like you  
did for the Fop processing. I also build several other output formats  
along the way, including ODF via Fop. The dependency in the targets  
makes sure they are built in the right order and only if needed.  
These task definitions are all in an ant-include.xml which is shared  
between projects. I have a build.xml in each project which defines  
some project specific parameters like ${topdoc} and $ 
{xsl.no.ulink.footnotes} as desired and then includes ant- 
include.xml. For a few projects, the ant-include has to be  
customized, but not often and I can define some special purpose tasks  
in the build.xml if I need to.


Sincerely,

Eric Vought

Faith does not absolve us from trying to understand our world and  
make moral distinctions with the eyes and brain given us. Religion is  
as much responsibility as direction: Duty not Distinction.



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)

iD8DBQFHgXFLfsH8fS6g9ecRAh4AAKDVc7xA+RsR4T/IoCarjNk5hGWcsQCg70vL
L3YF+EGqgx3tl/bEzZWYmpU=
=5D4E
-END PGP SIGNATURE-

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



How to put batch process into background on Mac OS

2008-01-03 Thread Eric Vought




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




0.94 and Kudos

2007-12-12 Thread Eric Vought
I just got around to upgrading 0.94, mostly because I needed to  
produce RTFs on occasion. I installed it, updated my scripts (I use  
version control to keep track of which fop/stylesheet/etc each  
project uses), and worked it pretty hard. The transition was  
seamless, several annoying warnings and minor glitches I have had  
went away and RTF generation was simple. Thanks folks, I really  
appreciate it.


I also wanted to quickly mention that I have started playing with the  
docbook2rtf package which is simple to use, produces very nice ODF  
output, and is another path to producing RTFs (via OpenOffice), but  
not automated.


Sincerely,

Eric Vought
[EMAIL PROTECTED]

We will pay the price, but we will not count the cost. --- Rush,  
Roll the Bones





What feedback is helpful at this point? (General Docbook formatting problems)

2007-05-13 Thread Eric Vought



From: Jonathan Robie [EMAIL PROTECTED]
Date: May 11, 2007 3:08:20 PM CDT
To: fop-users@xmlgraphics.apache.org
Subject: What feedback is helpful at this point? (General Docbook  
formatting problems)



Hi - I downloaded fop 0.93, and was very impressed by the general  
quality of the output, but there were a few rather obvious problems  
with the superscripts (in general) and with indenting (in one  
particular place). These are problems that seem to show up with  
most Docbook documents if (1) they use footnotes (which triggers  
the superscript problem) or (2) they have hierarchical sections and  
generate a table of contents.


Are these known problems? How can I determine this before reporting  
known problems?


Jonathan


I am using Fop 0.93  and a more recent build with Ant and the 1.72.0  
Docbook XSL stylesheets and am not seeing either of these problems  
with or without the fop extensions enabled. Make sure you are using  
relatively recent stylesheets and check the docbook project for known  
stylesheet problems. Also note that if you make heavy use of  
footnotes, you may want to use a recent checkout of Fop (post 0.93)  
as I have encountered intermittent crashes with footnotes and fop  
0.93 which are fixed in later builds.


Sincerely,

Eric Vought

Faith does not absolve us from trying to understand our world and  
make moral distinctions with the eyes and brain given us. Religion is  
as much responsibility as direction: Duty not Distinction.





PGP.sig
Description: This is a digitally signed message part


Re: IndexOutOfBoundsException Help

2007-05-04 Thread Eric Vought




This error does not appear to happen against the latest SVN checkout.  
It looks like several changes have been made to the way page breaks  
are handled in PageBreakingAlgorithm.java, particularly handling of  
footnotes in PageBreakingAlgorithm.computeDemerits(), so it may have  
gone away permanently. I'll see if it comes back. Thanks.


OK, am still getting this exception intermittently, it is unstable  
and I still cannot pin it down to particular input, but a full  
stack trace:


May 3, 2007 10:04:57 PM org.apache.fop.cli.Main startFOP
SEVERE: Exception
java.lang.IndexOutOfBoundsException: Index: 23, Size: 18
at org.apache.fop.cli.InputHandler.transformTo 
(InputHandler.java:168)
at org.apache.fop.cli.InputHandler.renderTo 
(InputHandler.java:115)

at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:191)


snipped

Sincerely,

Eric Vought

[This president is] so stubborn that were he captain of the Titanic,  
he would have run the ship into a second iceberg to prove he meant to  
hit the first one. -- Rogers Cadenhead





PGP.sig
Description: This is a digitally signed message part


Re: IndexOutOfBoundsException Help

2007-05-03 Thread Eric Vought
OK, am still getting this exception intermittently, it is unstable  
and I still cannot pin it down to particular input, but a full stack  
trace:


May 3, 2007 10:04:57 PM org.apache.fop.cli.Main startFOP
SEVERE: Exception
java.lang.IndexOutOfBoundsException: Index: 23, Size: 18
at org.apache.fop.cli.InputHandler.transformTo 
(InputHandler.java:168)
at org.apache.fop.cli.InputHandler.renderTo 
(InputHandler.java:115)

at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:191)

-

java.lang.IndexOutOfBoundsException: Index: 23, Size: 18
at java.util.ArrayList.RangeCheck(ArrayList.java:546)
at java.util.ArrayList.get(ArrayList.java:321)
at  
org.apache.fop.layoutmgr.PageBreakingAlgorithm.computeDemerits 
(PageBreakingAlgorithm.java:644)
at  
org.apache.fop.layoutmgr.BreakingAlgorithm.considerLegalBreak 
(BreakingAlgorithm.java:726)
at  
org.apache.fop.layoutmgr.PageBreakingAlgorithm.considerLegalBreak 
(PageBreakingAlgorithm.java:309)
at  
org.apache.fop.layoutmgr.BreakingAlgorithm.findBreakingPoints 
(BreakingAlgorithm.java:485)
at  
org.apache.fop.layoutmgr.BreakingAlgorithm.findBreakingPoints 
(BreakingAlgorithm.java:403)
at org.apache.fop.layoutmgr.AbstractBreaker.doLayout 
(AbstractBreaker.java:338)
at org.apache.fop.layoutmgr.AbstractBreaker.doLayout 
(AbstractBreaker.java:263)
at  
org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout 
(PageSequenceLayoutManager.java:157)
at org.apache.fop.area.AreaTreeHandler.endPageSequence 
(AreaTreeHandler.java:385)
at org.apache.fop.fo.pagination.PageSequence.endOfNode 
(PageSequence.java:148)
at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement 
(FOTreeBuilder.java:378)
at org.apache.fop.fo.FOTreeBuilder.endElement 
(FOTreeBuilder.java:194)
at  
org.apache.xalan.transformer.TransformerIdentityImpl.endElement 
(TransformerIdentityImpl.java:1101)
at org.apache.xerces.parsers.AbstractSAXParser.endElement 
(Unknown Source)
at  
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement 
(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl 
$FragmentContentDispatcher.dispatch(Unknown Source)
at  
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument 
(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse 
(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse 
(Unknown Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown  
Source)
at  
org.apache.xalan.transformer.TransformerIdentityImpl.transform 
(TransformerIdentityImpl.java:484)
at org.apache.fop.cli.InputHandler.transformTo 
(InputHandler.java:165)
at org.apache.fop.cli.InputHandler.renderTo 
(InputHandler.java:115)

at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:191)

It seems to happen a lot more often when footnotes get moved (I have  
my XSLT-FO transform set to turn links into footnotes), but the same  
footnote can be fine in one place and cause the crash in a different  
page. I have occasional warnings about paragraph overflows which come  
and go independent of the crash. The values in the range check are  
not consistent. The size seems to range from 21-23 and the index from  
12-18 lately. I originally got an index of 14 and a size of 12.


Is there a way I can tell what page FOP was processing just prior to  
the crash or otherwise get an idea of what markup is directly involved?


Sincerely,

Eric Vought

Three passions, simple but overwhelmingly strong, have governed my  
life: the longing for love, the search for knowledge, and the  
unbearable pity for the suffering of mankind.


---Bertrand Russell





PGP.sig
Description: This is a digitally signed message part


Re: IndexOutOfBoundsException Help

2007-04-16 Thread Eric Vought


Hugues Leonardi wrote:



I don't know if I can help you, but when you build your xsl-fo  
file, does

your xsl stylesheet have this line:
xsl:output method=xml indent=yes/ ?
Sometimes, if indent=yes, FOP produce this kind of error. Then,  
to fix

it, I built a xsl-fo file not indented with indent=no


No, it is not set, which also makes the fo output fun to read.

The error no longer occurs in my HEAD version, so I will take some  
time in the next couple of days to check an older copy back out and  
see if I can get some good stack traces and other information. The  
changes I made before it went away involved changing inline links  
(ulinks in docbook, URLs rendered in footnotes) to bibliography  
citations, but since this just moved the links to the back of the  
document, I don't see how it made a difference.


Perhaps, this tip will help you.




Eric Vought wrote:


I have a relatively large (~40 page) DocBook document I am converting
to FO using the XSL 1.72.0  stylesheets and then using FOP 0.93 to
produce PDF on Mac OS X with JDK 1.5.0. Suddenly, my build is failing
due to a FOP exception and I am having a hell of a time isolating
the specific fo input causing it.

I am getting the following errors:

   [fop] Apr 9, 2007 5:11:09 PM org.apache.fop.cli.InputHandler
error
   [fop] SEVERE: javax.xml.transform.TransformerException: Index:
14, Size: 12

javax.xml.transform.TransformerException:
java.lang.IndexOutOfBoundsException: Index: 14, Size: 12

I also have a warning:

[fop] WARNING: Line 1 of a paragraph overflows the available area.
(fo:block, location: 731/-1)

which I have had for days to no ill effect.

The various documents (the DocBook 4.5 input, the fo input to Fop)
all validate. I have no problem producing HTML from the same source.
I was able to produce PDF yesterday and added a large amount of
content in between. I build html most of the time and check the PDF
only periodically. I spent several hours commenting out parts of the
new content in the DocBook source to see what triggered the error.

I narrowed it down to one paragraph and the end of a line, no markup,
just text; it looked like FOP might have had trouble finding a good
point to break the line. This is not, however, at line 731 of the .fo
output (from the warning) or anywhere near it.

OK, now for the screwy part. I started removing other parts of the
document to trim it down to just the section causing the error--- and
it went away. I can remove any of several arbitrary sections of the
document (that have been there for days without issue) and the error
stops. I am having an extremely difficult time producing a small .fo
sample that causes the bug.

Any suggestions? How do I track this down?

Sincerely,

Eric Vought

There are four boxes in the defense of Liberty:
1) Soap Box
2) Ballot Box
3) Jury Box
4) Ammo Box
Use in that order.







--
View this message in context: http://www.nabble.com/ 
IndexOutOfBoundsException-Help-tf3550079.html#a10021105

Sent from the FOP - Users mailing list archive at Nabble.com.





Sincerely,

Eric Vought

Vengence is violence returned with interest compounded on sorrow.




PGP.sig
Description: This is a digitally signed message part


RE: IndexOutOfBoundsException Help

2007-04-12 Thread Eric Vought


From: Pascal Sancho [EMAIL PROTECTED]
Date: April 10, 2007 3:25:58 AM CDT
To: [EMAIL PROTECTED]
Subject: RE: IndexOutOfBoundsException Help


Hi,

Your exception seems to occur during the XSLT transformation,  
before FOP

does it job.

You should have a look on your XSLT engine.


Err.. No, this happens specifically after fop is called to process  
the .fo file. It runs in a separate process from the DocBook-FO  
transform. If you look at the error, you will see the package  
org.apache.fop. As I said, the .fo input file validates. I will see  
if I can get another fo processor to take the file for comparison,  
but even if there *is* something wrong with the input, a random crash  
is hardly the expected result.


Again, I would love to trim it to a small, reproducible error to help  
track this down, but so far I have spent hours and gotten nowhere.  
What can I do to diagnose this (get a useful stack trace, tie it to  
specific input, etc.)? I am currently running fop from an ant (1.7.0)  
task (as per the docs), but it runs in its own VM. Are there any  
properties I can send to make it dump diagnostics?




Pascal



  [fop] Apr 9, 2007 5:11:09 PM
org.apache.fop.cli.InputHandler error
  [fop] SEVERE: javax.xml.transform.TransformerException:
Index: 14, Size: 12

javax.xml.transform.TransformerException:
java.lang.IndexOutOfBoundsException: Index: 14, Size: 12



Sincerely,

Eric Vought

Vengence is violence returned with interest compounded on sorrow.




IndexOutOfBoundsException Help

2007-04-09 Thread Eric Vought
I have a relatively large (~40 page) DocBook document I am converting  
to FO using the XSL 1.72.0  stylesheets and then using FOP 0.93 to  
produce PDF on Mac OS X with JDK 1.5.0. Suddenly, my build is failing  
due to a FOP exception and I am having a hell of a time isolating

the specific fo input causing it.

I am getting the following errors:

  [fop] Apr 9, 2007 5:11:09 PM org.apache.fop.cli.InputHandler  
error
  [fop] SEVERE: javax.xml.transform.TransformerException: Index:  
14, Size: 12


javax.xml.transform.TransformerException:  
java.lang.IndexOutOfBoundsException: Index: 14, Size: 12


I also have a warning:

[fop] WARNING: Line 1 of a paragraph overflows the available area.  
(fo:block, location: 731/-1)


which I have had for days to no ill effect.

The various documents (the DocBook 4.5 input, the fo input to Fop)  
all validate. I have no problem producing HTML from the same source.  
I was able to produce PDF yesterday and added a large amount of  
content in between. I build html most of the time and check the PDF  
only periodically. I spent several hours commenting out parts of the  
new content in the DocBook source to see what triggered the error.


I narrowed it down to one paragraph and the end of a line, no markup,  
just text; it looked like FOP might have had trouble finding a good  
point to break the line. This is not, however, at line 731 of the .fo  
output (from the warning) or anywhere near it.


OK, now for the screwy part. I started removing other parts of the  
document to trim it down to just the section causing the error--- and  
it went away. I can remove any of several arbitrary sections of the  
document (that have been there for days without issue) and the error  
stops. I am having an extremely difficult time producing a small .fo  
sample that causes the bug.


Any suggestions? How do I track this down?

Sincerely,

Eric Vought

There are four boxes in the defense of Liberty:
1) Soap Box
2) Ballot Box
3) Jury Box
4) Ammo Box
Use in that order.




PGP.sig
Description: This is a digitally signed message part