Read the statement by Michael Teeuw here.
Slideshow for PDFs question
-
Hello. Trying to see if there’s a module that can show PDFs instead of pics. I know that there is the screen rotation module. Is there a document / pdf show and/or PDF slideshow in the modules. If so, what is the name so that I can research it? Thank you in advance.
-
@kochb1988 i have not seen a module that says it does this.
did u look thru the third party modules? (list linked in the top menu above) -
@sdetweil I have not seen a real good example of what I believe is needed. I’m looking at it 2 ways at once just in case. 1: A rotating MM screen (module exists) between a calendar and a pdf viewer (don’t believe it exists. 2: The ability to control the rotation of the screen. Such as: Always showing the calendar. But, when time for a presentation, the user can click something on-screen (with kb/mouse attached) that would switch the screen to the PDF and maaayyyyybe have the ability to control the PDF slide show.
-
@kochb1988 mmm-pages can do this
using the hidden page config for pdf module
but you need the pdf module
-
@kochb1988 here is a lib someone could use to create a module
https://www.npmjs.com/package/pdfjs-dist
the module would need to create a canvas element for the
library to draw in. not hard
use the getscripts: method to load the lib for browser access -
Challenge accepted :)
I had some time today so I sat down and created something. Maybe useful. I’ll upload some Asterix-pdf to my mirror.
I’m happy with this status. If anyone needs modifications create a pull request. I’m not happy with the fullscreen behavior since the scaling does not work as expected (fullscreen always uses the full width, so a full page display is not nice in landscape orientation). But I do not really need this.
-
@chrisfr1976 cool. why fullscreen or if set to fullscreen position?
can be sized w css
-
@sdetweil Hi, this is the rest of my tries to show the page in 100% in fullscreen mode. So if position is set to a fullscreen region then also the fullscreen flag must be activated.
-
@chrisfr1976 cool, should be possible to control in fullscreen w css.
in car, does this support url to pdf, or just local file?
(just local file) -
@sdetweil
Hi,
now also hosted PDF-files are supported. PDF with url have now the lead. The localpdfs/folder is the fall-back if no URL is set or in case of any errors.But:
Most remote PDF is being blocked due to Cross-Origin Resource Sharing restrictions. The server hosting the PDF (https://www.w3.org/… etc.) is not allowing MagicMirror to access its resource. So the server-side PDF is downloaded locally and saved in a folder. Once the file exists locally, the download isn’t performed again. So if the server pdf is updated then the local download must be deleted.- If a URL-PDF (or one single PDF) should be displayed change
displayTime: 10000,to a higher value (avoid flickering) - If a downloaded and local pdf should be displayed then copy or move the pdf from the
pdfURLtopdfsfolder and leave the URL in the config blank.
I think there are some optimizations in file handling possible and maybe a new PDF-URL can be sent with MMM-Remote module. But I won’t work on that any further. I will use the local folder in general (if I use the module at all - don’t know).
- If a URL-PDF (or one single PDF) should be displayed change
-
@chrisfr1976 have you looked at the cors server api we provide?
-
-
@chrisfr1976 not well documented and not 100%
http://mm_server:mm_port/cors?url=…,
sendheaders=…,
receiveheaders=…send/receive headers are headername:value,…
code in js/server_functions.js
for my readme support in mmm-config i had to fallback to curl/wget
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login