dompdf / dompdf/dompdf

Long table causing memory/timeout errors

Open
#528 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug duplicate imported Performance Priority-Medium
Dominant language
PHP
Stars
11.2k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Original author: mattl (July 24, 2012 21:35:46)

Steps:
Use the attached HTML (grouped_report.html) with the following PHP:

<code language="php">
...
$dompdf->load_html( $html );
$dompdf->set_paper( 'letter', 'landscape' );
$dompdf->render();
$dompdf->stream( "report.pdf", array( 'Attachment' => 0 ) );
</code>

The divided_report is placing 29 rows in a table and each table is page-break-after:always. The grouped_report has all of them in one table and it doesn't work.

Expected:
The fully rendered report.

Actual:
Variations on 30sec max execution time exceeded, tried to allocate more memory errors

Environment:
PHP 5.3.x on Apache 2.2 using PDFLib and dompdf @ r495.

Original issue: http://code.google.com/p/dompdf/issues/detail?id=522

grouped_report.txt
divided_report.txt

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 with the attached grouped_report.txt and divided_report.txt, then reproduce the issue through load_html(), set_paper(), render(), and stream() using the provided PHP example. Compare the single 29-row table with the page-broken version and inspect where rendering exceeds the memory or execution limits. Done means the grouped report renders fully without timeout or memory errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.