I am using the below code to open a pdf file but its not working-
<iframe src="file:///C:\Users\Downloads\0895custbill08132015.pdf" style="height: 638px;" frameborder="0"></iframe>
For a google doc the below code is working fine, I am not sure what is required to open a locally saved doc.
<iframe src="://webshire-aioopsss/pdfs/sample_contract.pdf&embedded=true" style="height:638px;" frameborder="0"></iframe>
I am using the below code to open a pdf file but its not working-
<iframe src="file:///C:\Users\Downloads\0895custbill08132015.pdf" style="height: 638px;" frameborder="0"></iframe>
For a google doc the below code is working fine, I am not sure what is required to open a locally saved doc.
<iframe src="http://docs.google./gview?url=http://webshire-aioopsss./pdfs/sample_contract.pdf&embedded=true" style="height:638px;" frameborder="0"></iframe>
Share
Improve this question
edited Aug 20, 2015 at 16:33
Teemu
23.5k7 gold badges59 silver badges111 bronze badges
asked Aug 20, 2015 at 16:33
Saurabh DwivediSaurabh Dwivedi
391 gold badge2 silver badges3 bronze badges
1
- missed the code- 1. iframe src="file:///C:\Users\sd\Downloads\0895custbill08132015.pdf&embedded=true" style="height: 638px;" frameborder="0" 2. iframe src="docs.google./gview?url=http://aaux-playground./pdfs/…" style="height:638px;" frameborder="0" – Saurabh Dwivedi Commented Aug 20, 2015 at 16:34
3 Answers
Reset to default 2Most browsers won't let you open a locally stored file from a website for security reasons. Typically I will host the file on an IIS server and then retrieve it from there (which is what you're doing when you're retrieving it from googledoc).
You are using backslashes in your src
. Please change them to slashes
<iframe src="file:///C:/Users/Downloads/0895custbill08132015.pdf" style="height: 638px;" frameborder="0"></iframe>
You can use var pdf = $('\<\object type="application/pdf">'); pdf.attr('data', "you pdf scr"); append it in your iframe..