This article is a mirror article of machine translation, please click here to jump to the original article.

View: 4432|Reply: 2

[HTML/HTML5] HTML uses an iframe to preview a base64 encoded PDF file

[Copy link]
Posted on 4/22/2024 9:04:04 AM | | | |
Requirements: Preview the generated PDF file on the web page, the file content is base64 encoded, it is a bit heavy to use PDF.js at first, and its practical browser can come with the PDF reader.

PDF.js:The hyperlink login is visible.

HTML previews the base64 encoded PDF file using an iframe, and the source code is as follows:

Format:

The effect is as follows:





Previous:CentOS 7 error libstdc++.so.6: version 'GLIBCXX_3.4.20' not found
Next:.NET Core projects do not display a warning
 Landlord| Posted on 6/17/2024 8:53:06 AM |
If the file is too large, the browser will simply display a blank space

It is recommended to output byte[] directly, the code is as follows:

 Landlord| Posted on 4/16/2025 9:40:36 AM |
Mozilla-based PDF.js preview PDF document
https://www.itsvse.com/thread-10991-1-1.html
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com