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.

Open renderer link on new window

See original GitHub issue

Excellent library

Would it be possible to add the ability to make the rendered link in the pdf open in a new window

Something like <Link src={"www.google.com"} target={"_blank"}>{"Google"}</Link>

Apologies if this is already possible couldn’t see from the documentation

Thanks

Finbar

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:16

github_iconTop GitHub Comments

5reactions
psnfrenchcommented, Dec 19, 2019

I would love to see this functionality too. As @finbar123 describes, I would like the link that is rendered inside the pdf to have target="_blank" so clicking on the link from within the rendered pdf opens a new tab.

Note: this is different functionality from opening the entire pdf document in a new tab as described by @jp06

2reactions
SomnathKadamcommented, Jun 10, 2020

If you need to open generated pdf on new window, without click on download link, use below code

const PrintDoc = ({ values }) => (
    <Document>
        <Page size="A6" style={styles.page}>
            <View style={styles.section}>
                <Text>Section #1</Text>
            </View>
             
        </Page>
    </Document>
);

const openPDF = (url) => {
    window.open(url, '_blank');
};

export const PDFPrint = () => {
    return (
        <PDFDownloadLink document={<PrintDoc />} fileName="somename.pdf">
            {({ blob, url, loading, error }) =>
                loading ? 'Loading document...' : openPDF(url)
            }
        </PDFDownloadLink>
    );
};
Read more comments on GitHub >

github_iconTop Results From Across the Web

Opening windows from the renderer | Electron
Opening windows from the renderer. There are several ways to control how windows are created from trusted or untrusted content within a renderer....
Read more >
How to open new window in electron using ... - Stack Overflow
I have an angular application which is wrapped as electron app. Now when, in the renderer process I call Window ...
Read more >
How to Open Links in a New Window or Tab in Multiple CMSes
Learn how you can manually set external links to open in a new tab or window in no matter which CMS you use...
Read more >
Window.open() - Web APIs | MDN
The Window interface's open() method takes a URL as a parameter, and loads the resource it identifies into a new or existing tab...
Read more >
Can External Links open in a NEW tab / Window
1 answer · All links in the editor (i.e. the mode where you can see a toolbar and insert content) will open in...
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