question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to open rendered PDF in a new tab

See original GitHub issue

OS: macOS High Sierra

React-pdf version:@react-pdf/renderer”: “^1.0.0-alpha.17”,

Description: I am currently using PDFDownloadLink to download the PDF but is there an alternative way to open the rendered PDF in a new tab instead of downloading it? Maybe with <BlobProvider />?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

16reactions
timbickercommented, Sep 16, 2020

Hi, Is it possible to change the url? E.g. I don’t want the document to be called 9b6cd832-4ae8-487c-a71a-0961709dd364.pdf when I click on save. I prefer to call it something based on the user attributes e.g. username.pdf. Thanks

16reactions
diegomuracommented, Sep 26, 2018

Hey! You can easily do that using the <BlobProvider /> as you suggested:

<BlobProvider document={MyDoc}>
  {({ url }) => (
    <a href={url} target="_blank">Open in new tab</a>
  )}
</BlobProvider>

Hope this helped!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Opening a new tab to read a PDF file - Stack Overflow
There is no way to force a user's browser to open a PDF file in a new tab. Depending on the user's browser...
Read more >
How to open PDF file in new tab using ReactJS - GeeksforGeeks
This article is related to opening a PDF file in a new tab in the web browser in React.js on a click of...
Read more >
rendered pdf report to be open in new tab - Oracle Communities
all i need to open my rendered report in new tab, i have to through examples but no ... p_out_filename => apex_util.url_encode('test.pdf'),.
Read more >
How to always open PDF files in new tab? (with built ... - Reddit
Might try going to Tools -> Settings -> General and under the applications tab, set PDFs to Always Ask. Then, when the dialog...
Read more >
How do you open an internal Canvas PDF file in a new tab
...which would probably by OK for the instructor since it would look pretty similar to a browser-rendered PDF, gets pre-empted and changed by ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found