Viewer for PDF with jquery

Asked

Viewed 1,360 times

0

How do I open PDF in google Chrome by jquery without the need to install plugins? There is no need for source code, just as I should do. It can be a link and etc...

  • No PDF plugin can not open PDF. It is more or less want to hear sound without speakers. You would have to convert the PDF to HTML server like Gmail, Outlook, Office Web do and as jQuery only runs on client, there is no solution to your question.

  • @Marcosregis, I already got one, and I’m working on it. Tobymosque also sent me one that I haven’t had a chance to test yet, as I’m still testing what I had previously achieved.

2 answers

1

I created a link pointing to a pfd and used the option target="_blank" to open in a new tab.

Try:

<a href="https://gradcollege.okstate.edu/sites/default/files/PDF_linking.pdf" target="_blank">Clique aqui para ver o link</a>
  • The way you put it, if I disable the PDF Viewer, it does not open, it asks to download the file. What I want is something that opens in the browser(Chrome) the file and with the plugin disabled or not installed. I found something that does what I want and after testing I put the solution.

  • @pnet I did not understand why the personal would unlock the PDF Viewer and why you want to force you to see anyway.

  • Here’s the deal: The company has about 600 operators who need to see documents(reports) from customers while they are serving. The parent company (USA) does not want to approve Chrome and in Brazil, we need to submit reports in Chrome by force of customers and suppliers. These operators, many are third parties. So there is a "fight" here between our affiliate and the matrix and not to stop the work that has already been done (make the site work on Chrome), we are applying our plan "B", which is to use this jquery feature and circumvent the lack of the plugin.

  • Another thing, not that the staff will unlock. IT security staff already blocks everything and removes what is used in Chrome by Default. There is no crying, if it is Chrome there can be nothing in it, nothing at all. They leave no option for the user. User is only user even in the good sense of the word.

0

Marconi, let me see your example. So here I picked up on the internet, it worked, using a guy named Zohoviewer.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <script type="text/javascript" src="jquery.min.js"></script>
    <script type="text/javascript" src="jquery.zohoviewer.min.js"></script>
    <script>
        $('a.embed').zohoViewer();
    </script>
</head>
<body>
    <a href="Files/ISS.PDF" class="embed">Read PDF File</a>
</body>
</html>
  • Actually my solution didn’t work. Why? Because I went to the Chrome settings and there was a PDF Viewer plugin enabled. disabled and with the above feature, did not work. Active the plugin and works. Here in the company, most operators do not own the PDF Viewer plugin and look for a solution that works in "tapa" even, without plugin and without anything. Fine, I know, but I ask for help from colleagues.

  • The way, with the plugin disabled gives no error, just does not open the file, it suggests downloading the file to the machine.

  • I downloaded this link and it worked with the plugin disabled which is what I want. http://www.jqueryscript.net/other/Touch-enabled-jQuery-Web-PDF-Viewer-TouchPDF.html

  • have you thought about using the pdf.js? see if you can view the demo page of the same without the active plugin.

  • @Tobymosque, I’ll test it and on Monday, as it is, I’ll put it on. But the link I passed in the comment, it seems to solve the issue, but I need more tests.

  • @Tobymosque, apparently this is the guy we’re going to work with. Simpler use than the previous one I picked up and much more complete. We’re still working on it.

  • PDF.JS is maintained by Monzila and used as the default viewer in Firefox, so it is already a widely used PDF viewer.

Show 2 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.