Using typeset.sh
Before rendering your first page, take a moment to familiarize yourself with some basic usage concepts.
Allowing external resources
$content = "Hello <strong>World</strong>";
$base = getcwd();
$cachePath = __DIR__.'/cache';
$resolveUri = \Typesetsh\UriResolver::all($cachePath, $base);
$pdf = \Typesetsh\createPdf($content, $resolveUri);
$pdf->toFile('test.pdf');// Only http(s) urls are allowed, no loca files.
\Typesetsh\UriResolver::httpOnly($cachePath);
// http(s) and the current working dir of you application.
\Typesetsh\UriResolver::httpAndCurrentDir($cachePath, $base);
// Local files only within the list of given allowed directories
\Typesetsh\UriResolver::localOnly($allowedDirectories, $base);Using typeset.sh
Technical Documentation
HtmlToPdf Service
Method Parameters
Last updated