org.apache.fop.pdf

Class PDFMetadata

Implemented Interfaces:
PDFWritable

public class PDFMetadata
extends PDFStream

Special PDFStream for Metadata.
Since:
PDF 1.4

Field Summary

Fields inherited from class org.apache.fop.pdf.PDFStream

data

Fields inherited from class org.apache.fop.pdf.PDFObject

DATE_FORMAT, log

Constructor Summary

PDFMetadata(Metadata xmp, boolean readOnly)

Method Summary

protected String
buildStreamDict(String lengthEntry)
static Metadata
createXMPFromUserAgent(PDFDocument pdfDoc)
Creates an XMP document based on the settings on the PDF Document.
Metadata
getMetadata()
protected int
output(OutputStream stream)
overload the base object method so we don't have to copy byte arrays around so much
protected void
outputRawStreamData(OutputStream out)
protected void
setupFilterList()
static void
updateInfoFromMetadata(Metadata meta, PDFInfo info)
Updates the values in the Info object from the XMP metadata according to the rules defined in PDF/A-1 (ISO 19005-1:2005)

Methods inherited from class org.apache.fop.pdf.PDFStream

add, getDataLength, getSizeHint, output, outputRawStreamData, setData

Methods inherited from class org.apache.fop.pdf.AbstractPDFStream

buildStreamDict, encodeAndWriteStream, encodeStream, getFilterList, getSizeHint, output, outputRawStreamData, outputStreamData, prepareImplicitFilters, setupFilterList

Methods inherited from class org.apache.fop.pdf.PDFObject

encode, encodeString, encodeText, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, hasObjectNumber, makeReference, output, referencePDF, setDocument, setObjectNumber, toInlinePDFString, toPDF, toPDFString

Constructor Details

PDFMetadata

public PDFMetadata(Metadata xmp,
                   boolean readOnly)
See Also:
org.apache.fop.pdf.PDFObject.PDFObject()

Method Details

buildStreamDict

protected String buildStreamDict(String lengthEntry)
Overrides:
buildStreamDict in interface AbstractPDFStream

createXMPFromUserAgent

public static Metadata createXMPFromUserAgent(PDFDocument pdfDoc)
Creates an XMP document based on the settings on the PDF Document.
Parameters:
pdfDoc - the PDF Document
Returns:
the requested XMP metadata

getMetadata

public Metadata getMetadata()
Returns:
the XMP metadata

output

protected int output(OutputStream stream)
            throws IOException
overload the base object method so we don't have to copy byte arrays around so much
Overrides:
output in interface PDFStream

outputRawStreamData

protected void outputRawStreamData(OutputStream out)
            throws IOException
Overrides:
outputRawStreamData in interface PDFStream
See Also:
org.apache.fop.pdf.AbstractPDFStream.outputRawStreamData(java.io.OutputStream)

setupFilterList

protected void setupFilterList()
Overrides:
setupFilterList in interface AbstractPDFStream

updateInfoFromMetadata

public static void updateInfoFromMetadata(Metadata meta,
                                          PDFInfo info)
Updates the values in the Info object from the XMP metadata according to the rules defined in PDF/A-1 (ISO 19005-1:2005)
Parameters:
meta - the metadata
info - the Info object

Copyright 1999-2007 The Apache Software Foundation. All Rights Reserved.