Smart.Framework Logo

final class \SmartModExtLib\PdfGenerate\HtmlUrlToPdfExport
{ } ::

Class: HtmlToPdfExport - Exports HTML Code to PDF Document using WkHtmlToPdf.
This is an usafe but reach featured PDF export of HTML URL
It is based on a headless webkit
It does support full HTML5, CSS3 and Javascript.
It does support images: PNG, GIF, JPG, SVG as link or base64 embedded
It does not support HTML5 canvas


class Methods

public static function is_active ( ) {} :: ''
@return: {''} OR '/path/to/wkhtmltopdf.exe'
Check if WkHtmlToPdf exists and is set correctly
public static function generate ( STRING $y_html_url, ENUM $y_orientation = "normal", $y_timeout = 3, BOOLEAN $y_credentials = [] ) {} :: STRING
@param: {STRING} $y_html_url: The URL to the HTML Page
@param: {ENUM} $y_orientation: Page Orientation: 'normal' | 'wide'
@param: {BOOLEAN} $y_credentials: The credentials to send ; Default is empty (will send no credentials) ; To send autnetication credentials for the loaded URL you must set them explicit (as this is a very big security issue if you send credentials for non-trusted URLs) ; to explicit send credentials set this parameter as [ 'username' => 'some-username', 'password' => 'the password ...' ] ; to clear understand what is happening behind you must understand that this executable is a non-trusted headless browser so sending authentication credentials is not recommended at all, except maybe if you use this with a trusted url from a trusted environment such as internal networks
Generate a PDF Document on the fly from a piece of HTML code.
Notice: this is using a secured cache folder, unique per visitor ID

class Properties


class Constants



documentation generated on: 2023-10-19 23:15:59 +0000


Smart.Framework © 2009-2023 unix-world.org