Closed (won't fix)
Project:
Views PDF
Version:
6.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
22 Jul 2011 at 18:03 UTC
Updated:
7 Mar 2013 at 19:24 UTC
Jump to comment: Most recent file
Comments
Comment #1
hunziker commentedYour view is empty. Can you give me the export of your view, the resulting PDF and if existing the template files?
Comment #2
candelas commentedsorry, it was not published in the workflow and, of course, you couldnt see it.
now it is public
http://mientrastanto.org/1-las-agencias-de-rating-han-dejado-de-estar-ba...
i attach the view, and i use the display "pdf 1 articulo" for the pdf presentation.
edit since my clients are trying the site, they removed the article.
i attach a html http://drupal.org/files/issues/las-agencias-de-rating-han-dejado-de-esta... .
Comment #3
candelas commentedi upload the bad pdf because i am changing the web.
if i edit with 6.x-1.0-beta5 and save, and then use 6.x-1.0 and dont edit the row style of the pdf fields, it works.
the file was originally made in the beta5... can it have something to do?
but as soon i open and save the row style of the pdf fields, it starts to eat the numbers...
i hope it helps you to debug :)
http://drupal.org/files/issues/483.pdf
Comment #4
candelas commentedi found more information about this issue:
when i reported, i was making pdfs of one article, now i have been doing a magazine and i see that when a field has more than 2 pages, the page in the middle doesnt get the number. the same articles produced with 6.x.4 get the number ok. but i cant use it because has problems with the error that you resolved about theme on the new release.
i hope this helps to you to fix it :)
Comment #5
candelas commentedhello
i created a very simple view to check this bug in style 'PDF unformatted'.
this bug it is not present in 6.x-beta4 and starts in beta5 and it is still in version 1.
i think it is related to "Minimal Space" new option on the user interface, but i can be wrong.
to reproduce: i attach the view and you need to create a node with a body of 3 pages or more:
in a node that has 4 pages, what i found is:
i hope this will help to you to find why and make this module even better than it is :)
thanks a lot
i put priority major since a client will not accept a pdf that has not all the numbers... if you think it is not, please change it.
Comment #6
candelas commentedmore info:
all before was done in the footer.
with one element in the header and field in several pages: no extra pages but it only renderes in 1st and last page. (if it is in the footer it gets the 2 extra pages).
if you put 2 elements in the header/footer, things get crazzy not only with field more than one page.
and now i go to work in other part of the site, i hope this helps you to solve the problem :) thanks
Comment #7
candelas commentedi think this tittle is better :)
Comment #8
candelas commentedComment #9
candelas commentedattach for comment #2
Comment #10
candelas commentedsince i gave information, i think i can change the status... if i do wrong, please change it :)
Comment #11
candelas commentedmy bad english ... :)
Comment #12
candelas commentedhello
since i finished the site but this problem, i come to see if i can help to detect what is going on :)
i downloaded the last dev version since i saw hunziker has renovated it (thanks).
i searched for the place where it is done and compared with the 6.x-1.x-beta4 where the numbers get ok.
i am tired and i didnt find a solution... but i put what i see, in case it helps.
in views_pdf_plugin_row_fields.inc, function render, line 36, the code changes from (first old version):
to
if i replace it, then the extra page disapears, but i get a number only in the first page.
if i mix both, then i am, without the first extra page and numbers at the begining and at the end. (i put the php tags for better reading)
mm all this is in a loop, and then you render the number out of it
my problem is that i have fields that are 3 or more pages, so shouldnt the page counter be renewed in other way diferent than the number of items since one field can be in more than two pages?
i am not a programer, so for me this is toooo much :))))
i searched in internet an found a function for getting the page number independent of this loop... o.o
just in case that i am in the right direction, i paste it here:
font http://php.net/manual/en/ref.pdf.php bolyde at gmail dot com 12-Apr-2009 07:27
hunziker, any tips or ideas? :)
edit someone, in a different project but problems with long fields, say it used
"Print When Expression" set to "$V{PAGE_NUMBER} == 1" which is working,
http://jasperforge.org/plugins/espforum/view.php?group_id=83&forumid=101...
and i tcpdf: there is a variable (this i write for me, that hunziker sure knows :))))
$page (line 121)
* var: page number
* access: protected
and now to bed... let's see if we can solve tomorrow....
Comment #13
candelas commentedmy bad english... O.O
Comment #14
candelas commentedmy client ask for more changes and i dont find the solution to this bug... :(
Comment #15
candelas commentedbad bad... dont touch code when you are tired and the code is done by other person that knows much more than you... :)
dont do what i made because if a rule calls your view and you use views php, you get your functions duplicated... O.O
today that i can investigate for a while, i will look into views_pdf_template.php, since in line 152 i found this:
also i will learn git.
if i dont get any results... i will have to use other module... what i dont want to since i like this one a lot and i have spent a lot of time learning how to use it...
any results, i will tell here :)
by the way, hunziker, thanks for commenting so well the code :)
Comment #16
candelas commentedi found a solution using the function Footer() while this bug is fixed
i posted it as a new issue to use for documentation
http://drupal.org/node/1255112
Comment #17
hunziker commentedI will try to resolve this issue. It is hard, because it is really deep in the code and the behavior is not always the same. With my test cases it works, so I need to investigate this.
Comment #18
essbee commentedI suspect this issue is also displaying itself in my use case.
I had a pdf displaying perfectly, but now in the latest version my headers and footers are all over the shop.
They mainly seem to print after the whole document on their own pages, but I also have a case where my header suddenly prints in the middle of a page.
In a pdf that should only be 3 pages long I have the following behaviour:
First page has page number but no other headers or footer info.
2nd page has page number and additional footer values but no header info.
3rd page has all header and footer information but one of the header fields is printing in the middle of the page not at the top.
4th page (erroneous) has perfect header information, additional footer information but no page number
5th page (erroneous) has all header information but no footer info.
Basically I am having the correct number of headers and footer printers in total (3 headers, 3 footers, 3 page numbers), they just aren't on the right pages :)
Comment #19
essbee commentedAttached is the example of my 7.x view issue. As can be seen the headers and footers are a bit of a mess.
Comment #20
essbee commentedRight so I have a view that prints headers and footers correctly.
Now in the latest version if I simply go into PDF Fields | Settings and click Apply then save - making no changes, the footers and headers break and go onto their own page.
Very strange behaviour. I can no loner adjust the settings in anyway as doing so kills my pdf.
Comment #21
digi24 commentedI am just starting to use this module, but I think that this bug seems solveable. Right now, I have limited the
Closefunction to only handle the first page. All subsequent pages are handled by theHeader(ORFooter) function.This works so far, header is displayed on every page, no empty pages, the remaining problem is now to take care of the margins in the
drawContentfunction. Otherwise the header would overlap with multipage contentedit: More complicated than I thought, it seems that using a PDF template changes the whole behaviour. On the one hand, I am happy that this module works for me, on the other I have no solution for the bug either. Sorry about my optimism.
Comment #22
Makku01 commentedUncommenting line 762 in views_pdf_template.php solved the issue for me. Still wondering why it was commented...
EDIT: nope, that doesn't solve anything. Im in desperate need for a solution to print a footer on all (!) pages. Please, for the love of god, can anybody of the mantainers help me?
Comment #23
Makku01 commentedComment #24
gillarf commentedI am having this same problem.
See http://www.travellingsnail.com/journalPDF/288
The footers and headers come and go - i cannot see why.
I have a simple header and footer and would be happy as a short term solution to use a hack (e.g. just to ge page number working!)
Thanks for the module though - its great.
Comment #25
gillarf commentedOk, i can see what's happening in my case.
I am using 'Include Views' to add data into my PDF view from other views.
The footer and header only appear at the start of each new include view. The numbering is correct though.
Is there a way to override this and append a simple page numbering to my view (please somebody :-) )
I am willing to pay for the solution - i need this sorted this week.
Comment #26
gillarf commentedJust spotted this from @candelas above.
http://drupal.org/node/1255112
thanks that's useful. But i don;t really understand when those footer and header functions are called.
i still need to get 'title' out of my view to put into a header area, so i'll need to get that information into those functions.
Comment #27
gillarf commentedhmmm. that is useful, but it doesn't actually put content into the footer. I have no idea what these footer and header functions do.
However I was trying out different things, and placing:
$this->headerFooterData[$this->getPage()] = 'somehting';
In one of those functions fixed my footer. I have no idea why this should have fixed it. Now all page numbers appear, even those within included views...
Comment #28
candelas commented@gillarf i didnt answer any of your doubts because i didnt use this module again and i didnt found other solution.
thanks for reporting your solution that i would try if i need this module again (probably).
Comment #29
gillarf commentedThanks @candelas
@hunziker - please can you advise how I might hack the module to force the Header and Footers to appear (for example extract content from the view and output it to headers - at any convenient point in the execution)
I must admit, i'm struggling to understand how this module works.
Comment #30
simon georges commentedI apologize, the 6.x version is not maintained any more. This issue is close for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.