PDF export produces blank documents for sheets, docs, and slides · Issue #553 · cloudflare/cloudflare-os · GitHub
Skip to content

PDF export produces blank documents for sheets, docs, and slides #553

Open

Description

@mizuyot

PDF export produces blank documents for sheets, docs, and slides

All three built-in format blueprints export blank PDFs. Three separate causes:

  1. Sheets: the client builds its print table on beforeprint, which the
    PDF export path never fires. The print container is empty at capture time.
    Reproduces on main with no local changes.

  2. Docs and slides: browser-export waits for load plus a short fixed
    delay. Under Browser Rendering this fires before paint, so the capture is
    blank. Local Chrome usually hides this.

  3. RPC: if the client does request its data at print time,
    subscribe(...) / getDocument() / getDeck() throw
    TypeError: The RPC receiver does not implement the method "move".
    The print-time browser cannot pass the callback stub across the RPC
    boundary.

Observed sizes before the fix: sheets 1,050 bytes, docs 1,048 bytes,
slides 1,056 bytes — all with no extractable text.

What worked for us

Reading the document server-side before launching the browser and embedding it
in the print page, rather than having the print page fetch its own data.
Sheets additionally build their print table on the PDF path. When the snapshot
is absent, export fails with an error rather than emitting a blank PDF.

After: sheets 31,016 bytes, docs 6,390 bytes, slides 76,848 bytes, all with the
expected text.

A patch is in #552, which was auto-closed for exceeding the 30-line
contribution limit. Happy to split it, or leave the fix to the maintainers —
opening this so the bug is on record either way.

Activity

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