Skip to content

Commit

Permalink
Updated README.md for more clearence of usage of the ZugferdDocumentP…
Browse files Browse the repository at this point in the history
…dfBuilder class
  • Loading branch information
HorstOeko committed Sep 26, 2023
1 parent c24d7f5 commit 74bb915
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,9 @@ The `ZugferdDocumentBuilder` class is again the central entry point to generate

### Writing a pdf file with attached xml file

Use the class ```ZugferdDocumentPdfBuilder``` if you already have an existing print output of the invoice (for example from an ERP system) and want to add an XML data stream to the existing PDF:


```php
use horstoeko\zugferd\ZugferdDocumentBuilder;
use horstoeko\zugferd\ZugferdDocumentPdfBuilder;
Expand Down Expand Up @@ -367,7 +370,7 @@ The `ZugferdDocumentBuilder` class is again the central entry point to generate
->SetDocumentPositionLineSummation(275.0)
->writeFile(getcwd() . "/factur-x.xml");

$pdfBuilder = new ZugferdDocumentPdfBuilder($document, "/tmp/original.pdf");
$pdfBuilder = new ZugferdDocumentPdfBuilder($document, "/tmp/existingprintlayout.pdf");
$pdfBuilder->generateDocument();
$pdfBuilder->saveDocument("/tmp/new.pdf");
$pdfBuilder->saveDocument("/tmp/merged.pdf");
```

0 comments on commit 74bb915

Please sign in to comment.