Jump to content

Show header only on 1st page of Pdf


shobhitverma

Recommended Posts

Hi,

This post is regarding PS 1.6

I am generating  invoices PDF, and the length of the invoice PDF is of 2 pages, and both the page have  header and footer, but I don't want header from 2nd page onwards for which I tried the following code in \tools\tcpdf\tcpdf.php inside Startpage method nearly on line 4094

 

if($this->numpages == 1)
	$this->setHeader();
}

It worked, and the header was not getting displayed from 2nd page onwards, but the issue is, it is still leaving margin space from the top of the 2nd page due to which a blank space is getting displayed on the 2nd page.
For Resolving I tried the following code on classes\pdf\PDFGenerator.php inside the writePage method. nearly on line 217

if($this->numpages == 1){

$this->setMargins(10, 40, 10);

}

But by this, all page are getting affected.

Any help will be appreciated. 

IN000009 (18).pdf

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...