Re: [css2xslfo-support] Command line for creating pdf
Brought to you by:
wdonne
From: Peter W. <wms...@gm...> - 2010-09-07 20:20:35
|
Hi Aaron, This sounds like something similar that I worked on a couple of years ago (having a Perl script on a Unix server run CLI commands to convert a web page into a PDF). What I used was: css2xslfo1_5_2.jar <input filename> -fo <output fo file> fop <input fo file> <output pdf> I think I tried css2fopnew1_5_1.jar to output directly to PDF, but it wouldn't convert everything the way I wanted it to. Things might have changed a bit since then too. I know I did get this working with the two commands above, and it converted XHTML and inline CSS (not sure about linking the CSS file). Good luck, Peter On 07-Sep-10 3:59 PM, Aaron Shumaker wrote: > (Sorry if this is a dupe, when I sent it the first time I had not > joined the mailing list yet, so I was not sure if the mailing list > would block mail from non-subscribers.) > > The only example I've seen of running css2xslfo with fop is: > > java -jar css2fopnew.jar url_or_filename<options> > > So based on that I placed AppViewer.htm in the same directory and ran this: > > java -jar css2fopnew1_6_2 .jar AppViewer.htm > > And it gave an error indicating no output file specified. I then tried this: > > java -jar css2fopnew1_6_2.jar AppViewer.htm -pdf Test.pdf > > and it does nothing but print the help for the command line with no > errors. So I am not understanding something here. I want to produce > a pdf for the given html file(which is xhtml compliant, is that the > same as being xhtml?). > > My hope was that this command would produce a pdf file. Can anyone > advise me what I'm doing wrong? > > Thanks in advance. > > Here are details/versions for anyone that wants this information: > Long story is that I'm essentially trying to piece together a way for > a server side asp.net app to call this command line and produce a PDF > version of the page to serve to a user for printing. I want the PDF > to appear as close as possible to how it appears in a browser. > > I would also like a css file to be used as well for styling(but does > not replace the user agent CSS). The html file contains a tag with: > link rel="Stylesheet" type="text/css" href="UacApplicationControls.css" > > and the css file is in the same directory as the htm file. Will > css2fop use this tag and apply the styles from that CSS file? I saw > some documentation showing the correct syntax that it recognizes for a > stylesheet link, but now that I am trying to verify I cannot find it. > > I actually just dropped the css2xslfo jar files, and the fop jar file > into fop's library directory. So that all jar's are in the same > directory, and the htm and css files are as well. This way I didn't > have to muck with an environment settings for now since I'm just > testing to see if this tool is a viable solution. It seems to be > finding everything just find. > > I am on Windows XP, installed the JRE 6 update 21, and using FOP 1.0. > > ------------------------------------------------------------------------------ > This SF.net Dev2Dev email is sponsored by: > > Show off your parallel programming skills. > Enter the Intel(R) Threading Challenge 2010. > http://p.sf.net/sfu/intel-thread-sfd > _______________________________________________ > css2xslfo-support mailing list > css...@li... > https://lists.sourceforge.net/lists/listinfo/css2xslfo-support > |