Wrong page margin on first page of PDF

Phoca PDF - creating PDF documents in Joomla! CMS
pixelhexe
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 07 Mar 2012, 13:49

Wrong page margin on first page of PDF

Post by pixelhexe » 22 Jul 2021, 19:10

Strange enough - the top margin on the first page is always a little larger (~1 cm) than on further pages. Option in Phoca PDF Content Plugin -> Header > "display header" yes or no does not have any impact.

Header top margin is set to 5 and site margin top is set to 28 - neither these values have any relevance on this phenomenon nor page format or orientation.

Anybody else with this behavior and how to solve it?
Thanks!

christine
Phoca Hero
Phoca Hero
Posts: 2215
Joined: 28 Nov 2010, 17:20

Re: Wrong page margin on first page of PDF

Post by christine » 23 Jul 2021, 12:59

Hi,

Can be due to various causes, such as: template, browser setting etc. To say ev. more about, we have to see it.

Kind regards
Christine

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 44104
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Wrong page margin on first page of PDF

Post by Jan » 23 Jul 2021, 14:59

Hi, as Christine wrote, can you paste here a link to example of such PDF? Does this happen for different PDFs or only for one?

Jan
If you find Phoca extensions useful, please support the project

pixelhexe
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 07 Mar 2012, 13:49

Re: Wrong page margin on first page of PDF

Post by pixelhexe » 23 Jul 2021, 19:16

Thank you, Christine and Jan!

I need it only for one PDF which should be created on this page:

https://www.bagage.de/fort-und-weiterbi ... onologisch

-> "Kursprogramm drucken"

I am afraid then that I caused the bug with my customizations... Actually this is not that important. I thought that it could be a common issue.
Have a nice weekend!

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 44104
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Wrong page margin on first page of PDF

Post by Jan » 24 Jul 2021, 15:44

Hi, really hard to give some clue advice. The only one idea I have, is, that maybe before start, some hidden character like space, or empty div is rendered. Did you try to see the HTML source code, if there is no some hidden part on start?

Jan
If you find Phoca extensions useful, please support the project

pixelhexe
Phoca Newbie
Phoca Newbie
Posts: 4
Joined: 07 Mar 2012, 13:49

Re: Wrong page margin on first page of PDF

Post by pixelhexe » 26 Jul 2021, 17:14

Hi Jan,

thanks for helping! I am a little step further. It has probably something to to with the content being generated as a TABLE or more concrete, with THEAD tag. The table head is correctly printed on each page. Only the top margin of first page differs from the top margin of further pages.

There is a function setTableHeader() which seems to takes control in the
administrator\components\com_phocapdf\assets\tcpdf\tcpdf.php

But as it's not THAT important ... and my customer is happy as it is ... ;-)
I wan't go any deeper to this.

And I found this old post from 2013 which could be a similar issue:
http://forum.codecall.net/topic/76424-t ... r-the-1st/

Thanx again
Anja

christine
Phoca Hero
Phoca Hero
Posts: 2215
Joined: 28 Nov 2010, 17:20

Re: Wrong page margin on first page of PDF

Post by christine » 26 Jul 2021, 21:51

Hi Anja,

just an idea, as I tried temporary to change the width and height from 300px:

Code: Select all

.....menubar=no,resizable=yes,width=300,height=300, ....etc.
to: 640/480px:

Image

or maybe: width=auto,height=auto

Kind regards
Christine

christine
Phoca Hero
Phoca Hero
Posts: 2215
Joined: 28 Nov 2010, 17:20

Re: Wrong page margin on first page of PDF

Post by christine » 26 Jul 2021, 22:21

Hi Anja,

sorry, got it wrong, please ignore previous post. By seeing pdf larger, I saw what you mean.
Kind regards
Christine

User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 44104
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Wrong page margin on first page of PDF

Post by Jan » 27 Jul 2021, 15:09

Hi, thank you for the link, I will take a look at it.

Jan
If you find Phoca extensions useful, please support the project

Post Reply