#PDF LOAD ON HTML WITH BACK END. (RED.PDF/ GREEN.PDF/ YELLOW PDF.)
41 messages · Page 1 of 1 (latest)
ok
when i type the name it will load the pdf ember on html
in order to work u need to make a script on backend
post and get.
i already helped u on half ans
i asked the javamastry server they are (selfish. only help themself. call themself master. random ban people whos unfit) fake
Looks like you already know how to read the file, you just need to pass the bytes back to the front-end now right?
One way I've done that in the past is by serialising the bytes as base64 and sending it to the front-end in the HTTP response.
do u want the example file i can sent to u
Nah, don't really need it.
What I can think of:
- validate the user input,
- grab the file from fs,
- serialise it to base64 (nodejs might do this for you),
- respond with the value,
- modify the iframe src attribute to be
data:application/pdf;base64, bytes...wherebytes...is the value you returned from the back-end
Not the best way but it'll work.
If these are stored as assets that the front-end can directly access, I don't see any reason why you can't just avoid the back-end entirely though.
i have to be backend postion. cuz hiding thoses file in server.
You could also provide a path to file in the response. Then the front-end requests from that in the iframe.
That will require you to tell the client how to read your PDF via content headers.
Really not sure exactly what you're trying to build overall so I'm just going off what I've got.
what if i put alot pdf on that front end like thousand of pdf on front end. no issue load time?
Not until you load the pdf
Might be some initial startup time on the web server depending on implementation
You can always benchmark it if you need to.
@atomic sphinx i am able to load my pdf html with back end without base64