Examples of PDFEncryption


Examples of org.axsl.pdf.PdfEncryption

        }
        if (uPassword != null) {
            encrypt = true;
        }
        if (encrypt) {
            PdfEncryption encryption = null;
            encryption = this.getPDFDocument().createPdfEncryption();
            encryption.setOwnerPassword(oPassword);
            encryption.setUserPassword(uPassword);
            encryption.setAllowPrint(allowPrint);
            encryption.setAllowCopyContent(allowCopyContent);
            encryption.setAllowEditContent(allowEditContent);
            encryption.setAllowEditAnnotation(allowEditAnnotations);
            encryption.init();
        }
    }
View Full Code Here

Examples of org.xhtmlrenderer.pdf.PDFEncryption

      // 設定字型
      ITextFontResolver fontResolver = iTextRenderer.getFontResolver();
      fontResolver.addFont(getFontPath(), BaseFont.IDENTITY_H,
          BaseFont.NOT_EMBEDDED);

      PDFEncryption pdfEncryption = new PDFEncryption();
      // 設定加密
      if (reportData.containsKey(ReportParamEnum.encrypt.toString())) {
        String password = (String) reportData
            .get(ReportParamEnum.encrypt.toString());
        if (!CapString.isEmpty(password)) {
          pdfEncryption.setUserPassword(password.getBytes());
        }
      }
      // 設定權限
      if (getAllowedPrivileges() != -1) {
        pdfEncryption.setAllowedPrivileges(getAllowedPrivileges());
      }
      iTextRenderer.setPDFEncryption(pdfEncryption);

      iTextRenderer.setDocument(document, fileUrlPrefix
          + servletContext.getRealPath("").replace("\\", "/") + "/");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.