MetadataEditor
in package
FinalYes
Read and modify PDF document metadata (Info dictionary).
Usage: $info = MetadataEditor::openString($bytes)->getAll();
MetadataEditor::open('doc.pdf') ->setTitle('My Document') ->setAuthor('Jane Doe') ->save('updated.pdf');
Table of Contents
Methods
- getAll() : MetadataInfo
- getAuthor() : string|null
- getCreationDate() : DateTimeImmutable|null
- getCreator() : string|null
- getKeywords() : string|null
- getModDate() : DateTimeImmutable|null
- getPageCount() : int
- getProducer() : string|null
- getReader() : PdfReader
- getSubject() : string|null
- getTitle() : string|null
- getTrapped() : string|null
- getVersionWarnings() : array<int, string>
- open() : self
- openString() : self
- save() : void
- setAuthor() : self
- setCreationDate() : self
- setCreator() : self
- setCustom() : self
- setKeywords() : self
- setModDate() : self
- setProducer() : self
- setSubject() : self
- setTitle() : self
- setTrapped() : self
- toBytes() : string
Methods
getAll()
public
getAll() : MetadataInfo
Return values
MetadataInfogetAuthor()
public
getAuthor() : string|null
Return values
string|nullgetCreationDate()
public
getCreationDate() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetCreator()
public
getCreator() : string|null
Return values
string|nullgetKeywords()
public
getKeywords() : string|null
Return values
string|nullgetModDate()
public
getModDate() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetPageCount()
public
getPageCount() : int
Return values
intgetProducer()
public
getProducer() : string|null
Return values
string|nullgetReader()
public
getReader() : PdfReader
Return values
PdfReadergetSubject()
public
getSubject() : string|null
Return values
string|nullgetTitle()
public
getTitle() : string|null
Return values
string|nullgetTrapped()
public
getTrapped() : string|null
Return values
string|nullgetVersionWarnings()
public
getVersionWarnings() : array<int, string>
Return values
array<int, string>open()
public
static open(string $path[, string $password = '' ]) : self
Parameters
- $path : string
- $password : string = ''
Return values
selfopenString()
public
static openString(string $pdfBytes[, string $password = '' ]) : self
Parameters
- $pdfBytes : string
- $password : string = ''
Return values
selfsave()
public
save(string $path) : void
Parameters
- $path : string
setAuthor()
public
setAuthor(string $value) : self
Parameters
- $value : string
Return values
selfsetCreationDate()
public
setCreationDate(DateTimeInterface $date) : self
Parameters
- $date : DateTimeInterface
Return values
selfsetCreator()
public
setCreator(string $value) : self
Parameters
- $value : string
Return values
selfsetCustom()
public
setCustom(string $key, string $value) : self
Parameters
- $key : string
- $value : string
Return values
selfsetKeywords()
public
setKeywords(string $value) : self
Parameters
- $value : string
Return values
selfsetModDate()
public
setModDate(DateTimeInterface $date) : self
Parameters
- $date : DateTimeInterface
Return values
selfsetProducer()
public
setProducer(string $value) : self
Parameters
- $value : string
Return values
selfsetSubject()
public
setSubject(string $value) : self
Parameters
- $value : string
Return values
selfsetTitle()
public
setTitle(string $value) : self
Parameters
- $value : string
Return values
selfsetTrapped()
public
setTrapped(string $value) : self
Parameters
- $value : string
Return values
selftoBytes()
public
toBytes() : string