PHPJasper / phpjasper

A PHP report generator
MIT License
457 stars 161 forks source link

Não é possível abrir este arquivo Algo deu errado. #293

Open thomasatxx opened 2 years ago

thomasatxx commented 2 years ago

Ao executar o .php ocorre o seguinte erro quando vai tentar gerar o PDF Screenshot_3

Segue o meu código a baixo: `<?php

require DIR . '/vendor/autoload.php';

use PHPJasper\PHPJasper;

ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);

$input = DIR . '/vendor/geekcom/phpjasper/examples/modelOficio.jasper';
$output = DIR . '/vendor/geekcom/phpjasper/examples';
$options = [ 'format' => ['pdf'], 'locale' => 'en', 'params' => [], 'db_connection' => [ 'driver' => 'mysql', //mysql, .... 'username' => 'root', 'password' => '', 'host' => 'localhost', 'database' => 'sca3.0' ] ];

$jasper = new PHPJasper;

$jasper->process( $input, $output, $options )->output();

$filename = 'modelOficio.pdf'; header('Content-Description: application/pdf'); header('Content-Type: application/pdf'); header('Content-Disposition:; filename=' . $filename); readfile($output . '/' . $filename); unlink($output . '/' . $filename); flush();

?>`

thomasatxx commented 2 years ago

@jadsonbr

jadsonbr commented 2 years ago

Please do not make repeated comments or otherwise spam us with notifications on these issues. It does not help in any way whatsoever. If it continues in the future, we will not allow you to comment in this repository, please consider this a warning.