[ pdfJSviewer]A Basic question about pdfJSviewer

[ pdfJSviewer]A Basic question about pdfJSviewer

  

Hi everyone,


And may I ask could the pdfJSViewer disable the download function? 

Thanks very much.

Hi Eva,

You should ask this question in the component's Support forum... that way the team behind it will be notified and reply more promptly.

Regardless, achieving what you want is possible by modifying the html of the viewer:

  1. add the "hidden" class to the elements you want to disappear, although this doesn't really remove them, just hides them from view;
  2. if you want to remove them that is more complex, as you will need to not only remove the html code but also remove every single place in the Javascript code where that element is being used.

As for 1. I'm going to check how complex is it to make the component more flexible, but for 2. I can tell you it's not something that makes sense adding, it would basically require two different components with the same OutSystems logic, just different JS scripts to support them. If that's the solution you need, I advise you to fork the pdfJS Viewer component, create your own by making the required changes and publish it to the Forge, giving credit to the original component and also clearly stating what are the differences that justify the fork.

HI Jorge Martins,

  I will ask in the component's Support Forum next time,

Thanks for your solution, I have to put the code into the viewer.html, However I can't edit the viewer.html in the resource.

Is there have any way I can change it? 

Thank you

<script>
$(function(){
    $('#download').hide();
});
</script>



You should ask this question in the component's Support forum... that way the team behind it will be notified and reply more promptly.

Regardless, achieving what you want is possible by modifying the html of the viewer:

  1. add the "hidden" class to the elements you want to disappear, although this doesn't really remove them, just hides them from view;
  2. if you want to remove them that is more complex, as you will need to not only remove the html code but also remove every single place in the Javascript code where that element is being used.

As for 1. I'm going to check how complex is it to make the component more flexible, but for 2. I can tell you it's not something that makes sense adding, it would basically require two different components with the same OutSystems logic, just different JS scripts to support them. If that's the solution you need, I advise you to fork the pdfJS Viewer component, create your own by making the required changes and publish it to the Forge, giving credit to the original component and also clearly stating what are the differences that justify the fork.



Eva,

I've uploaded a new version of the pdfJS Viewer component. The latest one supports not only hiding those right-side buttons but also embedding the viewer in another screen.

For embedding, just make sure you place the component in a container with explicit width and height.