Jump to content

Change PDF header margin only for Invoice.


Kerm

Recommended Posts

1.6.1 version

 

I know about function:

 

    public function writePage()
    {
        $this->SetHeaderMargin(5);
        $this->SetFooterMargin(21);
        $this->setMargins(10, 40, 10);
        $this->AddPage();
        $this->writeHTML($this->content, true, false, true, false, '');
    }

But here changes apply for all PDF documents, like delivery. I need change header margin only for Invoice pdf files, but how?

 

At the moment I solved the problem in the following way:

if ($this->template == 'Invoice') {
	$this->pdf_renderer->writePageInvoice();
} else {
	$this->pdf_renderer->writePage();
}
But I do not know whether this solution is ideal or can be solved as something more simple.
Link to comment
Share on other sites

  • 2 weeks 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...