Created
June 14, 2012 13:01
-
-
Save lyhcode/2930137 to your computer and use it in GitHub Desktop.
PDF processing with iText
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //中文字型 | |
| BaseFont.createFont('MHei-Medium', 'UniCNS-UCS2-H', BaseFont.NOT_EMBEDDED) | |
| //檔案加密 | |
| def stamper = new PdfStamper(reader, response.outputStream) | |
| stamper.setEncryption(null, OWNER, ~(PdfWriter.ALLOW_PRINTING|PdfWriter.ALLOW_COPY|PdfWriter.ALLOW_MODIFY_CONTENTS|PdfWriter.ALLOW_MODIFY_ANNOTATIONS), PdfWriter.ENCRYPTION_AES_128 | PdfWriter.DO_NOT_ENCRYPT_METADATA) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment