Skip to content

Commit

Permalink
[DOC] Added more wiki examples
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Dec 31, 2024
1 parent 42d23d7 commit 3d2dece
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 0 deletions.
18 changes: 18 additions & 0 deletions make/md/ZugferdDocumentPdfBuilder_setAuthorTemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```php

// Change the author of the generated (merged) PDF

// This method accepts a free text that can accept the following placeholders:
// - %1$s .... contains the invoice number (is extracted from the XML data)
// - %2$s .... contains the type of XML document, such as ‘Invoice’ (is extracted from the XML data)
// - %3$s .... contains the name of the seller (extracted from the XML data)
// - %4$s .... contains the invoice date (extracted from the XML data)

// The follwing example will generate: Issued by seller with name Lieferant GmbH

$zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf');
$zugferdDocumentPdfBuilder->setAuthorTemplate('Issued by seller with name %3$s');
$zugferdDocumentPdfBuilder->generateDocument();
$zugferdDocumentPdfBuilder->saveDocument('/tmp/merged.pdf');

```
18 changes: 18 additions & 0 deletions make/md/ZugferdDocumentPdfBuilder_setKeywordTemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```php

// Change the keywords of the generated (merged) PDF

// This method accepts a free text that can accept the following placeholders:
// - %1$s .... contains the invoice number (is extracted from the XML data)
// - %2$s .... contains the type of XML document, such as ‘Invoice’ (is extracted from the XML data)
// - %3$s .... contains the name of the seller (extracted from the XML data)
// - %4$s .... contains the invoice date (extracted from the XML data)

// The follwing example will generate: R-2024/00001, Invoice, Lieferant GmbH, 2024-12-31

$zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf');
$zugferdDocumentPdfBuilder->setKeywordTemplate('%1$s, %2$s, %3$s, %4$s');
$zugferdDocumentPdfBuilder->generateDocument();
$zugferdDocumentPdfBuilder->saveDocument('/tmp/merged.pdf');

```
18 changes: 18 additions & 0 deletions make/md/ZugferdDocumentPdfBuilder_setSubjectTemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```php

// Change the subject of the generated (merged) PDF

// This method accepts a free text that can accept the following placeholders:
// - %1$s .... contains the invoice number (is extracted from the XML data)
// - %2$s .... contains the type of XML document, such as ‘Invoice’ (is extracted from the XML data)
// - %3$s .... contains the name of the seller (extracted from the XML data)
// - %4$s .... contains the invoice date (extracted from the XML data)

// The follwing example will generate: Invoice-Document, Issued by Lieferant GmbH

$zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf');
$zugferdDocumentPdfBuilder->setSubjectTemplate('%2$s-Document, Issued by %3$s');
$zugferdDocumentPdfBuilder->generateDocument();
$zugferdDocumentPdfBuilder->saveDocument('/tmp/merged.pdf');

```
18 changes: 18 additions & 0 deletions make/md/ZugferdDocumentPdfBuilder_setTitleTemplate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```php

// Change the title of the generated (merged) PDF

// This method accepts a free text that can accept the following placeholders:
// - %1$s .... contains the invoice number (is extracted from the XML data)
// - %2$s .... contains the type of XML document, such as ‘Invoice’ (is extracted from the XML data)
// - %3$s .... contains the name of the seller (extracted from the XML data)
// - %4$s .... contains the invoice date (extracted from the XML data)

// The follwing example will generate: Lieferant GmbH : Invoice R-2024/00001

$zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf');
$zugferdDocumentPdfBuilder->setTitleTemplate('%3$s : %2$s %1$s');
$zugferdDocumentPdfBuilder->generateDocument();
$zugferdDocumentPdfBuilder->saveDocument('/tmp/merged.pdf');

```

0 comments on commit 3d2dece

Please sign in to comment.