Re: How to put batch process into background on Mac OS
A little over a month ago I switched from running fop using a shell script to using ant, as per Eric Vought's suggestion copied below. Today I ran into a strange file-naming issue. I am processing multiple files based on state and grade level. The PDFs will eventually end up on a Web site. I asked the Web master how she wanted the files named. She gave me this format (this would be for Illinois grade 3 file): il_rex_corr_3.pdf I converted my xml to fo using xsl:result-document so as to output fo files. So the above fo file was output as-- il_rex_corr_3.fo I ran my ant process against the folder of grade 3 fo files with no hitch. When I went to run the grade 4 files, I received this error: $ /Applications/apache-ant-1.7.0/bin/ant Buildfile: build.xml make_pdf: [fop] /Users/home/Active_Documents/00Standards_Based_Kits/ Correlation_Confabulators/G4Finalxml/fo_files/.fo - /Users/home/ Active_Documents/00Standards_Based_Kits/Correlation_Confabulators/ G4Finalxml/pdf_files/.pdf [fop] [Fatal Error] :-1:-1: Premature end of file. [fop] Feb 22, 2008 10:56:05 AM org.apache.fop.cli.InputHandler error [fop] SEVERE: javax.xml.transform.TransformerException: Premature end of file. BUILD FAILED /Users/home/Active_Documents/00Standards_Based_Kits/ Correlation_Confabulators/G4Finalxml/build.xml:25: javax.xml.transform.TransformerException: org.xml.sax.SAXParseException: Premature end of file. There were two differences between the grade 3 and grade 4 runs. a) they were launched from different directories, and b) the file names were numbered differently: '4' in place of the '3' (il_rex_corr_4.fo) I finally got the ant/fop process to run by adding a '4' to the include line in the build.xml: old build: target name=make_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 New build: target name=make_pdf description=Generates multiple PDF files fop format=application/pdf outdir=${build.dir} messagelevel=debug fileset dir=${source.dir} include name=*4.fo/ /fileset /fop /target I wonder: a) Is it not such a good idea to end a basefile name with a number? b) Is there some sort of cache memory in either ant or fop that refused to see the 4 in place of the 3? ?? 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
Re: How to put batch process into background on Mac OS
-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]
Re: How to put batch process into background on Mac OS
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: How to put batch process into background on Mac OS
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]
How to put batch process into background on Mac OS
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 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to put batch process into background on Mac OS
Use 'nice' to run it. Alter the script so that the fop execution looks like: nice /Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/$state.pdf You can check the man page for nice for more info. Steve On Thu, 3 Jan 2008, Terry Ofner wrote: 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 - 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: How to put batch process into background on Mac OS
nice does not seem to change the outcome. It only changes the priority of the process. When it runs, it still places fop in the foreground. Here is what I have tried: nice /Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/$state.pdf nice -n 20 /Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/ $state.pdf I have also added at the command line: ./createPDF.sh Any other options? On Jan 3, 2008, at 11:36 AM, Steve Quirk wrote: Use 'nice' to run it. Alter the script so that the fop execution looks like: nice /Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/$state.pdf You can check the man page for nice for more info. Steve On Thu, 3 Jan 2008, Terry Ofner wrote: 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 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: fop-users- [EMAIL PROTECTED] - 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: How to put batch process into background on Mac OS
Actually that probably won't do what you want. Adding - Djava.awt.headless=true to the vm arguments in the fop script probably will work. On Jan 3, 2008, at 8:36 AM, Steve Quirk [EMAIL PROTECTED] wrote: Use 'nice' to run it. Alter the script so that the fop execution looks like: nice /Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/$state.pdf You can check the man page for nice for more info. Steve On Thu, 3 Jan 2008, Terry Ofner wrote: 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 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: fop-users- [EMAIL PROTECTED] - 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: How to put batch process into background on Mac OS
James, Your suggestion works. I have no idea where the vm arguments are in the fop script. So I changed my script to invoke the jar directly, adding the headless argument. I had to move all the jar files in fop/ lib to the build directory to get this to work: java -Djava.awt.headless=true -jar /Applications/fop-0.94/build/ fop.jar -fo $foo -pdf ../pdf_files/$state.pdf Thanks for the tip. Terry On Jan 3, 2008, at 12:35 PM, James Howard wrote: Actually that probably won't do what you want. Adding - Djava.awt.headless=true to the vm arguments in the fop script probably will work. On Jan 3, 2008, at 8:36 AM, Steve Quirk [EMAIL PROTECTED] wrote: Use 'nice' to run it. Alter the script so that the fop execution looks like: nice /Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/$state.pdf You can check the man page for nice for more info. Steve On Thu, 3 Jan 2008, Terry Ofner wrote: 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 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: fop-users- [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: fop-users- [EMAIL PROTECTED] - 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: How to put batch process into background on Mac OS
I had looked at the fop script I had and saw it there. I wasn't sure that I had made the change or not. In any case, if it's helpful, it should look like: fop_exec_command=exec \$JAVACMD\ ${ENDORSED} -Djava.awt.headless=true $LOGCHOICE $LOGLEVEL -classpath \$LOCALCLASSPATH\ $FOP_OPTS org.apache.fop.cli.Main $fop_exec_args (I'm using 0.93, so it might be slightly different). That should avoid any icons or desktop interaction. steve On Thu, 3 Jan 2008, James Howard wrote: Actually that probably won't do what you want. Adding -Djava.awt.headless=true to the vm arguments in the fop script probably will work. On Jan 3, 2008, at 8:36 AM, Steve Quirk [EMAIL PROTECTED] wrote: Use 'nice' to run it. Alter the script so that the fop execution looks like: nice /Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/$state.pdf You can check the man page for nice for more info. Steve On Thu, 3 Jan 2008, Terry Ofner wrote: 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 - 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] - 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: How to put batch process into background on Mac OS
Steve, Yep. That works too. On 0.94 the fop_exec_command is near the bottom of the fop script and looks like this: fop_exec_command=exec \$JAVACMD\ -Djava.awt.headless=true $LOGCHOICE $LOGLEVEL -classpath \$LOCALCLASSPATH\ $FOP_OPTS org.apache.fop.cli.Main $fop_exec_args Note: The -Djava.awt.headless=true was originally missing. The only problem with changing the fop script is that it will only impact my installation. If I ever pass this process off to someone else (or update my version of fop), I will have to remember to change the exec command. I suppose that I would have to mess with something either way. (I would have to move all the jar files to the build directory.) Either way, all is well now. Thanks. Terry On Jan 3, 2008, at 1:14 PM, Steve Quirk wrote: I had looked at the fop script I had and saw it there. I wasn't sure that I had made the change or not. In any case, if it's helpful, it should look like: fop_exec_command=exec \$JAVACMD\ ${ENDORSED} - Djava.awt.headless=true $LOGCHOICE $LOGLEVEL -classpath \$LOCALCLASSPATH\ $FOP_OPTS org.apache.fop.cli.Main $fop_exec_args (I'm using 0.93, so it might be slightly different). That should avoid any icons or desktop interaction. steve On Thu, 3 Jan 2008, James Howard wrote: Actually that probably won't do what you want. Adding - Djava.awt.headless=true to the vm arguments in the fop script probably will work. On Jan 3, 2008, at 8:36 AM, Steve Quirk [EMAIL PROTECTED] wrote: Use 'nice' to run it. Alter the script so that the fop execution looks like: nice /Applications/fop-0.94/fop -fo $foo -pdf ../pdf_files/ $state.pdf You can check the man page for nice for more info. Steve On Thu, 3 Jan 2008, Terry Ofner wrote: 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 --- -- To unsubscribe, e-mail: fop-users- [EMAIL PROTECTED] For additional commands, e-mail: fop-users- [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: fop-users- [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: fop-users- [EMAIL PROTECTED] - 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]
How to put batch process into background on Mac OS
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