Hello,
I would like to help you out, but I need more information. Please send me more info first.
Thread Starter
jnz31
(@jnz31)
hi bas, thanks for the reply.
i am quite far by now, but i do have a major problem. i would need the current page as a variable, but i don’t know how to get there. i know, there is the shortcode {PAGENO} & {nbpg}, BUT the way i see it, these will get replaced AFTER the php of my template is parsed, so i can’t use these.. do you have any idea how to solve this..?
You can just place them within php tags. MPDF will replace it with page number.
Take a look at this. Let me know if it works. π
BTW. Would you be so kind to rate the plugin? It will support future development a lot! Many thanks.
Did you got it to work? Please let me know.
Thread Starter
jnz31
(@jnz31)
hi bas
nope, i was on vactation and ill and didn’t proceed with this, yet.
and i even tried your hint with {PAGENO} before, but that didn’t work out.
the problem is, when i try to get the variable in my template, its not transformed to the value, yet.
when i write $page = {PAGENO}; echo gettype($page); it returns “STRING”, means $page is “{PAGENO}” and not the variable, that i require. the transformation of {PAGENO} happens AFTER my php gets executed.. this is at least what i’m guessing here.. so i am looking for another way.. or did you mean something else..?
Hi Bas, I’m also having a customisation problem, I would like to change the word “INVOICE” on the template and make it “TAX INVOICE”. I’m using a child theme and presume I need to put a copy of the template in there somewhere (Apologies, I’m new to this) can you please explain what I need to do in order to add the word “TAX” before the the word “INVOICE” in the PDF template please? But I need a solution that will not be overwritten by any updates please.
I look forward to your reply.
HI again Bas, Please don’t worry, I found the solution in the FAQ section, but if you would clarify that this will not be overwriiten by any updates?
Thread Starter
jnz31
(@jnz31)
hi. i want to reup this topic. i still can’t figure out, how to set a variable on a page, to check, on what page i am. as far as i can see, the build in mPDF functionality can’t provide this..
@rakoonie I can clarify that you won’t lose changes after updating plugin. Just place your custom template into bewpi-invoices folder and it should come up in the list on the settings page.
@jnz31 Will try to find the time to send you the code for it.
Thread Starter
jnz31
(@jnz31)
high.
so i finally got this working. sheesh.
but i had to hack ur plugin..
here is how i did it:
in my custom body.php template, at the top:
<style>
@page {
size: auto;
odd-header-name: html_odd_header;
odd-footer-name: html_odd_footer;
even-header-name: html_even_header;
even-footer-name: html_even_footer;
}
</style>
<htmlpageheader name="odd_header">
odd header
</htmlpageheader>
<htmlpageheader name="even_header">
even header
</htmlpageheader>
<htmlpagefooter name="odd_footer">
odd footer
</htmlpagefooter>
<htmlpagefooter name="even_footer">
even footer
</htmlpagefooter>
and in the file absctract-bwepi-document.php i added a line bellow $mpdf->autoMarginPadding = 10;
$mpdf->mirrorMargins = 1;
i tried to apply this via the bewpi_mpdf filter by putting this into my themes functions.php:
function bewpi_mpdf( $mpdf ) {
$mpdf->mirrorMargins = 1;
return $mpdf;
}
add_filter( 'bewpi_mpdf', 'bewpi_mpdf' );
but that didn’t do the trick.. any hint, what would be wrong with this? don’t like my hacking, eather..
Thread Starter
jnz31
(@jnz31)
and while i’m at it..
i also want to implement a custom font. i saw the bewpi_ttffonts filter, but where shall i store the font files etc..? to make it update-save, once the problem above is settled..
@jnz31 had some busy weeks. Would like to know if you got it to work happy to help you out. π
@rakoonie would you be so kind to rate the plugin? It would support future development a lot. Thanks!