private void addMetaData(Document document) {
   document.addTitle("Expense Report");
   document.addSubject("Expense Report");
   document.addKeywords("Java, PDF, iText");
   document.addAuthor("www.Ihalkhata.com");
   document.addCreator("www.Ihalkhata.com");
 }
Ejemplo n.º 2
0
 private static void addMetaData(Document document) {
   document.addTitle("Report Eventi");
   document.addSubject("Report Eventi selezionati nella console Govpay");
   document.addKeywords("Report, Eventi, Govpay");
   document.addAuthor("Govpay");
   document.addCreator("Govpay");
 }
  public void open() throws DocumentException {
    this.document = new Document();
    // pageSize, marginLeft, marginRight, marginTop, marginBottom));

    writer = PdfWriter.getInstance(document, out);
    writer.setLinearPageMode();

    version = getVersion();
    writer.setPdfVersion(version);
    writer.setViewerPreferences(getViewerPreferences());

    final String encrypt =
        config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Encryption");

    if (encrypt != null) {
      if (encrypt.equals(PdfPageableModule.SECURITY_ENCRYPTION_128BIT) == true
          || encrypt.equals(PdfPageableModule.SECURITY_ENCRYPTION_40BIT) == true) {
        final String userpassword =
            config.getConfigProperty(
                "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.UserPassword");
        final String ownerpassword =
            config.getConfigProperty(
                "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.OwnerPassword");
        // Log.debug ("UserPassword: "******" - OwnerPassword: "******"org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Title",
            config.getConfigProperty("org.pentaho.reporting.engine.classic.core.metadata.Title"));
    final String subject =
        config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Description",
            config.getConfigProperty(
                "org.pentaho.reporting.engine.classic.core.metadata.Description"));
    final String author =
        config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Author",
            config.getConfigProperty("org.pentaho.reporting.engine.classic.core.metadata.Author"));
    final String keyWords =
        config.getConfigProperty(
            "org.pentaho.reporting.engine.classic.core.modules.output.pageable.pdf.Keywords",
            config.getConfigProperty(
                "org.pentaho.reporting.engine.classic.core.metadata.Keywords"));

    if (title != null) {
      document.addTitle(title);
    }
    if (author != null) {
      document.addAuthor(author);
    }
    if (keyWords != null) {
      document.addKeywords(keyWords);
    }
    if (keyWords != null) {
      document.addSubject(subject);
    }

    document.addCreator(PdfDocumentWriter.CREATOR);
    document.addCreationDate();

    // getDocument().open();
    awaitOpenDocument = true;
  }