How to set encryption password while converting odt file to pdf in xdocreport?
I am referring to PDFWriter.setEncryption
method in iText
here.
How to set encryption password while converting odt file to pdf in xdocreport?
I am referring to PDFWriter.setEncryption
method in iText
here.
XDocReport 1.0.4 (which will soon released) provides fr.opensagres.xdocreport.itext.extension.IPdfWriterConfiguration which gives you the capability to customize the iText PDFWriter. Here a sample which set encryption :
org.odftoolkit.odfdom.converter.pdf.PdfOptions options = new PdfOptions();
options.setConfiguration( new IPdfWriterConfiguration()
{
public void configure( PdfWriter writer )
{
writer.setEncryption(...);
}
});
PdfConverter.getInstance().convert( document, out, options );
If you wish to use the converter with the report.convert method, you must do like this :
org.odftoolkit.odfdom.converter.pdf.PdfOptions pdfOptions = ...
Options options = Options.getTo(ConverterTypeTo.PDF).via(ConverterTypeVia.ODFDOM).subOptions(pdfOptions);
IXDocReport report = ...
report.convert(context, options, out);
You can find those info in the XDocReport wiki.