Home  >  Q&A  >  body text

Just display local PDF file in React web application

I'm making a portfolio website for myself as a React web app. I would like to have a resume page on the website that only displays my resume. When I originally made the HTML version of the site, I was able to use iframes to achieve this.

When I try this in React, the iframe displays a copy of the currently displayed page instead of my pdf. Is there an easy way to display a locally saved pdf in a web application?

P粉653045807P粉653045807209 days ago341

reply all(2)I'll reply

  • P粉007288593

    P粉0072885932024-02-26 13:51:39

    You can use the built-in <embed> tag in HTML.

    For example, the following format displays a pdf document at the given path with a width of 150% and a width of 650 pixels.

    You can adjust the width and height as needed.

    reply
    0
  • P粉356128676

    P粉3561286762024-02-26 00:28:14

    Any browser « Use _Embeddable Google Document Viewer to embed PDF files into iframes.