How to add content to the PDF footer
-
Hi,
first of all, I absolutely love your plugin. Great work, man!
My question: how can I add content to the PDF footer? I guess I’ll need to edit the tcpdf.php file? I need to insert some copyright information with HTML characters.
Thanks for any help!
Regards,
Joerg
-
Thanks for your kind words, Joerg!
Use the development version, which has a custom footer function. You use the text box in the admin area to enter your footer text (HTML).
Cheers
Lewis
PS – I still have some upgrade issues to work out before releasing the development version as 1.1.0, but functionally, that’s where we’ll be.
Hey Lewis,
thank you for your reply!
I installed the development version and edited the footer to my needs. But, somehow I cannot get the plugin to work when I want to use a header logo image. I always get an error message somehow related to the image (even with the default image in use):
TCPDF ERROR: [Image] Unable to get the size of the image:
Any ideas?
Regards, Joerg
Well, you know what they say, Joerg, “one step forward and two steps back!” 🙂
I can confirm this (just tested). This is actually the second time I’ve had such a report, and I just used all three of my test logo images, and all three failed to render.
I’ll advise when I have a new development version available.
Cheers
Lewis
Okay, actually, this was fixed in my local copy (back in April), but because I had been working on some other functionality, I never pushed it. I’ve done that, now.
All you need to upgrade to the latest development release (asuming you are using 1.1.0b20140331) are the following two files from rev. 936249:
wp-post-to-pdf-enhanced.php
tcpdf/config/tcpdf_config.phpYou may grab each of these by browsing from here.
With those two files, your installation will be up to 1.1.0b20140425.
Please advise as to whether you continue to have difficulties with the header logo image, Joerg.
Thanks!
Lewis
Hey Lewis,
thanks for your answers.
I already helped myself by editing the latest stable version by using writeHTMLCell() for the footer. Worked like a charm.
I already did some “heavy hacking” of the wp-post-to-pdf-enhanced.php, since I am using a lot of custom fields and content blocks that have to be in the PDF – so this was the obvious way to do it.
When these features go live with a stable version, I might change this again. But for the time being I am good 🙂
Thanks and cheers!
JoergJoerg, if you’d care to enlighten me with a diff of your changes, particularly for the custom fields, I’d be most grateful. This is one of the features I’ve been asked to implement, and haven’t yet worked out, so I’m interested to see your approach (though likely you just statically set them in the main plugin class, as you don’t need to fiddle with the admin page).
Thanks!
Lewis
Hi Lewis,
you’re absolutely right.
I basically put a whole bunch of
$html .= …
lines into the main class. It worked for me in this case.
But: I am doing the very same thing right now for yet another project. So, this thing working in any dynamic way would be a major improvement. Since I really love the work you are doing with this plugin I would love to help you in any way possible.
Maybe you have an idea how to approach this?
Cheers, Joerg
No ideas yet, but soon (I hope). We’ll start another thread when the time comes.
Thanks!
Lewis
- The topic ‘How to add content to the PDF footer’ is closed to new replies.