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

TOC bug in php 8? #472

Open
cstdenis opened this issue Jan 25, 2022 · 1 comment
Open

TOC bug in php 8? #472

cstdenis opened this issue Jan 25, 2022 · 1 comment

Comments

@cstdenis
Copy link

cstdenis commented Jan 25, 2022

Argument #2 ($times) must be greater than or equal to 0 in vendor/tecnickcom/tcpdf/tcpdf.php:21765
Stack trace:
#0 vendor/tecnickcom/tcpdf/tcpdf.php(21765): str_repeat(' ', -3)
#1 extensions/tcpdf/ETcPdf.php(94): TCPDF->addHTMLTOC(1, 'INDEX', Array, true, 'B', Array)

Version : 6.4.4
PHP 8.0.12

Code that invokes the error

			$bookmark_templates[0] = '<table border="0" cellpadding="3" cellspacing="0">
							<tr>
								<td width="25mm"></td>
								<td width="105mm"><span style="font-weight:bold;font-size:12pt;color:black;">#TOC_DESCRIPTION#</span></td>
								<td width="25mm"><span style="font-family:courier;font-weight:bold;font-size:12pt;color:black;" align="right">#TOC_PAGE_NUMBER#</span></td>
								<td width="25mm"></td>
							</tr>
							</table>';

			$pdf->addHTMLTOC(1, 'INDEX', $bookmark_templates, true, 'B', array(128,0,0));
@cstdenis
Copy link
Author

This is triggered when the document has > 999 pages. addTOC() works, but addHTMLTOC() is broken.

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

No branches or pull requests

1 participant