diegomura / diegomura/react-pdf

Custom text inside Canvas is not rendered unless a <Text> block exists

Open
#3,075 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
16.8k
Forks
1.3k
Avg merge
5h 6m
Merged PRs (30d)
52

Description

**Describe the bug**
When rendering custom text inside a ``, the text appears garbled unless there is at least one `` block in the document.

**To Reproduce**
Steps to reproduce the behavior:

1. Clone the repository: [react-pdf-canvas-custom-text-repro](https://github.com/RNm-dove/react-pdf-canvas-custom-text-repro)
2. Run npm install
3. Run npm run dev
4. Open the browser and check the behavior

**Expected behavior**
Custom text inside `` should be rendered correctly even if there is no `` block in the document.

**Screenshots**
![Image](https://github.com/user-attachments/assets/eafd7866-bbd0-45d0-b31b-5871598de7eb)

**Desktop (please complete the following information):**

- OS: [e.g. MacOS, Windows]
- Browser: Chrome
- React-pdf version: 4.2.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.