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!

Files: 
CommentFileSizeAuthor
#2 1886066-header_footer-2.patch1.93 KBguillaumev

Comments

here'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.

Title:Odd behaviour with headers and footers - need supportPrint views header and footer in PDF
Status:Active» Needs review
StatusFileSize
new1.93 KB

This 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...

Priority:Normal» Major
Status:Needs review» Reviewed & tested by the community

Works 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.

Priority:Major» Normal
Status:Reviewed & tested by the community» Fixed

Thanks guillaumev committed

Status:Fixed» Active

i 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.

Priority:Normal» Major
Status:Active» Needs work

Ok, 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.

i 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).

Ok, Yes the version 6 I see have some issue with the tokens. Maybe it's the same here

@@ -151,7 +163,10 @@ class PdfTemplate extends FPDI {
+    $this->SetY(-$this->bMargin);

The problem is that $this->bMargin always seems to be zero.

As 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:

<?php
   
//views_pdf_plugin_display.inc line 111 
   
$this->view->pdf->setViewsHeader($this->view->display_handler->render_header());
$html = $this->view->render($this->display->id); //it must be in the middle for header AND footer to correctly parse.
   
$this->view->pdf->setViewsFooter($this->view->display_handler->render_footer());
?>

Category:support» bug

Ok, This week I'm kind busy.

Next one I'll start digg into this one.

In order to have headers and footers written on each page, a checkPageBreak() should be used after writing each record.