Skip to content

Multi-page PDFs cause page errors in Adobe Reader, when created with .html() #3428

Open

Description

@r3-gabriel

I have read and understood the contribution guidelines.

When creating a PDF document via .html() with autoPaging enabled, Adobe Reader reports errors from the second page onward (jsPDF 2.5.1 / html2canvas 1.4.1).
adobe_error

The issue does not occur in PDF viewers in Chrome or Firefox. I´ve created a CodePen that reproduces this issue.

I also found a workaround: If I know the number of pages that the autoPaging will generate with .html(), I add those pages manually beforehand - this will result in a PDF file that works in Adobe Reader without issue. CodePen with workaround.

Because of this, I assume that autoPaging in .html() does not properly manage pages, which triggers the error.

Activity

  1. JasmeenTechnocomet commented on Jul 23, 2022

    @JasmeenTechnocomet

    I had the same problem @r3-gabriel did you find any solution?

  2. r3-gabriel commented on Jul 23, 2022

    @r3-gabriel
    Author

    I have not had more time to investigate - the descriped workaround worked good enough to address the issue in the short term.

    To clarify how the workaround is implemented:

    • Create PDF normally with .html(), which results in the bug in Adobe Reader
    • Count the resulting pages
    • Throw away the created document
    • Create new, empty PDF
    • Add the expected number of pages manually with .addPage()
    • Add content with .html()
    • Now you have a valid PDF document

    Because the workaround fixes the issue, I assume that .html() does not register pages correctly when more than 1 is generated.

  3. riquems commented on Sep 1, 2022

    @riquems

    Same problem here, thanks for the workaround @r3-gabriel. Hope this gets fixed...

  4. github-actions commented on Dec 1, 2022

    @github-actions

    This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

  5. r3-gabriel commented on Dec 1, 2022

    @r3-gabriel
    Author

    Bump, still relevant.

  6. github-actions commented on Mar 2, 2023

    @github-actions

    This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

  7. r3-gabriel commented on Mar 2, 2023

    @r3-gabriel
    Author

    Bump, still relevant.

  8. ruanpetersen commented on Mar 6, 2023

    @ruanpetersen

    I am also rendering a multi-page PDF and am also experiencing this issue but due to images. When images are removed then the error goes away. I have tried multiple image formats.

  9. hansdoug commented on Apr 13, 2023

    @hansdoug

    @r3-gabriel wow, thank you for the workaround, you just saved my day.

  10. github-actions commented on Jul 13, 2023

    @github-actions

    This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

  11. 40 remaining items

  12. febkosq8 commented on Jan 1, 2026

    @febkosq8

    Still relevant.

  13. github-actions commented on Apr 2, 2026

    @github-actions

    This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

  14. r3-gabriel commented on Apr 2, 2026

    @r3-gabriel
    Author

    Still relevant.

  15. github-actions commented on Jul 2, 2026

    @github-actions

    This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

  16. r3-gabriel commented on Jul 2, 2026

    @r3-gabriel
    Author

    Still relevant.

  17. github-actions commented on Oct 2, 2026

    @github-actions

    This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

  18. r3-gabriel commented on Oct 2, 2026

    @r3-gabriel
    Author

    Still relevant.

  19. Yash9S commented on Oct 7, 2026

    @Yash9S

    I am facing the same issue. Isn't the issue resolved yet? can you please help me regarding this?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions