Output

Output PDF data

Table of contents

Namespace: Com\Tecnick\Pdf

Extends: MetaInfo

Abstract: Yes

File: Output.php line 117

Output PDF data

Tags

  • since: 2002-08-03
  • category: Library
  • author: Nicola Asuni info@tecnick.com
  • copyright: 2002-2026 Nicola Asuni - Tecnick.com LTD
  • license: https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
  • link: https://github.com/tecnickcom/tc-lib-pdf
  • phpstan-import-type: PageData from \Com\Tecnick\Pdf\Page\Box
  • phpstan-import-type: StyleDataOpt from \Com\Tecnick\Pdf\Graph\Base
  • phpstan-import-type: TFourFloat from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TPdfUaStructElem from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotQuadPoint from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotBorderStyle from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotBorderEffect from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotMeasure from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotMarkup from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotStates from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotText from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TUriAction from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotActionDict from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotAdditionalActionDict from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotLink from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotFreeText from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotLine from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotSquare from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotCircle from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotPolygon from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotPolyline from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotTextMarkup from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotCaret from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotRubberStamp from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotInk from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotPopup from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotFileAttachment from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotSound from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotMovieDict from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotMovieActDict from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotMovie from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotIconFitDict from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotMKDict from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotScreen from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotWidget from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotFixedPrintDict from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotWatermark from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotRedact from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotOptsA from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotOptsB from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotOptsC from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotOptsD from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotOptsE from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnotOpts from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TAnnot from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TGTransparency from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TXOBject from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TPatternObject from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TSVGMaskObject from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TOutline from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TLtvConfig from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TSignature from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TSignTimeStamp from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TUserRights from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TEmbeddedFile from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TObjID from \Com\Tecnick\Pdf\Base
  • phpstan-import-type: TSignDocPrepared from \Com\Tecnick\Pdf\Base
  • SuppressWarnings: (“PHPMD”)
  • SuppressWarnings: (“PHPMD.DepthOfInheritance”)

Constants

BORDERPOS_DEFAULT

File: Base.php line 1405

public mixed BORDERPOS_DEFAULT = 0.0

BORDERPOS_EXTERNAL

File: Base.php line 1411

public mixed BORDERPOS_EXTERNAL = -0.5

BORDERPOS_INTERNAL

File: Base.php line 1417

public mixed BORDERPOS_INTERNAL = 0.5

ZEROCELL

File: Base.php line 1436

public TCellDef ZEROCELL = ['margin' => self::ZEROCELLBOUND, 'padding' => self::ZEROCELLBOUND, 'borderpos' => self::BORDERPOS_DEFAULT]

ZEROCELLBOUND

File: Base.php line 1424

public TCellBound ZEROCELLBOUND = ['T' => 0.0, 'R' => 0.0, 'B' => 0.0, 'L' => 0.0]

Properties

$author

File: MetaInfo.php line 0

public string $author

$barcode

File: Base.php line 732

public Barcode $barcode

$cache

File: Base.php line 747

public Cache $cache

$color

File: Base.php line 727

public PdfColor $color

$creator

File: MetaInfo.php line 0

public string $creator

$custom_xmp

File: MetaInfo.php line 0

public array<string, string> $custom_xmp

$docmodtime

File: MetaInfo.php line 0

public int $docmodtime

$doctime

File: MetaInfo.php line 0

public int $doctime

$encrypt

File: MetaInfo.php line 0

public Encrypt $encrypt

$file

File: Base.php line 737

public File $file

$fileid

File: MetaInfo.php line 0

public string $fileid

$font

File: Base.php line 773

public Stack $font

$graph

File: Base.php line 768

public Draw $graph

$hybriddoc

File: MetaInfo.php line 0

public THybridDoc $hybriddoc

$image

File: Base.php line 778

public Import $image

$isunicode

File: MetaInfo.php line 0

public bool $isunicode

$keywords

File: MetaInfo.php line 0

public string $keywords

$lang

File: MetaInfo.php line 0

public array<string, string> $lang

$markupFile

File: Base.php line 742

public File $markupFile

$objid

File: MetaInfo.php line 0

public array<string, mixed> $objid

$page

File: Base.php line 763

public Page $page

$pdfa

File: MetaInfo.php line 0

public int $pdfa

$pdfaConformance

File: MetaInfo.php line 0

public string $pdfaConformance

$pdfuaMode

File: MetaInfo.php line 0

public string $pdfuaMode

$pdfver

File: MetaInfo.php line 0

public string $pdfver

$pdfx

File: MetaInfo.php line 0

public bool $pdfx

$pdfxMode

File: MetaInfo.php line 0

public string $pdfxMode

$pon

File: MetaInfo.php line 0

public int $pon

$producersuffix

File: MetaInfo.php line 0

public string $producersuffix

$rtl

File: MetaInfo.php line 0

public bool $rtl

$sRGB

File: MetaInfo.php line 0

public bool $sRGB

$subject

File: MetaInfo.php line 0

public string $subject

$title

File: MetaInfo.php line 0

public string $title

$uniconv

File: Base.php line 758

public Convert $uniconv

$version

File: MetaInfo.php line 0

public string $version

$viewerpref

File: MetaInfo.php line 0

public array<string, mixed> $viewerpref

Methods

addArtifactContent()

File: Text.php line 1036

public addArtifactContent(string $content, int $pid[, string $type = '' ][, string $subtype = '' ]) : void

This is the preferred API for decorative graphics and page furniture because it writes the wrapped content directly to the selected page.

Parameters

  • $content : string: Raw PDF operators to wrap.
  • $pid : int: Page index.
  • $type : string = ‘’: Optional Artifact /Type (for example ‘Pagination’).
  • $subtype : string = ‘’: Optional Artifact /Subtype (for example ‘Header’ or ‘Footer’).

Tags

  • throws: Exception

addContentAsEmbeddedFile()

File: JavaScript.php line 772

public addContentAsEmbeddedFile(string $file, string $content[, string $mime = 'application/octet-stream' ][, string|AFRelationship $afrel = 'Source' ][, string $desc = '' ]) : void

If a file with the same name already exists, it will be ignored.

Parameters

  • $file : string: File name to be used a key for the embedded file.
  • $content : string: Content of the embedded file.
  • $mime : string = ‘application/octet-stream’: MIME type of the file (e.g., ‘application/xml’).
  • $afrel : string|AFRelationship = ‘Source’: AFRelationship value (Source, Data, Alternative, Supplement, Unspecified) or enum.
  • $desc : string = ‘’: Optional description of the file.

Tags

addEmbeddedFile()

File: JavaScript.php line 721

public addEmbeddedFile(string $file[, string $mime = 'application/octet-stream' ][, string|AFRelationship $afrel = 'Source' ][, string $desc = '' ]) : void

If a file with the same name already exists, it will be ignored.

Parameters

  • $file : string: File name (absolute or relative path).
  • $mime : string = ‘application/octet-stream’: MIME type of the file (e.g., ‘application/xml’).
  • $afrel : string|AFRelationship = ‘Source’: AFRelationship value (Source, Data, Alternative, Supplement, Unspecified) or enum.
  • $desc : string = ‘’: Optional description of the file.

Tags

addFFButton()

File: JavaScript.php line 1501

public addFFButton(string $name, float $posx, float $posy, float $width, float $height, string $caption, string|array<string, mixed> $action[, TAnnotOpts $opt = ['subtype' => 'Widget'] ][, array<string, mixed> $jsp = [] ]) : int

Parameters

  • $name : string: field name.
  • $posx : float: horizontal position in user units (LTR).
  • $posy : float: vertical position in user units (LTR).
  • $width : float: width in user units.
  • $height : float: height in user units.
  • $caption : string: caption.
  • $action : string|array<string, mixed>: action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as in section 12.7.5 of PDF32000_2008.
  • $opt : TAnnotOpts = [‘subtype’ => ‘Widget’]: Array of options (Annotation Types) - all lowercase.
  • $jsp : array<string, mixed> = []: javascript field properties (see: Javascript for Acrobat API reference).

Tags

  • throws: Exception in case of error.
  • throws: Exception
  • throws: Exception
  • throws: Exception
  • throws: Exception
  • throws: Exception
  • throws: Exception

Return values

int —

PDF Object ID.

addFFCheckBox()

File: JavaScript.php line 1662

public addFFCheckBox(string $name, float $posx, float $posy, float $width[, string $onvalue = 'Yes' ][, bool $checked = false ][, TAnnotOpts $opt = ['subtype' => 'Widget'] ][, array<string, mixed> $jsp = [] ]) : int

Parameters

  • $name : string: field name.
  • $posx : float: horizontal position in user units (LTR).
  • $posy : float: vertical position in user units (LTR).
  • $width : float: width in user units.
  • $onvalue : string = ‘Yes’: Value to be returned if selected.
  • $checked : bool = false: Define the initial state.
  • $opt : TAnnotOpts = [‘subtype’ => ‘Widget’]: Array of options (Annotation Types) - all lowercase.
  • $jsp : array<string, mixed> = []: javascript field properties (see: Javascript for Acrobat API reference).

Tags

  • throws: Exception in case of error.
  • throws: Exception
  • throws: Exception
  • throws: Exception

Return values

int —

PDF Object ID.

addFFComboBox()

File: JavaScript.php line 1739

public addFFComboBox(string $name, float $posx, float $posy, float $width, float $height, array<string|int, array{string, string}>|array<string|int, string> $values[, TAnnotOpts $opt = ['subtype' => 'Widget'] ][, array<string, mixed> $jsp = [] ]) : int

Parameters

  • $name : string: field name.
  • $posx : float: horizontal position in user units (LTR).
  • $posy : float: vertical position in user units (LTR).
  • $width : float: width in user units.
  • $height : float: height in user units.
  • $values : array<string|int, array{string, string}>|array<string|int, string>: List of selection values.
  • $opt : TAnnotOpts = [‘subtype’ => ‘Widget’]: Array of options (Annotation Types) - all lowercase.
  • $jsp : array<string, mixed> = []: javascript field properties (see: Javascript for Acrobat API reference).

Tags

  • throws: Exception in case of error.
  • throws: Exception
  • throws: Exception
  • throws: Exception
  • throws: Exception
  • throws: Exception

Return values

int —

PDF Object ID.

addFFListBox()

File: JavaScript.php line 1812

public addFFListBox(string $name, float $posx, float $posy, float $width, float $height, array<string|int, array{string, string}>|array<string|int, string> $values[, TAnnotOpts $opt = ['subtype' => 'Widget'] ][, array<string, mixed> $jsp = [] ]) : int

Parameters

  • $name : string: field name.
  • $posx : float: horizontal position in user units (LTR).
  • $posy : float: vertical position in user units (LTR).
  • $width : float: width in user units.
  • $height : float: height in user units.
  • $values : array<string|int, array{string, string}>|array<string|int, string>: List of selection values.
  • $opt : TAnnotOpts = [‘subtype’ => ‘Widget’]: Array of options (Annotation Types) - all lowercase.
  • $jsp : array<string, mixed> = []: javascript field properties (see: Javascript for Acrobat API reference).

Tags

  • throws: Exception in case of error.
  • throws: Exception
  • throws: Exception
  • throws: Exception
  • throws: Exception
  • throws: Exception

Return values

int —

PDF Object ID.

addFFRadioButton()

File: JavaScript.php line 1882

public addFFRadioButton(string $name, float $posx, float $posy, float $width[, string $onvalue = 'On' ][, bool $checked = false ][, TAnnotOpts $opt = ['subtype' => 'Widget'] ][, array<string, mixed> $jsp = [] ]) : int

Parameters

  • $name : string: field name.
  • $posx : float: horizontal position in user units (LTR).
  • $posy : float: vertical position in user units (LTR).
  • $width : float: width in user units.
  • $onvalue : string = ‘On’: Value to be returned if selected.
  • $checked : bool = false: Define the initial state.
  • $opt : TAnnotOpts = [‘subtype’ => ‘Widget’]: Array of options (Annotation Types) - all lowercase.
  • $jsp : array<string, mixed> = []: javascript field properties (see: Javascript for Acrobat API reference).

Tags

  • throws: Exception in case of error.
  • throws: Exception
  • throws: Exception
  • throws: Exception

Return values

int —

PDF Object ID.

addFFText()

File: JavaScript.php line 1982

public addFFText(string $name, float $posx, float $posy, float $width, float $height[, TAnnotOpts $opt = ['subtype' => 'text'] ][, array<string, mixed> $jsp = [] ]) : int

Parameters

  • $name : string: field name.
  • $posx : float: horizontal position in user units (LTR).
  • $posy : float: vertical position in user units (LTR).
  • $width : float: width in user units.
  • $height : float: height in user units.
  • $opt : TAnnotOpts = [‘subtype’ => ’text’]: Array of options (Annotation Types) - all lowercase.
  • $jsp : array<string, mixed> = []: javascript field properties (see: Javascript for Acrobat API reference).

Tags

  • throws: Exception in case of error.
  • throws: Exception
  • throws: Exception
  • throws: Exception
  • throws: Exception
  • throws: Exception

Return values

int —

PDF Object ID.

addGlobalCSS()

File: CSS.php line 223

public addGlobalCSS(string $css) : void

Parameters

  • $css : string: CSS content without surrounding