AgP42 / MMM-SmartWebDisplay

The `MMM-SmartWebDisplay` module is for MagicMirror². It allow to display any web content to your MagicMirror.
60 stars 15 forks source link

Unable to Access local .pdf/.txt files on Raspberry Pi #16

Closed pandeyprakhar00 closed 4 years ago

pandeyprakhar00 commented 4 years ago

Hi,

I tried opening .txt & .pdf files by typing the following commands in url section : file:///home/pi/Desktop/File.pdf

Assuming that i have the file placed on Desktop named "File.pdf" In the debug window i got the following message : GET http://0.0.0.0:8080/home/pi/Desktop/File.pdf 404 (Not Found)

Please correct me if i am making any mistake. Thanks in advance ! :-)

AgP42 commented 4 years ago

Hello,

I never try something like that, but I will be surprised that it can work !

Try to put your pdf file into google doc (or another web service) and use that link into the MagicMirror, probably better chances !

More globally my module is using iFrames, so you can also ask google how to display pdf files within an iFrame, it can gives you some advices.

Let me know !

Bye, AgP

pandeyprakhar00 commented 4 years ago

I tried using google drive, However got this message :

Refused to display 'https://drive.google.com/file/d/1TxK9d4JswiPOuCFZ1XL0e3MKY6CJNaSj/view?usp=drive_open' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

I will google some other options and let you know.

pandeyprakhar00 commented 4 years ago

Tried various options but none of them seems to work for me..

AgP42 commented 4 years ago

Ok then sorry, it is probably not compatible with pdf !

pandeyprakhar00 commented 4 years ago

I got a work around for pdf's, first we need to upload the PDF to

Yumpu.com

And then copy the embed link.. it's works for me.. :-)

AgP42 commented 4 years ago

great, good to know ! ;-)