PDF files preview in upload forms

13 hours ago 1
ARTICLE AD BOX

Goal is to display PDF file preview image. While for files that are stored in database we can generate preview on Backend, what can we do for newly added to form files? For now I see only three options and I am far not happy with any of them:

1. Upload files to some temporary storage and generate preview on backend. Seems complex and wont work well for large PDF files.
2. Use some JS library, [current solution] but it is 1 Mb (minified) javascript. So it is really massive script which u can hardly debug/fix in case of any error.
3. Use <iframe>/<embed> tag and play around with js/css to disable most features (possible?)

Is it all we have in 2025?

Read Entire Article