May I suggest using FOP in ANT. The following should work. ANT is an easy install and can be called from within Java also.
<fop format="application/pdf" outdir="outputDIR" messagelevel="info" userconfig="configFile" force="true"> <fileset dir="dirOfFOFilesToPArse"> <include name="*.fo" /> </fileset> </fop> Marijan (Mario) Madunic Publishing Specialist New Flyer Industries -----Original Message----- From: Eric Douglas [mailto:[email protected]] Sent: Monday, July 19, 2010 2:49 PM To: [email protected] Subject: RE: Can Fop handle mutiple input files and name output files dynamically ? Yes, that's also illegal. A file name cannot contain any of these characters: /\:*?"<>| "12:35" won't work either. If you want to use timestamps, you'll have to convert the date/time. And as J.Pietschmann mentioned, FOP is only setup to process one xml file into one PDF, so you'll need a Java program or a script of some sort to loop through all the files. -----Original Message----- From: soph [mailto:[email protected]] Sent: Monday, July 19, 2010 3:43 PM To: [email protected] Subject: RE: Can Fop handle mutiple input files and name output files dynamically ? Thanks Eric, I remove the %date% part from my command line. so, the cmd looks like: "Fop -xml *.xml -xsl StylesheetName.xsl -pdf outputFile-at_%time%.pdf" Then I got a different error "java.io.FileNotFoundException: outputFile-at_12:35:35.19.pdf <The parameter is incorrect> " so strange, why FOP is looking for this file? I think it is supposed to be the generated file. Eric Douglas wrote: > > The problem would be your date. "07/09/2010" cannot be part of a file > name.. > > -----Original Message----- > From: soph [mailto:[email protected]] > Sent: Monday, July 19, 2010 3:22 PM > To: [email protected] > Subject: Can Fop handle mutiple input files and name output files > dynamically ? > > > I am converting all xml files in an "incoming file folder" to PDF > files by FOP. The xml files are delivered from other applications, so > I don't know the names of the xml. I want to name the out put pdf file > as outputFile-TimeStamp.pdf > > I tried to use "Fop -xml *.xml -xsl StylesheetName.xsl -pdf > outputFile-%date%_at_%time%.pdf" , but got > ---------- > SEVERE: Exception > org.apache.fop.apps.FOPException: Don't know what to do with > 07/09/2010_at_11:48:04.50.pdf > ---------- > > Anybody know what's the problem of my command line? how to handle > mutiple inputs? > > If it is impossible to name it as TimeStamp, is there a way to name > the output pdf file the same name as the input xml? > > Thanks!! > -- > View this message in context: > http://old.nabble.com/Can-Fop-handle-mutiple-input-files-and-name-outp > ut -files-dynamically---tp29208251p29208251.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > 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] > > > -- View this message in context: http://old.nabble.com/Can-Fop-handle-mutiple-input-files-and-name-output -files-dynamically---tp29208251p29208420.html Sent from the FOP - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- 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] -------------------------------------------------------------------- Please consider the environment before printing this e-mail. CONFIDENTIALITY STATEMENT: This communication (and any and all information or material transmitted with this communication) is confidential, may be privileged and is intended only for the use of the intended recipient. If you are not the intended recipient, any review, retransmission, circulation, distribution, reproduction, conversion to hard copy, copying or other use of this communication, information or material is strictly prohibited and may be illegal. If you received this communication in error or if it is forwarded to you without the express authorization of New Flyer, please notify us immediately by telephone or by return email and permanently delete the communication, information and material from any computer, disk drive, diskette or other storage device or media. Thank you. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
