ePages 6.11.0 - DE_EPAGES/Core/API/PdfConverter.pm

Package DE_EPAGES::Core::API::PdfConverter

This package implements the PDF converter.

@EXPORT_OK
ConvertXhtml2Pdf
IsValidXhtml
CloseHtmlTags

Functions

CloseHtmlTags
ConvertXhtml2Pdf
IsValidXhtml

CloseHtmlTags

Closes all opened, but not closed tags in the html document. $hFlags = { 'isSnippet' => 1 };

Syntax
$HtmlCode = CloseHtmlTags($HtmlCode,$hFlags);
Input
$Html (String)
html document
$hFlags (ref.hash)
isSnippet - set this true (1) if input is no real html document
(missing <htm>, <body>..)
Return
$Html (String)
html document

ConvertXhtml2Pdf

Converts a html document to a pdf document. Returns a binary pdf document or undef in case of errors. Hint: use functions 'IsValidXhtml' and 'CloseHtmlTags' if necessary!

Syntax
$PDF = ConvertXhtml2Pdf($HtmlCode);
Input
$Html (string)
html document
Return
$Pdf (undef])
pdf document | binary [pdf

IsValidXhtml

Checks if sring is a valid xhtml document. The reference is not the W3C specification, but the java class org.xhtmlrenderer.pdf.ITextRenderer, which is more permissive. $hFlags = { 'isSnippet' => 1 };

Syntax
$isValidXhtml = IsValidXhtml($HtmlCode,$hFlags);
Input
$Html (String)
html document
$hFlags (ref.hash)
isSnippet - set this true (1) if input is no real html document
(missing <html>, <body>..)
Return
$IsValid (1])
Flag showing the documents validity | integer [0