/** * Get the metadata that is part of the document catalog. This will return null if there is no * meta data for this object. * * @return The metadata for this object. */ public PDMetadata getMetadata() { COSBase metaObj = root.getDictionaryObject(COSName.METADATA); if (metaObj instanceof COSStream) { return new PDMetadata((COSStream) metaObj); } return null; }
/** * Get the metadata that is part of the document catalog. This will return null if there is * no meta data for this object. * * @return The metadata for this object. */ public PDMetadata getMetadata() { PDMetadata retval = null; COSBase base = page.getDictionaryObject(COSName.METADATA); if (base instanceof COSStream) { retval = new PDMetadata((COSStream) base); } return retval; }
retval = new PDMetadata((COSStream) mdStream);
/** * Returns the metadata associated with this XObject, or null if there is none. * @return the metadata associated with this object. */ public PDMetadata getMetadata() { COSStream cosStream = (COSStream) getCOSObject().getDictionaryObject(COSName.METADATA); if (cosStream != null) { return new PDMetadata(cosStream); } return null; }
return new PDMetadata(cosStream);
serializer.serialize(xmp, baos, true); PDMetadata metadata = new PDMetadata(doc); metadata.importXMPMetadata(baos.toByteArray()); doc.getDocumentCatalog().setMetadata(metadata);
dcSchema.setDescription( info.getSubject() ); PDMetadata metadataStream = new PDMetadata(document); catalog.setMetadata( metadataStream );
/** * Get the metadata that is part of the document catalog. This will return null if there is * no meta data for this object. * * @return The metadata for this object. */ public PDMetadata getMetadata() { PDMetadata retval = null; COSBase base = page.getDictionaryObject(COSName.METADATA); if (base instanceof COSStream) { retval = new PDMetadata((COSStream) base); } return retval; }
/** * Get the metadata that is part of the document catalog. This will return null if there is no * meta data for this object. * * @return The metadata for this object. */ public PDMetadata getMetadata() { COSBase metaObj = root.getDictionaryObject(COSName.METADATA); if (metaObj instanceof COSStream) { return new PDMetadata((COSStream) metaObj); } return null; }
/** * Get the metadata that is part of the document catalog. This will return null if there is no * meta data for this object. * * @return The metadata for this object. */ public PDMetadata getMetadata() { COSBase metaObj = root.getDictionaryObject(COSName.METADATA); if (metaObj instanceof COSStream) { return new PDMetadata((COSStream) metaObj); } return null; }
/** * Get the metadata that is part of the document catalog. This will return null if there is * no meta data for this object. * * @return The metadata for this object. */ public PDMetadata getMetadata() { PDMetadata retval = null; COSStream stream = (COSStream) page.getDictionaryObject(COSName.METADATA); if (stream != null) { retval = new PDMetadata(stream); } return retval; }
retval = new PDMetadata((COSStream) mdStream);
@Override public InputStream getMetadataStream() { if (this.profile != null) { COSBase cosBase = profile.getDictionaryObject(COSName.METADATA); if (cosBase instanceof COSStream) { return PBAdapterHelper.getMetadataStream(new PDMetadata((COSStream) cosBase)); } } return null; }
retval = new PDMetadata((COSStream) mdStream);
/** * Returns the metadata associated with this XObject, or null if there is none. * @return the metadata associated with this object. */ public PDMetadata getMetadata() { COSStream cosStream = (COSStream) getCOSObject().getDictionaryObject(COSName.METADATA); if (cosStream != null) { return new PDMetadata(cosStream); } return null; }
/** * Returns the metadata associated with this XObject, or null if there is none. * @return the metadata associated with this object. */ public PDMetadata getMetadata() { COSStream cosStream = (COSStream) getCOSObject().getDictionaryObject(COSName.METADATA); if (cosStream != null) { return new PDMetadata(cosStream); } return null; }
/** * Get XMP metadata if it is present */ private List<PDMetadata> getMetadata() { COSDictionary dictionary = (COSDictionary) this.baseObject; COSBase meta = dictionary.getDictionaryObject(COSName.METADATA); COSName type = dictionary.getCOSName(COSName.TYPE); if (meta != null && meta instanceof COSStream && type != COSName.CATALOG) { ArrayList<PDMetadata> pdMetadatas = new ArrayList<>(MAX_NUMBER_OF_ELEMENTS); org.apache.pdfbox.pdmodel.common.PDMetadata md = new org.apache.pdfbox.pdmodel.common.PDMetadata( (COSStream) meta); pdMetadatas.add(new PBoxPDMetadata(md, Boolean.FALSE, document, flavour)); return pdMetadatas; } return Collections.emptyList(); } }
@Override public InputStream getMetadataStream() { if (formXObject != null) { COSBase cosBase = formXObject.getCOSStream().getDictionaryObject(COSName.METADATA); if (cosBase instanceof COSStream) { return PBAdapterHelper.getMetadataStream(new PDMetadata((COSStream) cosBase)); } } return null; }
private MetadataImpl parseMetadata() { PDDocumentCatalog catalog = this.document.getDocumentCatalog(); PDMetadata meta = catalog.getMetadata(); if (meta == null) { try (COSStream stream = this.document.getDocument().createCOSStream()) { catalog.setMetadata(new PDMetadata(stream)); catalog.getCOSObject().setNeedToBeUpdated(true); VeraPDFMeta xmp = VeraPDFMeta.create(); return new MetadataImpl(xmp, stream); } catch (IOException excep) { // TODO Auto-generated catch block excep.printStackTrace(); } } return parseMetadata(meta); }
new XmpSerializer().serialize(xmpMetadata, xmpOutputStream, true); cosXMPStream.write(xmpOutputStream.toByteArray()); return new PDMetadata(cosStream);