i solve the problem using this alternative:

PdfReader reader = new PdfReader(getReportTemplateAsStream(reportType));
                        
                        PdfStamper stamper = new PdfStamper(reader, pdfStream);

                        AcroFields form = stamper.getAcroFields();

                        XfaForm xfa = form.getXfa();
                        
                        Document xfaXMLDoc=     xfa.getDomDocument();
                        NodeList 
nodeList=xfaXMLDoc.getElementsByTagName("field");
                        for (int i = 0; i < nodeList.getLength(); i++) {
                                org.w3c.dom.Node node = nodeList.item(i);
                                DOMXMLUtil.setAttributeValue(xfaXMLDoc, node, 
"access", "readOnly");
                        }
                        
                        
                        
                        if (xml != null && !(xml.equals(""))) {
                                InputStream is = new 
ByteArrayInputStream(xml.getBytes("iso-8859-9"));
                                xfa.fillXfaForm(is);
                        }
                
        
                        xfa.setChanged(true);

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/How-to-make-Itext-xfa-form-readOnly-tp4372984p4438467.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to