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.
From my point of view, is better to leave the writing position unaffected, if a field is empty or excluded from display.
So you have to make this check in drawContent function before the call of SetX, SetY functions.
Comment | File | Size | Author |
---|---|---|---|
#11 | views_pdf-1270606-11-empty_fields.patch | 624 bytes | Simon Georges |
#6 | views_pdf-do-not-render-empty-rows-1270606-3-cvs.patch | 658 bytes | ltrain |
#5 | views_pdf-do-not-render-empty-rows-1270606-3.patch | 666 bytes | ltrain |
Comments
Comment #1
castawaybcn CreditAttribution: castawaybcn commentedI second this behaviour too, in my case some fields are not displayed (which is the intended behaviour if they are empty) but views pdf does take that invisible field as the last writing position, which results in strange results when positioning fields relatively.
I can submit a pdf showing this behaviour in case my explanation was not clear enough.
And thanks for such a great module, btw.
Comment #2
ltrainI second it as well. I have a content type with optional fields. But if they are left empty, I don't want the PDF content to leave empty space.
I'm trying to alter views_pdf_template.php -
I have tried several things, including at line 344
I have changed to:
To check whether the field is empty. And it makes no difference. Can someone point me in the right direction?
Thanks
Comment #3
ltrainThis works:
Comment #4
ltrainI would submit a patch, but 6.x-1.x-dev isn't listed on the Version control page. Is 6.x-1.x-dev the current release?
Comment #5
ltrainHere is the patch for 6.x-1.0
Comment #6
ltrainThis patch is to be used with drush make (a default strip of -p0).
Comment #7
castawaybcn CreditAttribution: castawaybcn commentedworked wonderfully, thanks a lot @lollypic!
Comment #8
glynster CreditAttribution: glynster commentedSame problem exists in Drupal 7 I have applied the fix but no luck for me. Any ideas?
Comment #9
Simon Georges CreditAttribution: Simon Georges commentedCommitted, thanks!
Moving to 7.x-1.x.
Comment #10
glynster CreditAttribution: glynster commentedGreat news.
Comment #11
Simon Georges CreditAttribution: Simon Georges commentedPatch for 7.x-1.x, for those wanting to help test the module.
Comment #12
killua99 CreditAttribution: killua99 commentedThis patch have to be commited. Putting in needs works, and make a review on it.
Comment #13
killua99 CreditAttribution: killua99 commentedCommitted
Comment #14
killua99 CreditAttribution: killua99 commented