Items that I have placed in the Header and Footer are printed on the Succeed Template.
My understanding from the documentation is that this is not correct behaviours, and that these pages should receive no printing.

CommentFileSizeAuthor
#15 list.pdf222.96 KBessbee

Comments

hunziker’s picture

The implementation is done as follows:

When the document is closed (before it is printed out), we iterate over all pages. Then we get the last record (the last row), which is printed on the current PDF page. Then we iterate over all fields and select all these, which are positioned in the "header / footer". These fields get rendered with the last record.

I now this does not solve your problem, but this is the exact description of the implementation. Currently Im rewriting this part of the module, because there are some bugs in certain situations.

essbee’s picture

Thanks hunziker,
Is there any custom pre or post php that I could apply to avoid printing the header on the last page?

Also, and this may or may not be related, if I put a preceeding pdf page in but no succeeding page the headers get pushed out of sync, basically the first internal page is missing its header.

By the way this is a phenomenally powerful module you have created here. The capabilities and possibilities it opens up are amazing. For example I now have it generating a fully formated price list of all the items on my site including brief descriptions, separated by producer. Loving it.

hunziker’s picture

Status: Active » Needs review

The latest commit should resolve this problem.

essbee’s picture

Yep fixed problem of printing on the succed template, but now I'm getting the header and footer only on every second page for each individual record.

So If a view record prints over three pages the header and footer are shown on pages 1 & 3 but not 2.

hunziker’s picture

Status: Needs review » Postponed (maintainer needs more info)

I cant reproduce the problem. Can you give more information about how you produce the header and how you structure your document? Have you any page break between the fields? Where you place the header / footer field (at the start or end of the field list)?

essbee’s picture

Have a page break as the last field in the list.

Header and footer elements are all the first few elements in the field list, then items that appear on the page (first is placed via page reference, subsequent items placed based on last writing position including an included view. Final item in the list is a page break field.

hunziker’s picture

Is it possible that you post a screenshot of the field list and the resulting PDF document? (also of the included view?)

candelas’s picture

i dont know why but the page break makes crazy my document too... specially if i put it with code, like or by css with style="page-break-before: always" or after... though i am on 6.x.1
sure hunziker will resolve this soon :)

hunziker’s picture

You should not use "page-break-*" css styles, because they are not necessarily compatible with the views pdf module.

candelas’s picture

so is it an optional page break?
i mean not with page break field.

candelas’s picture

Priority: Minor » Normal
Status: Needs work » Postponed (maintainer needs more info)

i found it!!!!!!
if you add a page in a field with <tcpdf method="AddPage" />, you need to put coordinate y=0 in the next field.
then everything works!!!!!!!!
lalala (i have been crazy for a week with this, trying to find a way!!)

edit i was thinking that also it is related to the fact that when a field is too long you dont get the numbers... i imagine that tcpdf adds a page and then the number y position or whatever that is in header or footer gets also crazy... i hope it is and my last problem with this module solved! :)

edit it was not true: <tcpdf method="AddPage" /> needs to be in a diferent line, like in:

<?php print '<tcpdf method="AddPage" />;' ?>

and not in the middle of a string.

<?php print '<div>sdfsfas<tcpdf method="AddPage" />fasdfasf</div>'; ?>

maybe the ; of ending the line helps...

edit 2 the solution before worked but added an extra line on top of the text. i found a better solution with <br pagebreak="true" />

hunziker’s picture

Priority: Normal » Minor
Status: Postponed (maintainer needs more info) » Needs work

I will check this, but since this page break is not really used often (you could use the field for
page break....), I will reduce the priority.

candelas’s picture

the page break field is great, but i need a page break only for sections, no for all articles...

also if by css you have it, you have the same problem...
:)
it would be nice if it worked...
and maybe the problem with headers and footers is related...

anyway... thanks a lot :)

candelas’s picture

@essbee: i think this issue is related to this one http://drupal.org/node/1226980
can you test on your view, please?

essbee’s picture

Status: Postponed (maintainer needs more info) » Needs work
StatusFileSize
new222.96 KB

Ok so this thread appears to have been hijacked - the original issue is still at large and didnt have anything to do with page breaks.

header and footer printing is still significantly buggy in the release candidate (I would suggest too buggy for it to be called a release candidate).

The closest I have on my view at the moment is the headers and footers printing correctly on the first and last pages of each section, but nothing printing on the pages in between.

Can be seen on attached.

Have changed priority back as I dont feel this is minor.

lsolesen’s picture

Status: Needs work » Active

Setting to active, as there is no patch to work on. Is it related to #1226980: header and footer: calculating when they have to be printed

killua99’s picture

Status: Active » Closed (duplicate)

Duplicate multiple issue with this