/** * Set the metadata on the PDF document * * @param doc * PDF document * @param firstName * first name of the person * @param lastName * last name of the person */ private void setDocumentMetadata(Document doc, String firstName, String lastName) { doc.addTitle(firstName + " " + lastName); doc.addSubject("Data from the eID card"); doc.addCreator("Belgian eID applet"); doc.addProducer(); doc.addCreationDate(); }
doc.addCreationDate(); doc.addSubject(request.getPage().getResource().getPath());
private void init() throws DocumentException { Resource resource = request_.getPage().getResource(); String style = resource.getProperty(CmsConstants.PROPERTY_PDFSTYLE); if (style == null) style = PdfUtils.DEFAULT_PDF_PAGESTYLE; Rectangle rec = PdfUtils.getRectangle(style); doc_ = new Document(rec, PAGEMARGIN_LEFT, PAGEMARGIN_RIGHT, PAGEMARGIN_TOP, PAGEMARGIN_BOTTOM); defaultFont_ = PdfUtils.FONT_JA_MINCHO; paragraphSpacing_ = defaultFont_.size(); if (request_.isPDFRequest()) { writer_ = PdfWriter.getInstance(doc_, baos_); String pagePath = resource.getPath(); PdfPageEvent event = new PdfCmsPageEvents(pagePath, defaultFont_, style); ((PdfWriter) writer_).setPageEvent(event); } else if (request_.isRTFRequest()) { writer_ = RtfWriter2.getInstance(doc_, baos_); } else { throw new IllegalStateException( "request type should be PDF or RTF."); } doc_.addAuthor(resource.getModificationUser()); doc_.addCreationDate(); doc_.addSubject(request_.getPage().getResource().getPath()); doc_.addCreator(CREATER_APPLICATION); doc_.open(); }
document.addCreationDate();
/** * @see org.displaytag.export.BinaryExportView#doExport(OutputStream) */ public void doExport(OutputStream out) throws JspException { try { // Initialize the table with the appropriate number of columns initTable(); // Initialize the Document and register it with PdfWriter listener and the OutputStream Document document = new Document(PageSize.A4.rotate(), 60, 60, 40, 40); document.addCreationDate(); HeaderFooter footer = new HeaderFooter(new Phrase(TagConstants.EMPTY_STRING, smallFont), true); footer.setBorder(Rectangle.NO_BORDER); footer.setAlignment(Element.ALIGN_CENTER); PdfWriter.getInstance(document, out); // Fill the virtual PDF table with the necessary data generatePDFTable(); document.open(); document.setFooter(footer); document.add(this.tablePDF); document.close(); } catch (Exception e) { throw new PdfGenerationException(e); } }
document.addCreationDate(); } catch ( Exception e ) { RTFPrinter.logger.debug( "Unable to add creation date. It will have to work without it.", e );