<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
include __DIR__ . '/vendor/autoload.php';
use NFePHP\DA\NFe\Danfe;
$xml = file_get_contents(__DIR__ . '/entrada/mod55.xml');
//$logo = 'data://text/plain;base64,'. base64_encode(file_get_contents(realpath(__DIR__).'/../relatorios/images/logo_od.jpeg'));
$logo = 'data://text/plain;base64,'. base64_encode(file_get_contents(realpath(__DIR__ . '/images/tulipas.png')));
try {
$danfe = new Danfe($xml);
$danfe->exibirTextoFatura = false;
$danfe->exibirPIS = false;
$danfe->exibirIcmsInterestadual = false;
$danfe->exibirValorTributos = false;
$danfe->descProdInfoComplemento = false;
$danfe->exibirNumeroItemPedido = false;
$danfe->setOcultarUnidadeTributavel(true);
$danfe->obsContShow(false);
$danfe->printParameters(
$orientacao = 'P',
$papel = 'A4',
$margSup = 2,
$margEsq = 2
);
$danfe->logoParameters($logo, $logoAlign = 'C', $mode_bw = false);
$danfe->setDefaultFont($font = 'times');
$danfe->setDefaultDecimalPlaces(4);
$danfe->debugMode(false);
$danfe->creditsIntegratorFooter('WEBNFe Sistemas -
http://www.webenf.com.br');
$pdf = $danfe->render($logo);
header('Content-Type: application/pdf');
echo $pdf;