problem Mpdf

Hello!

Has anyone managed to customize a template to pdf using Mpdf?

I'm trying to place the pagination on the file sheets but I'm not getting.

I tried to include the tag {PAGENO} according to their documentation (https://mpdf.github.io/headers-footers/method-2.html) but I was not successful.

when clicking on the button to generate the pdf, it opens on the same page. I tried to include in the template file "$ mpdf-> Output ('file-name.pdf', 'D');" but it was wrong.

Also, the CSS settings do not match the table in the .pdf file.

I already inserted the styles directly in the table, and in an outside file and it didn't work either.

Has anyone ever experienced this?

Thank you!
 
For opening the PDF in a new browser tab use a custom list template and edit default_buttons.php around line 109
<a target="_blank" href=....pdf link...

PDF template's CSS from custom_css.php is applied on my site - partly. I really don't know what Mpdf can handle or not, looks worse than domPDF.

Ok, this is working https://mpdf.github.io/headers-footers/method-4.html
(method4, example 5)

In default.php do something like
<style>
@page {
size: auto;
odd-header-name: html_MyHeader1;
odd-footer-name: html_MyFooter1;
}

</style>
<htmlpageheader name="MyHeader1">
<div style="text-align: right; border-bottom: 1px solid #000000; font-weight: bold; font-size: 10pt;">My document, Date {DATE j-m-Y}
</div>
</htmlpageheader>
<htmlpagefooter name="MyFooter1">
<table width="100%">
<tr>
<td width="33%">{DATE j-m-Y}</td>
<td width="33%" align="center">{PAGENO}/{nbpg}</td>
<td width="33%" style="text-align: right; ">My document</td>
</tr>
</table>
</htmlpagefooter>
 
Last edited:
It's running fine with J!3.9.20 and Fabrik3.9.2 and Fabrik library3.9.2 in frontend (Protostar template) and backend (Isis), with mPDF and domPDF and php7.3 on my site.
So no idea why it doesn't do on your site.
Do you really have Fabrik library 3.9.2 installed?
 
The screenshot is showing only the main Fabrik component.
Are all Fabrik plugins and the Fabrik library also showing 3.9.2?

Are you running a recent GitHub update?
Or did you update via Joomla updater?
With a recent GitHub update you'll have the latest code (but you must run the post-GitHub steps to see the new version in Joomla's extension manager)

If youve updated via Joomla manager you must update all Fabrik plugins + you must install the latest Fabrik library (3.9.2, ca. 59 MB) manually.
 
Hello @troester !

Up until the post's opening date, I had already updated the entire Fabrik installation with the latest version of Git.

Do you have a link to this library?

Thanks for the help and patience! : D
 
The library is in the Fabrik downloads, but it should be the same as the latest GitHub.
 
Hello @troester !

I updated the base of my project with the latest (2020/08/09) version of Fabrik from Git and the error continues to generate a pdf :(

Anything else you can do?

thanks!
 
I have no idea.
I even tested with php7.4
I think nor Fabrik nor the PDF libs are really php7.4 ready, but PDFs a created as they should if J!'s error reporting is not set to max (so not throwing "deprecated" notices).

Did you try with the standard Protostar template?
With a very simple test site (only Joomla and Fabrik, so no 3rd-party stuff may mix up)?
 
Hello @troester !

It is very strange all this.

I already tested with the template .... and it didn't work either.

The project is only with Fabrik installed and nothing else :(

And now, when adding a new item to this listing, the record inserts other items in the same record, as if it were 'dirt' from other records.

I'll redo everything to check.

Thank you
 
Hello @troester !

A doubt I forgot. the part of putting the action of opening the pdf using Mpdf is in the details and not in the list.

How can I put the details generate pdf button to open in a new one when using mpdf?

Thank you!
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top