Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi
I'm trying to get Page number in my footer, and some text in the header.
The header appears on some pages, not on others...
And how do i put something in the footer? the choice in PDF fields say 'In Header/Footer' without an ability to stipulate which.
Any help much appreciated!
Comment | File | Size | Author |
---|---|---|---|
#2 | 1886066-header_footer-2.patch | 1.93 KB | guillaumev |
Comments
Comment #1
gillarf CreditAttribution: gillarf commentedhere's an example of the PDF:
http://www.travellingsnail.com/journalPDF/288
I worked out how to put content in the footer, but on some pages neither the header nor the footer appear.
Comment #2
guillaumev CreditAttribution: guillaumev commentedThis patch prints the views header and footer in the PDF on every page. I believe it makes much more sense to use these as Header and Footer instead of trying to print the header and footer from fields...
Comment #3
killua99 CreditAttribution: killua99 commentedWorks fine, as you say. well done!
Info for the maintainer:
Exist a patch to handle this issues and others. Please see #2032189-4: Multiple issue fixing in a single patch: Multiple issue fixing in a single patch and review others issues patch.
This is RTBC, and ready to apply.
Comment #4
killua99 CreditAttribution: killua99 commentedThanks guillaumev committed
Comment #5
candelas CreditAttribution: candelas commentedi am using the pdf unformatted in the module dev version and if i add something to the header or footer, it is not written.
if i add a field to the header and footer in the field settings, first field gets duplicated. the same if i put a number field in the footer and header.
if i put something in the header/footer area i get an extra page.
Comment #6
killua99 CreditAttribution: killua99 commentedOk, so. Looks like it's not completely done.
Can you use the git branch 7.x-1.x and make an update of that branch. When you do it, please summit if this still happen. I tried and looks fine for me at least.
Comment #7
candelas CreditAttribution: candelas commentedi tried the last version and now i get footer and header from views, but if i use tokens i get
Fatal error: Call to a member function tokenize_value() on a non-object in /xxx/sites/all/modules/contrib/views/handlers/views_handler_area_text.inc on line 105
since in this version i keep having problems on puting the number in the footer, i was trying to use the views footer to write the number (i created the field and excluded from display).
Comment #8
killua99 CreditAttribution: killua99 commentedOk, Yes the version 6 I see have some issue with the tokens. Maybe it's the same here
Comment #9
nhck CreditAttribution: nhck commentedThe problem is that $this->bMargin always seems to be zero.
Comment #10
nhck CreditAttribution: nhck commentedAs an additional source of possible errors I have identified that the whole view should be rendered before the footer and header are renderered. The reason is that some fields in the footer rely on content from the whole view. For example the order total field of commerce. I'd hence suggest to fully render the view before rendering the footer or the header:
Comment #11
killua99 CreditAttribution: killua99 commentedOk, This week I'm kind busy.
Next one I'll start digg into this one.
Comment #12
cdeces CreditAttribution: cdeces commentedIn order to have headers and footers written on each page, a checkPageBreak() should be used after writing each record.
Comment #13
alibama CreditAttribution: alibama commentedpatch didn't apply well to latest dev - any ideas? I'm not able to use this module at present
Comment #14
vegansupreme CreditAttribution: vegansupreme commented@alibama, What specifically isn't working for you? Patch has already been applied in latest dev, and stable versions. See #4.
Headers/footers do work in PDF, but not perfectly.
Also, there are issues when using tokens in headers/footers. See #2099263: Unable to use tokens with Views PDF
Comment #15
vegansupreme CreditAttribution: vegansupreme commented