-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
HorstOeko
committed
Dec 31, 2024
1 parent
84f809d
commit 42d23d7
Showing
4 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
make/md/ZugferdDocumentPdfBuilder_attachAdditionalFileByContent.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
```php | ||
|
||
// You can also add an attachment to the PDF as an stream (string). The conditions are the same as above for the attachAdditionalFileByRealFile method | ||
// The only difference to attachAdditionalFileByRealFile is that the attachAdditionalFileByContent method accepts 4 parameters, whereby here (as with attachAdditionalFileByRealFile) | ||
// the last two can be omitted. You only need to specify a file name under which the file is to be embedded | ||
|
||
$zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf'); | ||
$zugferdDocumentPdfBuilder->attachAdditionalFileByContent('<xml>....</xml>', 'additionalDocument.csv', "Some other display Name", ZugferdDocumentPdfBuilderAbstract::AF_RELATIONSHIP_SUPPLEMENT); | ||
$zugferdDocumentPdfBuilder->generateDocument(); | ||
$zugferdDocumentPdfBuilder->saveDocument('/tmp/merged.pdf'); | ||
|
||
``` |
18 changes: 18 additions & 0 deletions
18
make/md/ZugferdDocumentPdfBuilder_attachAdditionalFileByRealFile.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
```php | ||
|
||
// The method attachAdditionalFileByRealFile has 3 parameters: | ||
// - The file to attach which must exist and must be readable | ||
// - (Optional) A name to display in the attachments of the PDF | ||
// - (Optional) The type of the relationship of the attachment. Valid values are defined in the class | ||
// ZugferdDocumentPdfBuilderAbstract. The constants are starting with AF_ | ||
// | ||
// If you omit the last 2 parameters the following will happen: | ||
// - The displayname is calculated from the filename you specified | ||
// - The type of the relationship of the attachment will be AF_RELATIONSHIP_SUPPLEMENT (Supplement) | ||
|
||
$zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf'); | ||
$zugferdDocumentPdfBuilder->attachAdditionalFileByRealFile('/path/to/existing.file', "Some display Name", ZugferdDocumentPdfBuilderAbstract::AF_RELATIONSHIP_SUPPLEMENT); | ||
$zugferdDocumentPdfBuilder->generateDocument(); | ||
$zugferdDocumentPdfBuilder->saveDocument('/tmp/merged.pdf'); | ||
|
||
``` |
11 changes: 11 additions & 0 deletions
11
make/md/ZugferdDocumentPdfBuilder_setAdditionalCreatorTool.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
```php | ||
|
||
// Before calling this method the creator of the PDF is identified as 'Factur-X library 1.x.x by HorstOeko'. | ||
// After calling this method you get 'MyERPSolution 1.0 / Factur-X PHP library 1.x.x by HorstOeko' as the creator | ||
|
||
$zugferdDocumentPdfBuilder = ZugferdDocumentPdfBuilder::fromPdfFile($zugferdDocumentBuilder, '/tmp/existingprintlayout.pdf'); | ||
$zugferdDocumentPdfBuilder->setAdditionalCreatorTool('MyERPSolution 1.0'); | ||
$zugferdDocumentPdfBuilder->generateDocument(); | ||
$zugferdDocumentPdfBuilder->saveDocument('/tmp/merged.pdf'); | ||
|
||
``` |