Manually fetching data in binary data #1409
-
Hi everyone, I want to use the react-pdf components however I want to manually fetch the data myself. In my current project we have some functionality where we manually update the pdf resource via a file input with React Query. To make the whole experience better I want to manually control the data myself. Is it possible to manual provide binary data myself ? Any comments or feedback is appreciated. Thanks Alex |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, absolutely. You can pass |
Beta Was this translation helpful? Give feedback.
Yes, absolutely. You can pass
file={myFile}
wheremyFile
is a memoized object structured like this:{ data: Uint8Array }
. You can also use other kinds of binary data, but Uint8Array should work best.