Js plug in way to open the PDF file of browser PDF plug in to share

  • 2020-03-30 01:00:10
  • OfStack

OK, that's it. Just write the address right.
What if I load the PDF in a div? Look at the official website, found that the embed() method can have parameters, no parameters refers to the body, there is a parameter is specific to a certain location.


<script type="text/javascript">
      window.onload = function (){
             var success = new PDFObject({ url: "sample.pdf" }).embed( " div the id " );
      };
</script>

Of course, there are further parameters you can set, such as how many seconds you want to preview, with CSS, without CSS, etc


Related articles: