• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

PDF Implementation

Scheduled Pinned Locked Moved Utilities
10 Posts 4 Posters 3.1k Views 5 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    JohnDelta @ember1205
    last edited by Dec 14, 2019, 10:55 AM

    @ember1205 so I’ve tried. But that’s just a few unnecessary steps to take once a week so I find.
    And also what I have done for now is using the MMM-GooglePhotos. I created an album where there is always simply one file supposed to be inside (the latest) and it pulls it down from there.
    But the issue I’m facing with that method except it just being a bit complicated is also that every now and then the picture fades out and in (Pic - Black - Pic) which is kinda annoying as well.

    so thx there for an idea as well : )

    {
    			module: "MMM-GooglePhotos",
    			position: "middle_center",
    		config: {
    albumId: ["ALBUM_ID"], // your album id(s) from result of `auth_and_test.js`
    				// refreshInterval: 1000*60,  
    				// ! scanInterval: 1000*60*10, // too many scans might cause API quota limit also.
    
    				sort: "time", //'time', 'reverse', 'random'
    				showWidth: "50%", 
    				showHeight: "650px",
    				originalWidthPx: 2339, 
    				originalHeightPx: 1653, 
    				mode: "hybrid", // "cover" or "contain" 
    					}
    		},
    
    E 1 Reply Last reply Dec 14, 2019, 1:51 PM Reply Quote 0
    • J Offline
      JohnDelta @BD0G
      last edited by Dec 14, 2019, 11:10 AM

      @BD0G hey thx mate. That sounds very good.
      I’ll try that out.

      However regarding the latest file is where I’m still having some problem solving to do.
      The thing is that I want on Google Drive to have a folder where a few people have access to. I want them to be able to just delete the old file and drop the new file there (with the same file name or what ever action they have to do).
      Now here is the problem. Drive gives each file a new ID so the thing with a static file Name doesn’t work unfortunately.

      1 Reply Last reply Reply Quote 0
      • E Offline
        ember1205 @JohnDelta
        last edited by Dec 14, 2019, 1:51 PM

        @JohnDelta said in PDF Implementation:

        @ember1205 so I’ve tried. But that’s just a few unnecessary steps to take once a week so I find.

        That was why I had mentioned doing it with ‘convert’ from ImageMagick - you can script it and then make it into a cron job. Pull the PDF down to the local device, detect that it’s a different PDF (not necessary), and run the convert tool to make it into an image file stored someone on the local filesystem. Done.

        1 Reply Last reply Reply Quote 0
        • B Offline
          BD0G
          last edited by Dec 14, 2019, 6:46 PM

          If others load one .pdf file to the google drive and then delete all other files in that directory well then the file extension would still be .pdf (right) ? So then one could script it using *.pdf (file that ends in .pdf)

          So whatever actions that were taken were performed upon a file that ended with .pdf

          The file name becomes inconsequential. Just grab all .pdf files (as there will only be one) , download them to a specific directory you create on a local system (ftp sounds like it may be a good option for this) and then use the convert action that @ember1205 speaks of within ImageMagick, upload back to Google Drive via ftp and then (damn! Google Drive will then rename it with another file ID and then the URL that is within the config.js that points to the url will be broken and not display -ugggggg) . I think I understand now.

          Here is a Google Chrome Add on that allows one to Overwrite the same file without changing the file name. It “may” be helpful?
          https://chrome.google.com/webstore/detail/drive-overwrite-file-repl/llanhaaigblafdecdihpppjaeekpddfl?hl=en-US

          It really sounds like you may have to delve into Google App Script to accomplish this. https://developers.google.com/apps-script

          If you have questions about using this scripting tool then I think there is support over on www.stackoverflow.com

          I am not a Google Script Coder so I cannot be of any help there.

          E J 2 Replies Last reply Dec 15, 2019, 2:10 AM Reply Quote 0
          • E Offline
            ember1205 @BD0G
            last edited by Dec 15, 2019, 2:10 AM

            @BD0G said in PDF Implementation:

            If others load one .pdf file to the google drive and then delete all other files in that directory well then the file extension would still be .pdf (right) ? So then one could script it using *.pdf (file that ends in .pdf)

            So whatever actions that were taken were performed upon a file that ended with .pdf

            The file name becomes inconsequential. Just grab all .pdf files (as there will only be one) , download them to a specific directory you create on a local system (ftp sounds like it may be a good option for this) and then use the convert action that @ember1205 speaks of within ImageMagick, upload back to Google Drive via ftp and then (damn! Google Drive will then rename it with another file ID and then the URL that is within the config.js that points to the url will be broken and not display -ugggggg) . I think I understand now.

            Here is a Google Chrome Add on that allows one to Overwrite the same file without changing the file name. It “may” be helpful?
            https://chrome.google.com/webstore/detail/drive-overwrite-file-repl/llanhaaigblafdecdihpppjaeekpddfl?hl=en-US

            It really sounds like you may have to delve into Google App Script to accomplish this. https://developers.google.com/apps-script

            If you have questions about using this scripting tool then I think there is support over on www.stackoverflow.com

            I am not a Google Script Coder so I cannot be of any help there.

            Download from Google drive to the MM device. Convert. Store converted file locally. Load local file.

            Less complicated than downloading, converting, pushing back up, figuring out new ID, etc.

            1 Reply Last reply Reply Quote 0
            • J Offline
              JohnDelta @BD0G
              last edited by Dec 20, 2019, 3:18 PM

              @BD0G said in PDF Implementation:

              If others load one .pdf file to the google drive and then delete all other files in that directory well then the file extension would still be .pdf (right) ? So then one could script it using *.pdf (file that ends in .pdf)

              So whatever actions that were taken were performed upon a file that ended with .pdf

              The file name becomes inconsequential. Just grab all .pdf files (as there will only be one) , download them to a specific directory you create on a local system (ftp sounds like it may be a good option for this) and then use the convert action that @ember1205 speaks of within ImageMagick, upload back to Google Drive via ftp and then (damn! Google Drive will then rename it with another file ID and then the URL that is within the config.js that points to the url will be broken and not display -ugggggg) . I think I understand now.

              Here is a Google Chrome Add on that allows one to Overwrite the same file without changing the file name. It “may” be helpful?
              https://chrome.google.com/webstore/detail/drive-overwrite-file-repl/llanhaaigblafdecdihpppjaeekpddfl?hl=en-US

              It really sounds like you may have to delve into Google App Script to accomplish this. https://developers.google.com/apps-script

              If you have questions about using this scripting tool then I think there is support over on www.stackoverflow.com

              I am not a Google Script Coder so I cannot be of any help there.

              Thank you buddy.
              I still haven’t really found a way that works but the Chrome Addon did actually help me in another case as well.

              I’m now going to try to connect google drive with the Pi via rclone4pi and then somehow try to adapt the thoughts from @BD0G with creating a script that converts them into .jpeg and moves the images into a specific folder.
              (Happy for any help since I’m not a coder at all)

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              1 / 1
              • First post
                9/10
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy