Closed (duplicate)
Project:
Views PDF
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
1 Jun 2011 at 07:32 UTC
Updated:
11 Jul 2013 at 15:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
hunziker commentedThe 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.
Comment #2
essbee commentedThanks 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.
Comment #3
hunziker commentedThe latest commit should resolve this problem.
Comment #4
essbee commentedYep 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.
Comment #5
hunziker commentedI 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)?
Comment #6
essbee commentedHave 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.
Comment #7
hunziker commentedIs it possible that you post a screenshot of the field list and the resulting PDF document? (also of the included view?)
Comment #8
candelas commentedi 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 :)
Comment #9
hunziker commentedYou should not use "page-break-*" css styles, because they are not necessarily compatible with the views pdf module.
Comment #10
candelas commentedso is it an optional page break?
i mean not with page break field.
Comment #11
candelas commentedi 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:and not in the middle of a string.
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" />Comment #12
hunziker commentedI 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.
Comment #13
candelas commentedthe 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 :)
Comment #14
candelas commented@essbee: i think this issue is related to this one http://drupal.org/node/1226980
can you test on your view, please?
Comment #15
essbee commentedOk 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.
Comment #16
lsolesen commentedSetting 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
Comment #17
killua99 commentedDuplicate multiple issue with this