Rare Earth Juejin Tech Community
Aug 6, 2024 · Frontend Development
How to Preview and Download HTML Returned from an API Using React and Vue
This article explains how to fetch an HTML string from an API and display it either via an iframe or by rendering the HTML directly in React or Vue, and provides multiple download options—including saving the raw HTML, capturing an image with html2canvas, and generating a PDF using jsPDF.
HTML previewReactVue
0 likes · 12 min read