1

I am new to react and I need to create a react component to open a pdf file. The pdf document will be opened through a link. I did some research and checked some posts on stackoverflow. e.g Create PDF file from HTML text React But this one converts from html to pdf and what i need to do is just open a pdf document.

Is there any article or posts online that could help me? Any help is appreciated

JulienD
  • 7,102
  • 9
  • 50
  • 84
mike
  • 345
  • 2
  • 8
  • 19
  • React has nothing to do with opening files. Search for the same thing without the "react" keyword and display the result in whatever
    your React code renders.
    – JulienD Dec 08 '17 at 00:21

1 Answers1

0

If the url of the pdf is not "cross-origin" you could use the "PDFJS" library to render the PDF in the browser.

Siggy
  • 324
  • 2
  • 11