Scribd setPage function is not working

225 Views Asked by At

I have integrated scribd document viewer to my website but setPage function is not working

Can you help me to view only the first 2 pages in the document please look into in the below

url and help me to find the solution.

<div id='embedded_doc' ><a href='http://www.scribd.com'>Scribd</a></div>

<script type="text/javascript">
  var url = 'http://nskfix.com/dev/waleed/webupload/upload/2011_Dam-Sluice-Gate-Walkway-Slabs.pdf';
  var pub_id = 'pub-07535389025944280985849137';
  var scribd_doc = scribd.Document.getDocFromUrl(url, pub_id);

  var onDocReady = function(e){
    scribd_doc.api.setPage(1);
  }
 

  scribd_doc.addEventListener('docReady', onDocReady);
  /*scribd_doc.addParam('jsapi_version', 2);*/
  scribd_doc.addParam('height', 600);
  scribd_doc.addParam('width', 760);
  /*scribd_doc.addParam('public', true);*/
  
  scribd_doc.addParam( 'auto_size', true );
  scribd_doc.addParam('hide_disabled_buttons', true);
  scribd_doc.addParam('disable_resume_reading', true);
  scribd_doc.addParam( 'jsapi_version', 2 );
  scribd_doc.addParam( 'allow_share', false );

  scribd_doc.write('embedded_doc');
</script>

1

There are 1 best solutions below

0
On

This may be too late to answer your question but it might help somebody else.

I have the same problem but I can get it working by using the seamless method instead of write.

Replace:

scribd_doc.write('embedded_doc');

With:

scribd_doc.seamless('embedded_doc');

I think very few people are using the JS API.

Their own example isn't working at this time due to it trying to load the http version of thier API instead of the https version: https://www.scribd.com/developers/js_api_example