Crear PDF

47 views
Skip to first unread message

Gerardo Trotta

unread,
Nov 16, 2023, 12:46:54 PM11/16/23
to Factura electronica AFIP - Web Service en PHP - 2015
Buenas a todos, tengo este ejemplo que me da este error
Fatal error: Uncaught Error: Call to a member function CreatePDF() on null in C:\xampp\htdocs\facturacionweb\factura\imprime_factura.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\facturacionweb\factura\imprime_factura.php on line 16  

<?php

$pres = $_GET["pres"];

$html = file_get_contents('bill.html');

// Nombre para el archivo (sin .pdf)
$name = 'factura_Nro: ' . $pres;
   
// Opciones para el archivo
$options = array(
    "width" => 8 // Ancho de pagina en pulgadas
);

// Creamos el PDF
$res = $afip->ElectronicBilling->CreatePDF(array(
    "html" => $html,
    "file_name" => $name,
    "options" => $options
));

// Mostramos la url del archivo creado
var_dump($res->file);
?>


si hago print de los datos, estan todos bien pero en el momento
del CreatePDF me da ese error

Desde ya muchas gracias
Reply all
Reply to author
Forward
0 new messages