[pdfJS Viewer Reactive] Preview a PDF that is stored in the database
Forge component by Eduardo Jauch
Application Type
Reactive

I am trying to display in a screen a pdf that is stored in a db table.

I tried to pass the url of a REST that returns the pdf content as a binary but didn't work. Is there a way of achieve what i want?

Hi André,

You can preview a PDF file in react apps using an iframe:

For this, you need to convert your binary to Base64 using this function:


Regards,

Paulo


@Paulo Cação I did that and now i'm getting this error:

414 Request-URI Too Large

No I can't.

Basically what i am doing is using a data action to get the binary and converting it to base64 and then pass it to the iframe. 

I did this but continues without working. Shows the same error...

did u get the solution for this.can u share oml

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.