Jump to content

Issue with first line indentation in the invoice pdf


Recommended Posts

Hello everyone,

I have difficulties with the design of the invoice. The first line is always slightly further indented than the lines after the line break. If I make a line break with <br>, the next line is a little further to the right.

Every table has cellpadding="2" and cellspacing="0"

When I comment all the css in invoice.style-tab.tpl nothing changes. Also there is almost no inline css. So I think it is a setting of tcpdf but I cannot find out exactly.

I made an override of PDFGeneratorCore:

<?php

class PDFGenerator extends PDFGeneratorCore
{
    /**
     * Write a PDF page.
     */
    public function writePage()
    {
        $this->SetHeaderMargin(5);
        $this->SetFooterMargin(45);
        $this->setMargins(10, 40, 10);
        $this->AddPage();
        $this->writeHTML($this->content, true, false, true, false, '');
    }
}

I was trying $this->setCellPadding(0); and several values in writeHTML().

Does anyone have an idea what the problem could be?

Thanks in advance

Screenshot from 2024-07-17 13-26-48.png

Link to comment
Share on other sites

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...