diegomura / diegomura/react-pdf

PDFViewer component in Next.js renders blank page when using custom fonts from local project

Open
#2,302 3 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 attempting to use custom fonts from my local project in the PDFViewer component of react-pdf within a Next.js application, the rendered page appears blank with no content.

**To Reproduce**
Steps to reproduce the behavior including code snippet (if applies):
1- Create a Next.js project.
2- Import and register a custom font from the local project using Font.register.
3- Apply the custom font to the PDFViewer component or any text element within it.
4- Render the PDFViewer component in a Next.js page.
5- Notice that the rendered page is blank with no visible content.

**Expected behavior**
The PDFViewer component in the Next.js application should render the content with the applied custom font correctly, displaying the text using the specified font.

**Screenshots**
![image](https://github.com/diegomura/react-pdf/assets/64620134/07fa618a-9786-43d3-8bcf-1b5f63963682)

**Desktop (please complete the following information):**
- OS: Windows
- Browser chrome
- React-pdf version 3.1.9
- Next js 12.0.7
- React 17.0.2

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.