Table of contents
Namespace: Com\Tecnick\Pdf
abstract class Output extends MetaInfo
Extends: MetaInfo
Source: src/Output.php:117
Output PDF data
Methods
downloadPDF()
Trigger the browser Download dialog to download the PDF document.
public downloadPDF(string $rawpdf = ''): void
Parameters:
$rawpdf(string): Raw PDF data string from getOutPDFString().
Throws:
Throwable
Source: src/Output.php:6339
getMIMEAttachmentPDF()
Returns the PDF as base64 mime multi-part email attachment (RFC 2045).
public getMIMEAttachmentPDF(string $rawpdf = ''): string
Parameters:
$rawpdf(string): Raw PDF data string from getOutPDFString().
Returns: string: Email attachment as raw string.
Source: src/Output.php:6443
getOutPDFString()
Returns the RAW PDF string.
public getOutPDFString(): string
Returns: string: PDF document content.
Throws:
Source: src/Output.php:395
renderPDF()
Render the PDF in the browser or output the RAW data in the CLI.
public renderPDF(string $rawpdf = ''): void
Parameters:
$rawpdf(string): Raw PDF data string from getOutPDFString().
Throws:
Throwable
Source: src/Output.php:6300
savePDF()
Save the PDF document to a local file.
The file is written in the $path directory with the base name returned by getPDFFilename().
public savePDF(string $path = '', string $rawpdf = ''): void
Parameters:
$path(string): Path to the output directory.$rawpdf(string): Raw PDF data string from getOutPDFString().
Throws:
Throwable
Source: src/Output.php:6422
Inherited members
From Base
- BORDERPOS_DEFAULT: The default relative position of the cell origin when the border is centered on the cell edge.
- BORDERPOS_EXTERNAL: The relative position of the cell origin when the border is external to the cell edge.
- BORDERPOS_INTERNAL: The relative position of the cell origin when the border is internal to the cell edge.
- ZEROCELL: Default values for cell.
- ZEROCELLBOUND: Default values for cell boundaries.
- $barcode: Barcode object.
- $cache: Cache object.
- $color: Color object.
- $encrypt: Encrypt object.
- $file: File object.
- $font: Font object.
- $graph: Graph object.
- $image: Image Import object.
- $markupFile: File object for markup-originated resources.
- $page: Page object.
- $pon: Current PDF object number.
- $uniconv: Unicode Convert object.
- defaultFileAllowedPaths(): Returns the default array of allowed file paths.
- defaultMarkupAllowedPaths(): Returns the default array of allowed file paths for markup-originated resources.
- enableDefaultPageContent(): Enable or disable the default page content.
- getWarnings(): Return the conformance warnings raised while the document was rendered.
- initClassObjects(): Initialize dependencies class objects.
- setPDFVersion(): Set the PDF version (check PDF reference for valid values).
- setRTL(): Set the default document language direction.
- toPoints(): Convert user units to internal points unit.
- toUnit(): Convert internal points to user unit.
- toYPoints(): Convert vertical user value to internal points unit.
- toYUnit(): Convert vertical internal points value to user unit.
From Cell
- setDefaultCellBorderPos(): Sets the default cell border position.
- setDefaultCellMargin(): Set the default cell margin in user units.
- setDefaultCellPadding(): Set the default cell padding in user units.
From CSS
- addGlobalCSS(): Append CSS content to the global CSS applied as a base stylesheet to all HTML rendering calls.
- resetGlobalCSS(): Reset (clear) the global CSS so no base stylesheet is applied to HTML rendering calls.
- setDefaultCSSBorderSpacing(): Set the default CSS border spacing in user units.
- setDefaultCSSMargin(): Set the default CSS margin in user units.
- setDefaultCSSPadding(): Set the default CSS padding in user units.
- setGlobalCSS(): Set the global CSS content applied as a base stylesheet to all HTML rendering calls.
From HTML
- addHTMLCell(): Adds an HTML block inside a rectangular cell.
- getHTMLCell(): Returns the PDF code to render an HTML block inside a rectangular cell.
- getHTMLDOMCSSData(): Returns the styles array that apply for the selected HTML tag.
- isValidCSSSelectorForTag(): Returns true if the CSS selector is valid for the selected HTML tag.
- parseHTMLAttributes(): Parst HTML DOM attributes.
- parseHTMLStyleAttributes(): Parse HTML DOM Style attributes.
- setHtmlImageImportResize(): Enable or disable HTML raster image downscaling on import.
- setHTMLMonospaceFont(): Set the monospaced font used for <pre>, <code> and <tt> elements.
- setHtmlVSpace(): Set custom vertical spacing for HTML block tags.
- setULLIDot(): Sets the default symbol to be used as unordered-list (UL) list-item (LI) bullet.
- strTrim(): Trim the input string.
- strTrimLeft(): Left trim the input string.
- strTrimRight(): Right trim the input string.
- tidyHTML(): Cleanup HTML code (requires HTML Tidy library).
From JavaScript
- addContentAsEmbeddedFile(): Add string content as an embedded file.
- addEmbeddedFile(): Add an embedded file.
- addFFButton(): Adds an annotation button form field.
- addFFCheckBox(): Adds an annotation checkbox form field.
- addFFComboBox(): Adds an annotation combobox (select) form field.
- addFFListBox(): Adds an annotation listbox (select) form field.
- addFFRadioButton(): Adds an annotation radiobutton form field.
- addFFText(): Adds an annotation text form field.
- addInternalLink(): Defines the page and vertical position an internal link points to.
- addJSButton(): Adds a JavaScript button form field.
- addJSCheckBox(): Adds a JavaScript checkbox form field.
- addJSComboBox(): Adds a JavaScript combobox (select) form field.
- addJSListBox(): Adds a JavaScript listbox (select) form field.
- addJSRadioButton(): Adds a JavaScript radiobutton form field.
- addJSText(): Adds a JavaScript text form field.
- addRawJavaScriptObj(): Add a raw javascript string as new object.
- addXObjectContent(): Add the specified raw PDF content to the XObject template.
- addXObjectExtGStateID(): Add the specified ExtGState ID to the XObject template.
- addXObjectFontID(): Add the specified Font ID to the XObject template.
- addXObjectGradientID(): Add the specified Gradient ID to the XObject template.
- addXObjectImageID(): Add the specified Image ID to the XObject template.
- addXObjectSpotColorID(): Add the specified SpotColor ID to the XObject template.
- addXObjectXObjectID(): Add the specified XObject ID to the XObject template.
- appendRawJavaScript(): Append raw javascript string to the global one.
- exitXObjectTemplate(): Exit from the XObject template mode.
- getDefJSAnnotProp(): Returns the default Javascript Annotation properties.
- getXObjectTemplate(): Returns the PDF code to render the specified XObject template.
- newXObjectTemplate(): Create a new XObject template and return the object id.
- setAnnotation(): Add an annotation and returns the object id.
- setBookmark(): Add a bookmark entry.
- setDefJSAnnotProp(): Set the default Javascript Annotation properties.
- setLink(): Creates a link in the specified area.
- setNamedDestination(): Add a named destination.
From MetaInfo
- getVersion(): Return the program version.
- setAuthor(): Defines the author of the document.
- setCreator(): Defines the creator of the document.
- setCustomXMP(): Set additional custom XMP data to be appended just before the end of the tag indicated by the key.
- setDocCreationDate(): Sets the document creation date.
- setDocModificationDate(): Sets the document modification date.
- setDocumentId(): Sets the identifier shared by all the renditions of the document.
- setFacturX(): Embed the XML payload of a hybrid electronic document (Factur-X, ZUGFeRD, Order-X) and declare it in the XMP metadata.
- setFileId(): Sets the document file identifier.
- setKeywords(): Associates keywords with the document, generally in the form ‘keyword1 keyword2 …’.
- setOutputIntent(): Set the output intent describing the intended printing condition.
- setProducerSuffix(): Sets an application identification appended to the producer string.
- setSRGB(): Set the sRGB mode.
- setSubject(): Defines the subject of the document.
- setTitle(): Defines the title of the document.
- setTrapped(): Sets the trapping status of the document.
- setViewerPreferences(): Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print.
- setXMPPaddingLines(): Sets the number of padding lines emitted before the end of the XMP packet.
From SVG
- addSVG(): Add a new SVG image and return its object ID.
- getSetSVG(): Get the PDF output string to print the specified SVG object.
From Text
- addArtifactContent(): Add non-semantic content wrapped as Artifact marked-content.
- addPage(): Add a new page (wrapper function for $this->page->add()).
- addTaggedFigureContent(): Add non-text graphical content as a tagged Figure block in PDF/UA mode.
- addTextCell(): Adds a text block inside a rectangular cell using relative coordinates.
- addTextCellXY(): Adds a text block inside a rectangular cell using absolute page coordinates.
- beginArtifact(): Open an Artifact marked-content block for non-semantic page content.
- beginStructElem(): Open a PDF/UA structure element bracket.
- defaultPageContent(): Sets the page common content like Header and Footer.
- enableZeroWidthBreakPoints(): Enable or disable automatic line breaking points after some non-letter character types.
- endArtifact(): Close an Artifact marked-content block opened by beginArtifact().
- endStructElem(): Close the current PDF/UA structure element bracket.
- getLastBBox(): Returns the last text fragment bounding box as {x, y, w, h} (left, top, width, height).
- getLastCellBBox(): Returns the last Cell bounding box as {x, y, w, h} (left, top, width, height).
- getLastTextBBox(): Returns the last Text bounding box as {x, y, w, h} (left, top, width, height).
- getTextCell(): Returns the PDF code to render a text block inside a rectangular cell.
- getTextLine(): Returns the PDF code to render a single line of text.
- loadTexHyphenPatterns(): Returns an array of hyphenation patterns.
- resumePdfUaTagging(): Resume structure tagging, restoring the mode returned by suspendPdfUaTagging().
- setCurrentPage(): Set the current page number (move to the specified page).
- setTexHyphenPatterns(): Sets the hyphen patterns for text.
- suspendPdfUaTagging(): Suspend structure tagging and marked-content recording.