dompdf / dompdf/dompdf

Cpdf.php / DejaVuSans related errors when upgrading from PHP 7.1 to 8.0 (IIS 10 dompdf 1.0.2)

Open
#2,385 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
PHP
Stars
11.2k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

I'm getting the following errors when upgrading from PHP 7.1 to 8.0,
Most seem related to Cpdf.php or DejaVuSans.

[24-Feb-2021 17:35:11 America/Los_Angeles] PHP Warning:  touch(): Utime failed: No such file or directory in C:\inetpub\wwwroot\era\docs\utilities\dompdf_1-0-2\dompdf\lib\Cpdf.php on line 1176
[24-Feb-2021 17:35:11 America/Los_Angeles] PHP Fatal error:  Uncaught FontLib\Exception\FontNotFoundException: Font not found in: C:\WINDOWS\TEMP/DejaVuSans-Bold.ttf.tmp.6036fecf80f9f in C:\inetpub\wwwroot\era\docs\utilities\dompdf_1-0-2\dompdf\lib\php-font-lib\src\FontLib\Font.php:28
Stack trace:
#0 C:\inetpub\wwwroot\era\docs\utilities\dompdf_1-0-2\dompdf\lib\Cpdf.php(1182): FontLib\Font::load()
#1 C:\inetpub\wwwroot\era\docs\utilities\dompdf_1-0-2\dompdf\lib\Cpdf.php(931): Dompdf\Cpdf->processFont()
#2 C:\inetpub\wwwroot\era\docs\utilities\dompdf_1-0-2\dompdf\lib\Cpdf.php(3195): Dompdf\Cpdf->o_font()
#3 C:\inetpub\wwwroot\era\docs\utilities\dompdf_1-0-2\dompdf\src\Adapter\CPDF.php(1217): Dompdf\Cpdf->output()
#4 C:\inetpub\wwwroot\era\docs\utilities\dompdf_1-0-2\dompdf\src\Dompdf.php(955): Dompdf\Adapter\CPDF->output()
#5 C:\inetpub\wwwroot\era\class_generatePDF.php(56): Dompdf\Dompdf->output()
#6 C:\inetpub\wwwroot\era\docs\pdf_packet.php(143): generatePDF->generatePDF()
#7 {main}
  thrown in C:\inetpub\wwwroot\era\docs\utilities\dompdf_1-0-2\dompdf\lib\php-font-lib\src\FontLib\Font.php on line 28

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported PHP 7.1-to-8.0 failure on IIS 10, then inspect lib/Cpdf.php around lines 1176 and 1182 and lib/php-font-lib/src/FontLib/Font.php:28. Determine why the temporary DejaVuSans-Bold.ttf file is unavailable and verify that PDF generation completes without the reported warning or exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.