Skip to content

Mandarin characters become unrecognizable in PDF export while displaying correctly in web UI #2037

@ching-kuo

Description

@ching-kuo

Describe the bug
When downloading a PDF containing Mandarin (Chinese) characters using the docs application (https://github.com/suitenumerique/docs) which utilizes BlockNote for editing and download functionality, all Mandarin characters become unrecognizable/corrupted in the generated PDF, while they display correctly in the web UI.

To Reproduce

  1. Use the docs application from https://github.com/suitenumerique/docs
  2. Create a BlockNote document with mixed English and Mandarin content:
    <p>This is a test document</p>
    <p>這是個測試文件</p>
  3. View the document in the web UI (Mandarin characters display correctly)
  4. Use the docs application's PDF download feature (which leverages BlockNote's functionality)
  5. Open the downloaded PDF untitled-document.pdf
  6. Observe that Mandarin characters are unrecognizable/corrupted while English text remains intact

Expected behavior
Mandarin characters should render correctly in the downloaded PDF, matching their appearance in the web UI.

Misc

  • Node version: 22.18.1
  • Package manager: yarn@1.22.22
  • BlockNote version: 0.37.0
  • Implementation: Using docs from https://github.com/suitenumerique/docs (which integrates BlockNote)
  • I'm a sponsor and would appreciate if you could look into this sooner than later 💖

Additional Information
This appears to be a font encoding or font embedding issue specific to PDF generation within the docs application's implementation of BlockNote. The issue may be related to how the docs application handles PDF export or how BlockNote's PDF generation handles non-Latin character sets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions