Comments (3)
Hello TELLO0815!
I've investigated your problem and passing the template path with @SyliusInvoicingPlugin
prefix doesn't work for me either.
Unfortunately, I have not found any other Symfony and knp_snappy users with the same problem as yours but I assume that the missing part here is calling the Twig templating engine with the header path as an argument.
Therefore, I changed the logic in the InvoicePdfFileGenerator
's generate()
method a bit:
$pdf = $this->pdfGenerator->getOutputFromHtml(
$this->templatingEngine->render($this->template, [
'invoice' => $invoice,
'channel' => $channel,
'invoiceLogoPath' => $this->fileLocator->locate($this->invoiceLogoPath),
]),
['header-html' => $this->templatingEngine->render('@SyliusInvoicingPlugin/Invoice/Download/_header.html.twig')]
);
and it works like a charm. For now I think that there are two ways of generating the invoice's header via knp_snappy bundle:
- Pass the path to the file using
%kernel.project.dir%
parameter, just like you did in your solution - Overwrite the default
InvoicePdfFileGenerator
class implementation with a customized one using the snippet provided above.
from invoicingplugin.
Hello TELLO0815!
Which version of InvoicingPlugin are you currently using?
from invoicingplugin.
v0.8.3
from invoicingplugin.
Related Issues (20)
- composer require sylius/invoicing-plugin get error HOT 3
- use symfony mailer and twig inky and not swiftmailer HOT 1
- Invoice not generated at the right state HOT 3
- The process has been signaled with signal 11 HOT 1
- Cleanup class
- Sending invoice per email is broken when using S3 HOT 2
- Links with table do not seem to be right HOT 1
- Customizing the invoice pdf generated by the plugin - not working HOT 1
- change the .env SYLIUS_INVOICING_LOGO_FILE HOT 4
- [RFC] One order item splitted into multiple line items once their unit price differs HOT 7
- WKHTMLTOPDF_PATH path env HOT 1
- [Bug] Resend Invoice : No error message displayed - Admin does not handle 'failure' flash type message (should be 'error') HOT 3
- catalog unit price HOT 5
- Question: delivery note / receipt HOT 2
- OrderPlacedProducer is not connected to the state machine HOT 2
- During reverting migrations Version20191216134233 is failing HOT 1
- InvoiceVoter does not support other instances of Sylius\Component\User\Model\UserInterface HOT 1
- sylius-invoicing:generate-invoices - Expected a value other than null. HOT 1
- Price values are wrong in the PDF invoice HOT 3
- Unit price calculation is wrong on line item HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invoicingplugin.