Samples

Below are some sample files. The PDF version is generated on the fly by dompdf. (The source HTML & CSS for these files is included in the test/ directory of the distribution package.)

array(), "dom" => array(), "image" => array(), "page" => array(), "encoding" => array(), "script" => array(), "quirks" => array(), "other" => array(), ); //if dompdf.php runs in virtual server root, dirname does not return empty folder but '/' or '\' (windows). //This leads to a duplicate separator in unix etc. and an error in Windows. Therefore strip off. $dompdf = dirname(dirname($_SERVER["PHP_SELF"])); if ( $dompdf == '/' || $dompdf == '\\') { $dompdf = ''; } $dompdf .= "/dompdf.php?base_path=" . rawurlencode("www/test/"); foreach ( $test_files as $file ) { preg_match("@[\\/](([^_]+)_?(.*))\.(".implode("|", $extensions).")$@i", $file, $matches); $prefix = $matches[2]; if ( array_key_exists($prefix, $sections) ) { $sections[$prefix][] = array($file, $matches[3]); } else { $sections["other"][] = array($file, $matches[1]); } } foreach ( $sections as $section => $files ) { echo "

$section

"; echo ""; } ?>