/** * Get info about the thread, or null if there is nothing. * * @return The thread information. */ public PDDocumentInformation getThreadInfo() { PDDocumentInformation retval = null; COSDictionary info = (COSDictionary)thread.getDictionaryObject( "I" ); if( info != null ) { retval = new PDDocumentInformation( info ); } return retval; }
private PDDocumentInformation createPDFDocumentInfo(String title, String creator, String subject) { LOG.info("Setting document info (title, author, subject) for merged PDF"); PDDocumentInformation documentInformation = new PDDocumentInformation(); documentInformation.setTitle(title); documentInformation.setCreator(creator); documentInformation.setSubject(subject); return documentInformation; }
/** * This will get the document info dictionary. If it doesn't exist, an empty document info * dictionary is created in the document trailer. * * @return The documents /Info dictionary, never null. */ public PDDocumentInformation getDocumentInformation() { if (documentInformation == null) { COSDictionary trailer = document.getTrailer(); COSDictionary infoDic = (COSDictionary) trailer.getDictionaryObject(COSName.INFO); if (infoDic == null) { infoDic = new COSDictionary(); trailer.setItem(COSName.INFO, infoDic); } documentInformation = new PDDocumentInformation(infoDic); } return documentInformation; }
/** * Get info about the thread, or null if there is nothing. * * @return The thread information. */ public PDDocumentInformation getThreadInfo() { PDDocumentInformation retval = null; COSDictionary info = (COSDictionary)thread.getDictionaryObject( "I" ); if( info != null ) { retval = new PDDocumentInformation( info ); } return retval; }
/** * Get info about the thread, or null if there is nothing. * * @return The thread information. */ public PDDocumentInformation getThreadInfo() { PDDocumentInformation retval = null; COSDictionary info = (COSDictionary)thread.getDictionaryObject( "I" ); if( info != null ) { retval = new PDDocumentInformation( info ); } return retval; }
private InfoDictionaryImpl getInfo() { COSDictionary trailer = this.document.getDocument().getTrailer(); COSBase infoDict = trailer.getDictionaryObject(COSName.INFO); return !(infoDict instanceof COSDictionary) ? null : new InfoDictionaryImpl(new PDDocumentInformation((COSDictionary) infoDict)); }
private PDDocumentInformation createPDFDocumentInfo(String title, String creator, String subject) { LOG.info("Setting document info (title, author, subject) for merged PDF"); PDDocumentInformation documentInformation = new PDDocumentInformation(); documentInformation.setTitle(title); documentInformation.setCreator(creator); documentInformation.setSubject(subject); return documentInformation; }
/** * This will get the document info dictionary. This is guaranteed to not return null. * * @return The documents /Info dictionary */ public PDDocumentInformation getDocumentInformation() { if (documentInformation == null) { COSDictionary trailer = document.getTrailer(); COSDictionary infoDic = (COSDictionary) trailer.getDictionaryObject(COSName.INFO); if (infoDic == null) { infoDic = new COSDictionary(); trailer.setItem(COSName.INFO, infoDic); } documentInformation = new PDDocumentInformation(infoDic); } return documentInformation; }
/** * This will get the document info dictionary. This is guaranteed to not return null. * * @return The documents /Info dictionary */ public PDDocumentInformation getDocumentInformation() { if (documentInformation == null) { COSDictionary trailer = document.getTrailer(); COSDictionary infoDic = (COSDictionary) trailer.getDictionaryObject(COSName.INFO); if (infoDic == null) { infoDic = new COSDictionary(); trailer.setItem(COSName.INFO, infoDic); } documentInformation = new PDDocumentInformation(infoDic); } return documentInformation; }
private void setDidValues(PDDocument doc) { PDDocumentInformation info = new PDDocumentInformation(); info.setCreationDate(Calendar.getInstance()); if (_producer == null) { info.setProducer("openhtmltopdf.com"); } else { info.setProducer(_producer); } for (Metadata metadata : _outputDevice.getMetadata()) { String name = metadata.getName(); if (name.isEmpty()) continue; String content = metadata.getContent(); if( content == null ) continue; if( name.equals("title")) info.setTitle(content); else if( name.equals("author")) info.setAuthor(content); else if(name.equals("subject")) info.setSubject(content); else if(name.equals("keywords")) info.setKeywords(content); else info.setCustomMetadataValue(name,content); } doc.setDocumentInformation(info); }
private void setDidValues(PDDocument doc) { PDDocumentInformation info = new PDDocumentInformation(); info.setCreationDate(Calendar.getInstance()); if (_producer == null) { info.setProducer("openhtmltopdf.com"); } else { info.setProducer(_producer); } for (Metadata metadata : _outputDevice.getMetadata()) { String name = metadata.getName(); if (name.isEmpty()) continue; String content = metadata.getContent(); if( content == null ) continue; if( name.equals("title")) info.setTitle(content); else if( name.equals("author")) info.setAuthor(content); else if(name.equals("subject")) info.setSubject(content); else if(name.equals("keywords")) info.setKeywords(content); else info.setCustomMetadataValue(name,content); } doc.setDocumentInformation(info); }
xsb.setCreateDate(GregorianCalendar.getInstance()); PDDocumentInformation pdi = new PDDocumentInformation(); pdi.setProducer(fullProducer); pdi.setAuthor(creator);