1. Go to this page and download the library: Download tecsiaron/ublrenderer library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
tecsiaron / ublrenderer example snippets
$content=file_get_contents("path_to.xml");
$renderer = new UBLRenderer($content);
$renderer->WriteFile();
$content=UBLRenderer::LoadUBLFromZip("test.zip")->ubl;
$renderer = new UBLRenderer($content);
$renderer->WriteFile();
// get the contents of the XML
$renderer = new UBLRenderer($content);
$invoice=$renderer->ParseUBL();
$validation=$invoice->CanRender();
$validationFailReason="Validation failed:\n";
if(is_array($validation))
{
echo "Failed to render invoice: ". implode("\n", $validation)
}
else
{
$html=$renderer->CreateHTML(invoice);
}
composer
php vendor/bin/ubl2html.php <input.xml or input.zip> <output.html>
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.