Can not print PDF insert into HTML - html

I have an html document and i inserted a pdf file with:
<iframe id="fred" style="border:1px solid #666CCC" title="PDF in an i-Frame" src="C:test.pdf" frameborder="1" scrolling="auto" height="100%" width="100%" ></iframe>
I can visualize my document and the pdf, but when i try to print it or send it by email, the pdf is not there anymore.
How can I make for don't lose the pdf file in any action I do with the document or if i want to open the file in a different server or different computer?
Thanks

Try it with Google Drive:
Go to drive.google.com
Upload the file
Embed it on your website

Related

Displayed a document word , xlsx and pptx in <embed></embed> as file pdf

i'm trying to create frame in my page web where the document can be displayed as a file pfd it work properly using
<embed src="/pdf/../" type='application/pdf' ></embed>
Have you any idea about how to make a file .docx , .pptx and .xlsx be displayed in browser such as a pdf .. and the file is saved on my local
i trying to use this one:
<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=[path to the file]' ></iframe>
but unfortunately this one need googleDrive or one drive.
I need one that can be using for files saved in my local.

Prevent to download pdf using embed tag

I'm using php, I'm creating a detailed view page of a profile, which has a pdf document, I use the embed tag to display it, but when opened it does not display the pdf file and Automatically download the file. Therefore the user can not see the pdf file displayed.
<embed src="/vh/assets/image/java.pdf" type="application/pdf" width="500" height="500"/>
Is there a way to solve this problem?
PDF documents are not supported as a src in the HTML <embed> tag.
You can get around this issue by using the Google Chrome PDF viewer as the embed `src.
<embed
src="https://drive.google.com/viewerng/viewer?embedded=true&url=http://yourdomain.com/vh/assets/image/java.pdf"
width="500"
height="500"
/>
Note that your url in the src cannot be relative /vh/assets/image/java.pdf, it must be the full url http://yourdomain.com/vh/assets/image/java.pdf.
There also exist some third party libaries such as PDF.JS.
You can refer to w3schools embed tag,It is an html single tag,I can display pdf normally in chrome and firefox.Maybe you can check if your src is correct.
You can try below snippet #toolbar=0 helps disabling the options
<embed id="myObject1" src="file:///C:/Downloads/OoPdfFormExample.pdf#toolbar=0" type="application/pdf" width="1000px" height="600px">
This will disable download, print and other option of pdf viewer on browser

Load embedded Facebook post inside iframe in local html file

I'm trying to load facebook posts inside a local html file by html code provided via Facebook post's 3 dot menu "..." -> Embed button.
It looks something like this.
<iframe src="https://web.facebook.com/plugins/post.php?href=https%3A%2F%2Fweb.facebook.com%2F20531316728%2Fposts%2F10154009990506729%2F&width=500" width="500" height="313" style="border:none;overflow:hidden" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
When it's on server it works properly, but when loaded from a local html file, I'm getting "This Facebook post cannot be loaded." message.
I need to load it locally. Any ideas?

Inserting my pdf in my blogs

I have a posts page which stores every individual blog. And each blog has a pdf file. I can upload the pdf via the blog page but when I execute my code through the for-loop on posts - post.file_doucment_path it just shows the pdf file location. Do I need to add a seperate js pdf reader package to get it working? Cheers.
HTML5 <object> element can embed PDFs in a page without an external library.
<object data="the.pdf" width="1000" height="1000" type='application/pdf'/>
Just replace "the.pdf" with your file document path with Jekyll syntax.
e.g.
<object data="{{ post.file_document_path }}" width="1000" height="1000" type='application/pdf'/>

Why .doc automaticly downloads, but not shown in <iframe>?

The problem is - when I input url with .png or .pdf it has been shown in iframe>. I can scroll it, read etc.
But when I insert an url which has docx or xls file (ex. "http://www.exampleimage.docx") - it automatikly aploads by browser, and not shown in iframe>.But i want to see content of .docx file in iframe like i do with pdf.
What to do or where to search guys?
here is part of my code:
<iframe src={{attachmentUrl}} width="468" height="468" frameborder="0">
Click on attachment please.
</iframe>
You can edit your url i.e,
"https://docs.google.com/gview?url=${YOUR_URL}&embedded=true" and then add to iframe:
<iframe
className="doc"
src={`https://docs.google.com/gview?url=${YOUR_URL}&embedded=true`}
/>