<?php 

//ini_set('display_errors',1);

require '../../libreriasphp/pdf417/vendor/autoload.php';

use BigFish\PDF417\PDF417;
use BigFish\PDF417\Renderers\ImageRenderer;
use BigFish\PDF417\Renderers\SvgRenderer;


$cadsunat = $_POST['emp_ruc'].'|'.$_POST['tipcom'].'|'.$_POST['ven_serdoc'].'|'.$_POST['ven_corrdoc'].'|'.$_POST['ven_igv'].'|'.$_POST['ven_tot'].'|'.$_POST['ven_fec'].
	'|'.$_POST['tipdoc'].'|'.$_POST['cli_numdoc'].'|'.$_POST['DigVal'].'|'.$_POST['SigVal'];
	
$filename = 'barcode/'.$_POST['ven_serdoc'].'-'.$_POST['ven_corrdoc'].'.png';	



$pdf417 = new PDF417();
$data = $pdf417->encode($cadsunat);

// Create a PNG image, red on green background, extra big
$renderer = new ImageRenderer([
    'format' => 'png',
    'color' => '#000000',
    'bgColor' => '#ffffff',
    'scale' => 10,
]);

$image = $renderer->render($data);
$image->save($filename);
	
?>