Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Java
Expertise: Advanced
Jan 2, 2007

Obtain a Secure PDF from an FOP Processor

This tip shows you how to obtain a secure PDF from an FOP processor. This means the user can't open the PDF without a user password and, once downloaded, cannot edit, print, or copy the PDF.

//get an org.apache.fop.apps.Driver object
Driver fop=new Driver();
...
//the output will be a PDF file
fop.setRenderer(Driver.RENDER_PDF);
 
//create a java.util.Map
java.util.Map M=new java.util.HashMap();
M.put("userPassword", "airwingscrush");
M.put("allowCopyContent", "FALSE");
M.put("allowEditContent", "FALSE");
M.put("allowPrint", "FALSE");

//set the constrains
fop.getRenderer().setOptions(M);
...
Leonard Anghel
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date