-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
1 parent
1a111c3
commit 1eb4b16
Showing
10 changed files
with
409 additions
and
37 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,29 @@ | ||
<?php | ||
|
||
use Sprain\SwissQrBill\PaymentPart\Output\FpdfOutput\Template\QrBillFooter; | ||
|
||
require dirname(dirname(__DIR__)) . '/vendor/autoload.php'; | ||
|
||
// 1. Let's load the base example to define the qr bill contents | ||
require dirname(__DIR__) . '/example.php'; | ||
|
||
// 2. Create a FPDF instance (or use an existing one from your project) | ||
$fpdf = new QrBillFooter('P', 'mm', 'A4'); | ||
$fpdf->AddPage(); | ||
|
||
// 3. Create a full payment part for FPDF | ||
$output = new Sprain\SwissQrBill\PaymentPart\Output\FpdfOutput\fpdfOutput($qrBill, 'en', $fpdf); | ||
$output | ||
->setPrintable(false) | ||
->getPaymentPart(); | ||
|
||
// 4. For demo purposes, let's save the generated example in a file | ||
$examplePath = __DIR__ . "/fpdf_example.pdf"; | ||
$fpdf->Output($examplePath, 'F'); | ||
|
||
if (file_exists(dirname(__DIR__) . '/qr.svg')) { | ||
unlink(dirname(__DIR__) . '/qr.svg'); | ||
unlink(dirname(__DIR__) . '/qr.png'); | ||
} | ||
|
||
print "PDF example created here : " . $examplePath; |
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
Oops, something went wrong.