Document createDocument(boolean landscape) throws DocumentException, IOException { // creation of a document-object final Rectangle pageSize = getPageSize(landscape); // marges de 20 à gauche, à droite et en haut pour bien utiliser la largeur // et avoir une meilleur lisibilité sur les tableaux larges, // mais marge de 40 en bas pour ne pas empiéter sur les numéros de pages final Document document = new Document(pageSize, 20, 20, 20, 40); final String title; if (range == null) { title = I18N.getFormattedString("Monitoring_sur", application); } else { title = I18N.getFormattedString("Monitoring_sur", application) + " - " + range.getLabel(); } createWriter(document, title); // we add some meta information to the document (after writer) document.addAuthor(application); document.addCreator( "JavaMelody par E. Vernat, https://github.com/javamelody/javamelody/wiki"); document.addTitle(title); return document; }
/** * 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(); }
document.addCreator(creator); document.addCreator(IHtmlToPdfTransformer.VERSION);
Document createDocument(boolean landscape) throws DocumentException, IOException { // creation of a document-object final Rectangle pageSize = getPageSize(landscape); // marges de 20 à gauche, à droite et en haut pour bien utiliser la largeur // et avoir une meilleur lisibilité sur les tableaux larges, // mais marge de 40 en bas pour ne pas empiéter sur les numéros de pages final Document document = new Document(pageSize, 20, 20, 20, 40); final String title; if (range == null) { title = I18N.getFormattedString("Monitoring_sur", application); } else { title = I18N.getFormattedString("Monitoring_sur", application) + " - " + range.getLabel(); } createWriter(document, title); // we add some meta information to the document (after writer) document.addAuthor(application); document.addCreator( "JavaMelody par E. Vernat, https://github.com/javamelody/javamelody/wiki"); document.addTitle(title); return document; }
/** * Opens the copier using the given reader and the given output version. * * @param reader * @param outputStream * the output stream to write to. * @param version * version for the created pdf copy, if null the version number is taken from the input {@link PdfReader} */ void open(PdfReader reader, OutputStream outputStream, PdfVersion version) throws TaskException { try { pdfDocument = new Document(reader.getPageSizeWithRotation(1)); pdfCopy = new PdfSmartCopy(pdfDocument, outputStream); if (version == null) { pdfCopy.setPdfVersion(reader.getPdfVersion()); } else { pdfCopy.setPdfVersion(version.getVersionAsCharacter()); } pdfDocument.addCreator(Sejda.CREATOR); pdfDocument.open(); } catch (DocumentException e) { throw new TaskException("An error occurred opening the PdfSmartCopy.", e); } }
protected void initMetaData(FacesContext context) { title = (String) valueBinding(context, "title", title); if (title != null) { document.addTitle(title); } subject = (String) valueBinding(context, "subject", subject); if (subject != null) { document.addSubject(subject); } keywords = (String) valueBinding(context, "keywords", keywords); if (keywords != null) { document.addKeywords(keywords); } author = (String) valueBinding(context, "author", author); if (author != null) { document.addAuthor(author); } creator = (String) valueBinding(context, "creator", creator); if (creator != null) { document.addCreator(creator); } }
document.addCreator(creator); else document.addCreator("JasperReports (" + jasperPrint.getName() + ")");
document.addCreator( PdfDocumentWriter.CREATOR ); document.addCreationDate();
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.addCreator( RTFPrinter.CREATOR );