MetadataStream
extends PdfStream
in package
XMP metadata stream (/Type /Metadata /Subtype /XML) — ISO 32000-2 §14.3.2, Table 339.
Thin typed wrapper around a PdfStream that sets the two required
header entries. Use packages/xmp to generate the packet bytes and
pass them here; assign the resulting indirect reference to
Catalog::$metadata, Page::$metadata, etc.
Attributes
- #[RequiresPdfVersion]
- \Phpdftk\Pdf\Core\PdfVersion::V1_4
Table of Contents
Constants
- PDF_SUBTYPE = 'XML'
- PDF_TYPE = 'Metadata'
Properties
- $data : string
- $dictionary : PdfDictionary
- $generationNumber : int
- $objectNumber : int
Methods
- __construct() : mixed
- setFilter() : void
- Set a filter to encode/decode the stream data.
- toIndirectObject() : string
- Wrap the object in an indirect object structure: X Y obj ... endobj
- toPdf() : string
- Returns the stream body: dictionary, stream keyword, data, endstream.
Constants
PDF_SUBTYPE
public
mixed
PDF_SUBTYPE
= 'XML'
PDF_TYPE
public
mixed
PDF_TYPE
= 'Metadata'
Properties
$data
public
string
$data
= ''
$dictionary
public
PdfDictionary
$dictionary
$generationNumber
public
int
$generationNumber
= 0
$objectNumber
public
int
$objectNumber
= 0
Methods
__construct()
public
__construct([string $xmpPacket = '' ]) : mixed
Parameters
- $xmpPacket : string = ''
setFilter()
Set a filter to encode/decode the stream data.
public
setFilter(FilterInterface $filter, string $pdfFilterName) : void
Parameters
- $filter : FilterInterface
-
The filter implementation
- $pdfFilterName : string
-
The PDF filter name (e.g. 'FlateDecode', 'ASCII85Decode')
toIndirectObject()
Wrap the object in an indirect object structure: X Y obj ... endobj
public
toIndirectObject() : string
Return values
stringtoPdf()
Returns the stream body: dictionary, stream keyword, data, endstream.
public
toPdf() : string
/Length is injected into the dictionary at serialization time. If a filter is set, the data is encoded before writing.