phpdftk API Documentation

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

getAuthor()

public getAuthor() : string|null
Return values
string|null

getCreationDate()

public getCreationDate() : DateTimeImmutable|null
Return values
DateTimeImmutable|null

getCreator()

public getCreator() : string|null
Return values
string|null

getKeywords()

public getKeywords() : string|null
Return values
string|null

getModDate()

public getModDate() : DateTimeImmutable|null
Return values
DateTimeImmutable|null

getProducer()

public getProducer() : string|null
Return values
string|null

getSubject()

public getSubject() : string|null
Return values
string|null

getTitle()

public getTitle() : string|null
Return values
string|null

getTrapped()

public getTrapped() : string|null
Return values
string|null

getVersionWarnings()

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
self

openString()

public static openString(string $pdfBytes[, string $password = '' ]) : self
Parameters
$pdfBytes : string
$password : string = ''
Return values
self

save()

public save(string $path) : void
Parameters
$path : string

setAuthor()

public setAuthor(string $value) : self
Parameters
$value : string
Return values
self

setCreationDate()

public setCreationDate(DateTimeInterface $date) : self
Parameters
$date : DateTimeInterface
Return values
self

setCreator()

public setCreator(string $value) : self
Parameters
$value : string
Return values
self

setCustom()

public setCustom(string $key, string $value) : self
Parameters
$key : string
$value : string
Return values
self

setKeywords()

public setKeywords(string $value) : self
Parameters
$value : string
Return values
self

setModDate()

public setModDate(DateTimeInterface $date) : self
Parameters
$date : DateTimeInterface
Return values
self

setProducer()

public setProducer(string $value) : self
Parameters
$value : string
Return values
self

setSubject()

public setSubject(string $value) : self
Parameters
$value : string
Return values
self

setTitle()

public setTitle(string $value) : self
Parameters
$value : string
Return values
self

setTrapped()

public setTrapped(string $value) : self
Parameters
$value : string
Return values
self

        
On this page

Search results