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

Empty page with inside element having height 0 #2909

Open
typesafeui opened this issue Oct 19, 2024 · 1 comment
Open

Empty page with inside element having height 0 #2909

typesafeui opened this issue Oct 19, 2024 · 1 comment

Comments

@typesafeui
Copy link
Contributor

Describe the bug
React pdf creates an empty page having no elements when having multiple inside the same .
The rendered empty page seen inside the INTERNAL__LAYOUT__DATA has a single component with height: 0

This is the empty page inside INTERNAL__LAYOUT__DATA:

{
    "type": "PAGE",
    "box": {
        "paddingTop": 32,
        "paddingRight": 48,
        "paddingBottom": 32,
        "paddingLeft": 48,
        "marginTop": 0,
        "marginRight": 0,
        "marginBottom": 0,
        "marginLeft": 0,
        "borderTopWidth": 0,
        "borderRightWidth": 0,
        "borderBottomWidth": 0,
        "borderLeftWidth": 0,
        "top": 0,
        "right": 0,
        "bottom": 0,
        "left": 0,
        "width": 595.280029296875,
        "height": 841.8900146484375
    },
    "style": {
        "paddingTop": 32,
        "paddingRight": 48,
        "paddingBottom": 32,
        "paddingLeft": 48,
        "fontFamily": "Open Sans",
        "width": 595.28,
        "height": 841.89
    },
    "props": {
        "size": "A4"
    },
    "children": [
        {
            "type": "VIEW",
            "box": {
                "paddingTop": 0,
                "paddingRight": 0,
                "paddingBottom": 0,
                "paddingLeft": 0,
                "marginTop": 0,
                "marginRight": 0,
                "marginBottom": 0,
                "marginLeft": 0,
                "borderTopWidth": 0,
                "borderRightWidth": 0,
                "borderBottomWidth": 0,
                "borderLeftWidth": 0,
                "top": 32,
                "right": 0,
                "bottom": 0,
                "left": 48,
                "width": 499.280029296875,
                "height": 0
            },
            "style": {
                "fontFamily": "Open Sans",
                "marginTop": 0,
                "paddingTop": 0,
                "borderTopWidth": 0,
                "borderTopLeftRadius": 0,
                "borderTopRightRadius": 0
            },
            "props": {
                "debug": true
            },
            "children": [],
            "origin": {
                "left": 297.6400146484375,
                "top": 32
            }
        }
    ],
    "origin": {
        "left": 297.6400146484375,
        "top": 420.94500732421875
    }
}

Expected behavior
Not have the empty page

Screenshots
image

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Chrome
  • React-pdf version: @react-pdf/renderer@4.0.0
@diegomura
Copy link
Owner

Can you please provide the actual document? The internal layout is just the outcome but can't know how it got in that state

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

No branches or pull requests

3 participants
@diegomura @typesafeui and others