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

DOMPDF to enable automatic page breaks when encountering large content in <td> wrapper #1046

Open
rajanish93 opened this issue May 6, 2024 · 2 comments

Comments

@rajanish93
Copy link

<style> body { font-family: verdana, sans-serif; }
    table {
        margin-bottom: 2em;
    }

    thead {
        background-color: #eeeeee;
    }

    tbody {
        background-color: #ffffee;
    }

    th,
    td {
        padding: 3pt;
    }

    table.separate {
        border-collapse: separate;
        border-spacing: 5pt;
        border: 3pt solid #33d;
    }

    table.separate td {
        border: 2pt solid #33d;
    }

    table.collapse {
        border-collapse: collapse;
        border: 1pt solid black;
    }

    table.collapse td {
        width: 612px;
        height: 792px;
        overflow: hidden;
        font-family: Arial, Helvetica;
        position: relative;
        color: #545554;
        page-break-after: always;
    }
</style>

To insert a page break in pdf, the html code must have an element with the style page-break-before: always or page-break-after: always. Before or after that specific element, a page break will be inserted into the generated pdf document. The element can be anything (image, table, table row, div, text, etc).

            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>

            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>

            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>

            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>


            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>

            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>


            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>


            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>


            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>


            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>


            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>


            <p>To insert a page break in pdf, the html code must have an element with the style
                page-break-before: always or page-break-after: always. Before or after that specific
                element, a page break will be inserted into the generated pdf document. The element can
                be anything (image, table, table row, div, text, etc).</p>

        </td>
    </tr>

</table>
When I put large content in
wrapper pdf unable to show all content and created blank page before starting content.
@rajanish93
Copy link
Author

This exactly issue occurred on below URL:

https://eclecticgeek.com/dompdf/debug.php?identifier=f333a1b5cedfbec3ceeff081b8fbf857

@parallels999
Copy link

**This is just a Dompdf wrapper!**
I understand that this package is just a Laravel wrapper for https://github.com/dompdf/dompdf
Any issues with PDF rendering, CSS that is not applied correctly, aligning/fonts/characters etc that are not directly related to this package, should be reported there. When having doubts, please try to reproduce the issue with just dompdf. If it's also present there, do not open an issue here please.

This is just a Dompdf wrapper!
I understand that this package is just a Laravel wrapper for https://github.com/dompdf/dompdf
Any issues with PDF rendering, CSS that is not applied correctly, aligning/fonts/characters/images/html etc that are not directly related to this package, should be reported there. When having doubts, please try to reproduce the issue with just dompdf. If it's also present there, do not open an issue here please.

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

2 participants