Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font in Tablecell not visible after Pagebreak #155

Closed
Gernott opened this issue May 2, 2020 · 8 comments
Closed

Font in Tablecell not visible after Pagebreak #155

Gernott opened this issue May 2, 2020 · 8 comments
Assignees
Labels

Comments

@Gernott
Copy link
Contributor

Gernott commented May 2, 2020

If you use pdf:html with a

inside with background-colour in cells, then the text on page 2 in cell one is not visible, when the content of this cell is parted on 2 pages.
See attached PDF (press strg+a on page 2 to see the hidden text).

example.pdf
WebsitePdf.zip

@maechler
Copy link
Member

maechler commented May 4, 2020

@Gernott Thanks for reporting! I will have a look at it this week, but probably this is a TCPDF issue.

@maechler maechler self-assigned this May 4, 2020
@Gernott
Copy link
Contributor Author

Gernott commented May 4, 2020

It seems to work with direct PHP / TCPDF 6.3.5 (Github Master).
See attached PHP and PDF file with same HTML code.
phptry.zip

@maechler
Copy link
Member

maechler commented May 4, 2020

@Gernott Perfect thanks, so we will update TCPDF soon and test it!

@maechler maechler added the bug label May 5, 2020
@Gernott
Copy link
Contributor Author

Gernott commented May 5, 2020

Hmmmm, I replaced the TCPDF version in the EXT:pdfviewhelpers 2.3.1 in the folder Resources/Private/PHP/tcpdf/ from 6.2.26 to 6.3.2 (from Github). But the problem still appears with my PDF Viewhelper.
So it is more tricky. I have no idea where to look now. Do you have any hints what I can try now?

@maechler
Copy link
Member

maechler commented May 6, 2020

I guess I would have to start using a debugger now as well. But maybe you can find out something by starting to comment out TCPDF methods that we have overwritten in BasePDF, e.g. Header or Footer:

/**
* @inheritdoc
*/
public function Header() // phpcs:ignore
{
if ($this->pageHeaderClosure instanceof Closure) {
$this->pageHeaderClosure->__invoke();
} else if ($this->documentHeaderClosure instanceof Closure) {
$this->documentHeaderClosure->__invoke();
}
$this->basePdfHeader();
}

If commenting out one of these functions helps, we know where to have a closer look at. You should be able to recognise the methods we have overwritten by looking for the comment @inheritdoc.

@maechler
Copy link
Member

maechler commented May 7, 2020

@Gernott The problem seems to be within our function renderHeader in BasePDF. You could provide your own PDF class (see https://docs.typo3.org/p/bithost-gmbh/pdfviewhelpers/master/en-us/ConfigurationReference/AdvancedCustomization/Index.html#extend-basepdf-class), overwrite the function and comment out $this->setPageMark();

public function renderHeader()
{
    $graphicVars = $this->getGraphicVars();

    parent::setHeader();
    $this->setGraphicVars($graphicVars);
    //$this->setPageMark();
}

I am not entirely sure anymore why we use $this->setPageMark() at this point, it seems to have fixed a PDF compliance issue. Although it also might be that it serves no purpose whatsoever, I will have to further investigate this.

@maechler
Copy link
Member

maechler commented Jun 1, 2020

This should be fixed in v2.3.2 which I just released.

The problem seemed to be that setting a page mark at this point lead to a wrong ordering of the background and the text within the PDF document. The text was being rendered, but it was hidden behind the coloured background.

@Gernott
Copy link
Contributor Author

Gernott commented Jun 2, 2020

Tested and works fine. Thank you - good work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants