Re: [css2xslfo-support] embedding css2xslfo w/ fopnew
Brought to you by:
wdonne
From: Brad C. <bk...@mu...> - 2008-06-05 22:24:24
|
Werner Donné wrote: > Hi Brad, > > The CSSToFOPNew class also has convert() variants that do what > you want. However, there is no javadoc about that yet. I should > include it in the next release. For the archives, using the excellent JinSitu, I was able to noodle this out: from be.re.css import CSSToFOPNew from java.net import URL from java.io import File, FileInputStream, FileOutputStream from java.util import HashMap input_file_path = '/tmp/t/x.html' baseUrl = URL('file://'+input_file_path) input_file = FileInputStream(input_file_path) output_file = FileOutputStream('/tmp/fop.pdf') catalog = URL('file://'+'/home/bkc/dtd/xhtml1-20020801/catalog') agentSheet = None parameters = HashMap() preprocessors = [] format = 'application/pdf' configFile = File('/home/bkc/apps/css2xslfo/bar.conf.xml') validate = False try: CSSToFOPNew.convert(input_file, output_file, baseUrl, agentSheet, catalog, parameters, preprocessors, format, configFile, validate) finally: input_file.close() output_file.close() the conversion seems very fast.. less than 1/10 second for a 1 page document. I can't believe that, but will continue to convert my server app from Python to Jython. Are there any threading issues I need to be aware of? Thanks -- Brad Clements, bk...@mu... (315)268-1000 http://www.murkworks.com AOL-IM: BKClements |