Thanks Medhi! Worked like a charm! Kind Regards, Jonathan
From: mehdi houshmand [mailto:[email protected]] Sent: Wednesday, May 09, 2012 4:17 AM To: [email protected] Subject: Re: Setting encryption options on foUserAgent Hi Jonathan, You can get the render options ("FOUserAgent.getRenderOptions()") and set the encryption parameters by putting an instance of o.a.f.pdf.PDFEncryptionParams in there as such: userAgent.put("encryption-params", new PDFEncryptionParams(....)); I appreciate none of this is very obvious, but you can see how it's done when FOP is invoked via CLI in org.apache.fop.cli.CommandLineOptions (look at and around getPDFEncryptionParams()) Hope that helps Mehdi On 8 May 2012 20:53, Jonathan Levinson <[email protected]<mailto:[email protected]>> wrote: Hi, I have written a FOP server that is multithreaded and gets it input over TCP/IP. I'm trying to figure out how to set encryption options on an instance of FOUserAgent. I believe I know how to set up a configuration file AND create a FopFactory from that configuration file but this won't work in my multithreading configuration because there will be race conditions and it will be slow. I'm sending different encryption options over TCP/IP and I want individual FOUserAgents to reflect those encryption options. If I create a new FOP factory on every FOUserAgent it will slow the code down considerably, and because the configuration file is being changed for all users of the FOP factory, an FOUserAgent could inadvertently get the configuration of another FOUserAgent. Is there an API that allows one to set the encryption options on an instance of FOUserAgent? Thanks in advance for all your help! Kind Regards, Jonathan
