Open PDF Document

1
Hello,  i want to open a PDF Document via a button, which is stored on a network folder and  for each order there is a separate folder with the PDF. It can be opened by path via e.g. chrome or edge or via acrobat reader.  I'm stuck right now, the normal link which is stored in the browser when you open the PDF in Chrome, can not be opened via Mendix. Can you help me further?   Thanks
asked
5 answers
3

Hi Jannik Kimm,

I understand that you need to open the pdf in your browser (Chrome or edge) by clicking a button from mendix and you have the folder link. If I’m right then please check the link button (i.e) select ‘open link’ on click action.

Hope this helps!

 

Thanks.

answered
1

You could look at using the HTMLSnippet widget from the Marketplace and directly entering HTML so it renders on the page. You could add a direct link to the file in this case. e.g.

 

<a href="file://yourfilename">View File</a>


You would need to add styling yourself, but it should work as long as all the users of your application have access to the same file storage on their local machines.

Hope this helps.

answered
0

Thanks for the answer. 
But, if I copy the path for the file from chrome and then paste it there as  link in the button and then click on the button in the application, nothing happens, it does not open a new tab etc. (see first screenshot)
As an example I have entered google.com as a link. A new tab is opened, but the link cannot be loaded because "localhost" is placed in front of it. (see 2,3 screenshot)
Do you know a solution for this? how mendix can open the "file.." path? or do you know another solution?

answered
0

You could use the URL redirecter widget from the marketplace.

https://marketplace.mendix.com/link/component/118716

 

You create an empty page and place the widget on the page.

In your microflow you create a temp object where you store the URL in. The next action would be to open the page with the page context of the temp object.

 

So your button should call a microflow, where you create the object and open the page.

That way, the URL should be opened in a page.

Hope this helps!

answered
0

Same problem as before with the path (file://...) does not open. And at www.google.com again "localhost" is put in front of it. any other ideas?

 

answered