Open external link to PDF in new tab Blazor server - pdf

I'm trying to open a link (from a Blazor server app) to a pdf in a new tab but with no success.
The pdf isn't downloading and don't know why...is should be that simple.
Tryied different solutions. This is the code used for jsruntime solution. The other is a simple "a" tag link
await JSRuntime.InvokeAsync<object>("open", url, "_blank");
Opening a simple link is working but opening a link that downloads a pdf isn't.
It's a link to a ReportingServices server with the parameter "Format=PDF".
The link is as follows:
myserverURL/ReportServer/Pages/ReportViewer.aspx?%2fReportTools%2fMYREPORTNAME&rs:Format=PDF
I've saw that people are having same issue with pdfs.
Open PDF in new Tab - Blazor
Does anyone know what I'm doing wrong or have a solution to this?

Related

Website template popup feature doesn't work after downloading

I am looking at a website template with themewagon. There is a modal feature using magnific-popup that works on the live web version to display a video in a modal.
https://themewagon.github.io/videograph/
However, when I download the template and open the index file from my browser, the video modals do not function properly.
Can anyone explain why this may be the case?
I used the theme online, but when I downloaded it, the functionality was not there.

How do I add a link inside a PDF document that opens the same PDF in a user's default browser?

A client has asked that I include a "View in browser" link to a pdf attached to an email. This should open the same PDF in the user's default web browser. I have a PDF editor (PDFescape Desktop) that I can successfully use to add links to webpages, and it seems capable of opening files, and even executing javascript, though I've never tried it (I am proficient in JS though so that's an option if anyone has any ideas).
The only thing I can think of is to host the PDF somewhere and then link to it's location, but I'd rather not use a third party server if I can help it.
Is there any way to reference a link in a PDF to the same PDF the link exists in?

How to handle pdf files from server response?

I am working on React-Native mobile app and I need to handle pdf file coming from the server. The idea is when the user clicks on button, a request to the server is made and a pdf file is returned. My question is how to download and parse this file and show it to the user?
You can do it in app BUT you are going to have a lot of pain, especially with android devices.
My advice is using the Linking api and open a webbrowser:
https://facebook.github.io/react-native/docs/linking
The idea is to check if your url contains a .pdf. You can use a mix of:
https://lodash.com/docs/#includes
https://lodash.com/docs/#filter
https://lodash.com/docs/#split
When you are sure that your url is a pdf, you can use:
Linking.openURL(url);

Can we open pdf without using Google service

I need to open a PDF in my project, and I'm using Web-view to load the PDF URL with google service. It is working in the old version, in the new version it is opening in an external window of google PDF reader.
webview.loadUrl("http://drive.google.com/viewerng/viewer?embedded=true&url=" + "http://cateringkitchen.in/" + file);
My code looks like the above. I want my PDF to open in web view not in an external app of Google.

JavaFX WebVIew - PDF on popup window

I have posted some other smaller questions regarding the problem I describe below and got some feedback but now I will try to explain it in more depth hoping to get through the problem.
I built a desktop application using JavaFX 2.2 which uses a WebEngine to access a website built using Oracle ADF Pages. The application tracks the users actions on the pages and stores data to a database. All fine so far until the point where I need show a PDF file on a user click.
On the actual website the user clicks a button and a new popup window opens up that displays the PDF.
My problem is that due to the lack of PDF support in JavaFX I cannot display the pdf. The actual link to the PDF is dynamic and it doesn't have a .pdf at the end of it so I can't use the actual URL to send it to an external bowser or something to display it. Additionally the connection is secure so I can't open the URL with Chrome for example.
Possible solutions I thought about are to read the binary data of the response from WebView and create the PDF file locally and then open it using Adobe of Chrome or something. Is that possible at all?
Another solution I thought about (while I am writing this question) is maybe to open the URL which the users default browser but how can I go about sending the secure connection cookie from the application to the browser.
Is any of the above even possible? Am I missing something?
Any help, clues, links, ideas would be very much appreciated.
Thanks
I think the best way to do what you want is to download the PDF and display it locally.
Downloading using WebView sounds like it could work but I'm not familiar with the user experience. As an alternative try using curl or wget. You can pass in the authorization cookie to those tools and use them to download the file