Re: [css2xslfo-support] embedding css2xslfo w/ fopnew
Brought to you by:
wdonne
|
From: Werner D. <wer...@re...> - 2008-06-06 07:09:20
|
Hi Brad, I'm glad it worked out. Regarding threading, there is no global state, so you can use multiple instances of the CSSToXSLFO filter in different threads. The same instance can't be used in multiple threads, because the streaming-oriented filters inside have state. Best regards, Werner. On 06 Jun 2008, at 00:24, Brad Clements wrote: > 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 > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://sourceforge.net/services/buy/index.php > _______________________________________________ > css2xslfo-support mailing list > css...@li... > https://lists.sourceforge.net/lists/listinfo/css2xslfo-support -- Werner Donné -- Re http://www.pincette.biz Engelbeekstraat 8 http://www.re.be BE-3300 Tienen tel: (+32) 486 425803 e-mail: wer...@re... |