java - Creating a non-editable pdf document using PD4ml -


i using pd4ml create pdf documents, don't want user able edit documents using ms word 2013. here have tried far

pd4ml = new pd4ml(); pd4ml.setpagesize(pd4constants.a4); pd4ml.setpageinsetsmm(new insets(topvalue, leftvalue, bottomvalue, rightvalue)); pd4ml.sethtmlwidth(userspacewidth); pd4ml.enableimgsplit(false); pd4ml.disablehyperlinks(); //some more code  pd4ml.render(arrayofurls, bytearrayoutputstream); //some more code 

then read pd4ml api documentation , added line of code pd4ml.generatepdfa(true); thought problem solved when opened document in adobe reader , saw message " file claims compliance pdf/a standard , has been opened read-only", of course still editable; suggestions on how done in pd4ml, or reference api can use add restriction generated pdf more welcomed.

tried this? if documentation way:

allowmodify  public static final int allowmodify      document access permission (bit 4, value = 8).     modify contents of document operations other controlled bits 6, 9, , 11.      see also:         pd4ml.setpermissions(string, int, boolean), constant field values 

also may want do:

pd4ml.setpermissions("", 0xffffffff ^ pd4constants.allowmodify, false); 

to disable modification.

more information here: http://pd4ml.com/cookbook/pd4ml_pdf_security.htm


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -