@@ -90,10 +90,10 @@ This is a bonus feature that is not available from `pdftk`.
9090use mikehaertl\pdftk\XfdfFile;
9191use mikehaertl\pdftk\FdfFile;
9292
93- $xfdf = new XfdfFile(['name'=> 'Jürgen мирано']);
93+ $xfdf = new XfdfFile(['name' => 'Jürgen мирано']);
9494$xfdf->saveAs('/path/to/data.xfdf');
9595
96- $fdf = new FdfFile(['name'=> 'Jürgen мирано']);
96+ $fdf = new FdfFile(['name' => 'Jürgen мирано']);
9797$fdf->saveAs('/path/to/data.fdf');
9898```
9999
@@ -243,7 +243,7 @@ $pdf->cat(1, 5)
243243
244244// We now use the above PDF as source file for a new PDF
245245$pdf2 = new Pdf($pdf);
246- $pdf2->fillForm(['name'=> 'ÄÜÖ äüö мирано čárka'])
246+ $pdf2->fillForm(['name' => 'ÄÜÖ äüö мирано čárka'])
247247 ->needAppearances()
248248 ->saveAs('/path/filled.pdf');
249249```
@@ -272,7 +272,7 @@ $pdf->allow('AllFeatures') // Change permissions
272272// Example: Fill PDF form and merge form data into PDF
273273// Fill form with data array
274274$pdf = new Pdf('/path/form.pdf');
275- $pdf->fillForm(['name'=> 'My Name'])
275+ $pdf->fillForm(['name' => 'My Name'])
276276 ->flatten()
277277 ->saveAs('/path/filled.pdf');
278278
@@ -282,7 +282,7 @@ $pdf->addPage('/path/my.pdf', null, 'some**password')
282282 ->saveAs('/path/new.pdf');
283283```
284284
285- ### Execution
285+ ### Shell Command
286286
287287The class uses [ php-shellcommand] ( https://github.com/mikehaertl/php-shellcommand ) to execute
288288` pdftk ` . You can pass ` $options ` for its ` Command ` class as second argument to the constructor:
@@ -298,6 +298,21 @@ $pdf = new Pdf('/path/my.pdf', [
298298]);
299299```
300300
301+ ### Temporary File
302+
303+ Internally a temporary file is created via [ php-tmpfile] ( https://github.com/mikehaertl/php-tmpfile ) .
304+ You can also access that file directly, e.g. if you neither want to send or save the
305+ file but only need the binary PDF content:
306+
307+ ``` php
308+ use mikehaertl\pdftk\Pdf;
309+
310+ $pdf = new Pdf('/path/my.pdf');
311+ $pdf->fillForm(['name' => 'My Name'])
312+ ->execute();
313+ $content = file_get_contents( (string) $pdf->getTmpFile() );
314+ ```
315+
301316## API
302317
303318Please consult the source files for a full documentation of each method.
0 commit comments