0

I have a PDF connected to point feature in a desktop project in QGIS and activating the Action on the point opens the PDF perfectly. I tried publishing this with QGIS2Web. The PDF is moved to the webmap directory but the Action no longer works.

I used the cmd /c "[%Path%]" action to open the PDF in the %Path% thinking that it would open with any default application on the user end.

Is this Open PDF action even available to the Leaflet map? If so how?

1 Answer 1

2

You can do this with both openalyers and leaflet export.

Create a text field in your layer and write a string like this.

<a href="NTA_ENTE.pdf" target="_blank">NTA_ENTE.pdf

enter image description here

Insert pdf into exported folder

enter image description here

The popup will show the link as clickable and when clicked it will open a new browser tab showing the PDF. openlayers:

enter image description here

leaflet:

enter image description here

2
  • I had to add a path to the image folder: <a href="images/NTA_ENTE.pdf" target="_blank">NTA_ENTE.pdf But with that it worked great!
    – Mikeoramma
    Commented May 24 at 20:46
  • If the answer is correct please mark it as such. I also ask you to evaluate to support the project by donating a virtual coffee through the button on the GitHub home page. thanks.. Commented May 25 at 21:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.