Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

disable all button on right corner
(1 viewing) (1) Guest
"ARI Fancy Lightbox" WordPress plugin
Go to bottomPage: 1234
TOPIC: disable all button on right corner
#64316
disable all button on right corner 5 Years, 2 Months ago Karma: 0
HI,

It works perfectly to read pdf doc in light box but I need to disable the button "rotate", "download" and "print" button.

Could you advise how it can be done?

Thanks
Last Edit: 2019/01/05 07:46 By terencewp.
The administrator has disabled public write access.
 
#64318
Re:disable all button on right corner 5 Years, 2 Months ago Karma: 746
Hello,

It is not possible because you use native PDF viewer. It is loaded via browser's plugin and doesn't provide any API to hide the buttons.

If you show local PDF files which are hosted on your site then PDFJS viewer can be used. See "ARI Fancy Lightbox -> Settings -> Integration -> PDF Files -> Local PDF viewer" parameter. Add the following code to "Advanced -> Custom JS code" parameter to hide the buttons:

Code:


$(document).on('afterLoad.fb', function(e, instance, current, firstRun) {
  if (current.contentType === 'pdf') {
    current.$iframe.off('load.pdf').on('load.pdf', function() {
       current.$iframe.contents().find('.toolbarButton.print, .toolbarButton.download, .secondaryToolbarButton.rotateCw, .secondaryToolbarButton.rotateCcw').hide();
    });
  }
});



Regards,
ARI Soft
The administrator has disabled public write access.
 
#64338
Re:disable all button on right corner 5 Years, 2 Months ago Karma: 0
Thanks and I now switched to "pdfjs" but I found other buttons there too.
Could you help and advise how I can disabled them all...thx!
drive.google.com/file/d/1V_TSfuEVgCdIvD7JBkJ2MIiteTxyT2YH/view[/img]
drive.google.com/open?id=1jRnQqx07xvYmU0rGzDT6CLH3I-BNL9zK[/img]
Last Edit: 2019/01/08 08:43 By terencewp.
The administrator has disabled public write access.
 
#64340
Re:disable all button on right corner 5 Years, 2 Months ago Karma: 746
If you want to hide toolbar, populate "Advanced -> Custom JS code" parameter with the following code:

Code:


$(document).on('afterLoad.fb', function(e, instance, current, firstRun) {
  if (current.contentType === 'pdf') {
    current.$iframe.off('load.pdf').on('load.pdf', function() {
       var doc = current.$iframe.contents();
       doc.find('.toolbar').hide();
       doc.find('#viewerContainer').css('top', 0);
    });
  }
});



Regards,
ARI Soft
The administrator has disabled public write access.
 
#64402
Re:disable all button on right corner 5 Years, 2 Months ago Karma: 0
The administrator has disabled public write access.
 
#64403
Re:disable all button on right corner 5 Years, 2 Months ago Karma: 746
Could you provide a link to a page where the problem occurs?

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1234