diegomura / diegomura/react-pdf

Display the contents of a specific div in a PDF

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

Description

I use the **react-pdf** plugin, and I like the structured way the document is organized. But there is a issue. I have a specific div, and this div has a large child structure. I want to be able to specify the content of that div by specifying a **_selector_** or via **_useRef()_**.

Here is the code:

```
const testEl = useRef();

const MyDoc = () => (



Here I want to display the content of the div with class "test" or by ref "testEl".




)

return (
<>

<...large structure...>

} fileName="print-test.pdf">
{({ loading }) => (loading ? "Loading document..." : "Download now!")}


)
```

Can you tell me how I can do this using **react-pdf**? I just want to display the tag I need in a pdf document.
If this is not possible, **it would be a very useful feature in this plugin.**

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.