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);
...