Skip to content

Commit 5636411

Browse files
author
geekcom
committed
Updated README.md
1 parent 512252b commit 5636411

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,16 @@ public function xmlToPdf()
257257
$output = public_path() . '/report/'.time().'_CancelAck';
258258
$output = public_path() . '/report/'.time().'_CancelAck';
259259
$ext = "pdf";
260-
260+
$data_file = public_path() . '/report/CancelAck.xml';
261+
$driver = 'xml';
262+
$xml_xpath = '/CancelResponse/CancelResult/ID';
263+
261264
\JasperPHP::process(
262265
public_path() . '/report/CancelAck.jrxml',
263266
$output,
264267
array($ext),
265268
array(),
266-
array('data_file' => public_path() . '/report/CancelAck.xml', 'driver' => 'xml', 'xml_xpath' => '/CancelResponse/CancelResult/ID'),
269+
array('data_file' => $data_file, 'driver' => $driver, 'xml_xpath' => $xml_xpath),
267270
false,
268271
false
269272
)->execute();
@@ -277,7 +280,7 @@ public function xmlToPdf()
277280
header('Content-Length: ' . filesize($output.'.'.$ext));
278281
flush();
279282
readfile($output.'.'.$ext);
280-
unlink($output.'.'.$ext);
283+
unlink($output.'.'.$ext); // exclui o arquivo temporário
281284

282285
}
283286
```

0 commit comments

Comments
 (0)