Re: Read only PDF with fop
Check out: http://xmlgraphics.apache.org/fop/0.20.5/pdfencryption.html -Lou Lukem [EMAIL PROTECTED] 05/16/2006 09:31 Please respond to fop-users@xmlgraphics.apache.org To fop-users@xmlgraphics.apache.org cc Subject Read only PDF with fop Hi. I use fop to create a pdf from xml with java. But I would like to create a read only pdf, without the possibility to copy text by the user. Is it possible with fop? If not, what can I use? thanks -- View this message in context: http://www.nabble.com/Read-only-PDF-with-fop-t1627655.html#a4409450 Sent from the FOP - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Read only PDF with fop
Thank you very much This is my code: ByteArrayOutputStream BAout = new ByteArrayOutputStream(); org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver(); driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF); driver.setOutputStream(BAout); driver.render(input.getParser(), input.getInputSource()); File outputFile = new File(filenamePDF); FileOutputStream outFileWriter = new FileOutputStream(filenamePDF); byte[] content = BAout.toByteArray(); outFileWriter.write(content); outFileWriter.flush(); outFileWriter.close(); How can I integrate with the code of the page you redirect me? thanks -- View this message in context: http://www.nabble.com/Read-only-PDF-with-fop-t1627655.html#a4410423 Sent from the FOP - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Read only PDF with fop
Have a look at the samplecode at: Usage (embedded) or here inline: Lukem wrote: Thank you very much This is my code: ByteArrayOutputStream BAout = new ByteArrayOutputStream(); org.apache.fop.apps.Driver driver = new org.apache.fop.apps.Driver(); driver.setRenderer(org.apache.fop.apps.Driver.RENDER_PDF); driver.setOutputStream(BAout); this should work: Map rendererOptions = new java.util.HashMap(); rendererOptions.put(ownerPassword, mypassword); rendererOptions.put(allowCopyContent, FALSE); rendererOptions.put(allowEditContent, FALSE); rendererOptions.put(allowPrint, FALSE); driver.getRenderer().setOptions(rendererOptions); Dirk driver.render(input.getParser(), input.getInputSource()); File outputFile = new File(filenamePDF); FileOutputStream outFileWriter = new FileOutputStream(filenamePDF); byte[] content = BAout.toByteArray(); outFileWriter.write(content); outFileWriter.flush(); outFileWriter.close(); How can I integrate with the code of the page you redirect me? thanks -- View this message in context: http://www.nabble.com/Read-only-PDF-with-fop-t1627655.html#a4410423 Sent from the FOP - Users forum 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]
Re: Read only PDF with fop
It returns a Nullpointerexception -- View this message in context: http://www.nabble.com/Read-only-PDF-with-fop-t1627655.html#a4411042 Sent from the FOP - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Read only PDF with fop
sorry, it was my mistake. this is the real error: Algorithm RC4 not available -- View this message in context: http://www.nabble.com/Read-only-PDF-with-fop-t1627655.html#a4411290 Sent from the FOP - Users forum at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Read only PDF with fop
Please read the section Environment ... at http://xmlgraphics.apache.org/fop/0.20.5/pdfencryption.html Lukem wrote: sorry, it was my mistake. this is the real error: Algorithm RC4 not available -- View this message in context: http://www.nabble.com/Read-only-PDF-with-fop-t1627655.html#a4411290 Sent from the FOP - Users forum 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]