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.

    Print

    Scheduled Pinned Locked Moved Unsolved Requests
    11 Posts 2 Posters 3.1k Views 2 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.
    • A Offline
      Alexandre-Venditti69 @sdetweil
      last edited by

      @sdetweil i think if you use that, then u would have to add code to that to get to the image…
      Of course, bugsounet told me i ve have to add console.log(payload) on the notification.
      i ve start to write a new fonction in Ext-Selfies.js, and his node_helper.
      texte du lien this exemple script print on défaut printer , but how i can writte it to resolve the payload

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @Alexandre-Venditti69
        last edited by sdetweil

        @Alexandre-Venditti69 console.log(notification)
        will dump out the structure of the notification object so u might find the url there

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        A 1 Reply Last reply Reply Quote 0
        • A Offline
          Alexandre-Venditti69 @sdetweil
          last edited by sdetweil

          @sdetweil

          showLastPhoto: function(result, sendResult = true, showLastOnly = false) {
              var autoValidate = showLastOnly ? true : result.options.autoValidate
              this.IsShooting = true
              var con = document.querySelector("#EXT-SELFIES")
              con.classList.add("shown")
              var rd = document.querySelector("#EXT-SELFIES .result")
              rd.style.backgroundImage = `url(modules/EXT-Selfies/photos/${result.uri})`
              rd.classList.add("shown")
              if (autoValidate) {
                if (this.config.usePreview) {
                  var preview = document.querySelector("#EXT-SELFIES .preview")
                  preview.classList.remove("shown")
                }
                setTimeout(()=>{
                  this.lastPhoto = result
                  if (sendResult) this.sendNotification("EXT_SELFIES-RESULT", result)
                  this.closeDisplayer()
                }, this.config.resultDuration)
              }
            },
          
            validateSelfie: function(result) {
              var preview = document.querySelector("#EXT-SELFIES .preview")
              preview.classList.remove("shown")
              var pannel = document.getElementById("EXT-SELFIES-PANNEL")
              pannel.classList.add("shown")
          
              var sendIcon = document.getElementById("EXT-SELFIES-SEND")
              sendIcon.onclick = ()=> {
                this.lastPhoto = result    // Sauvegarde le selfie en local
                this.sendNotification("EXT_SELFIES-RESULT", result) // Envoi la notif pour EXT-SSender
                this.closeDisplayer()
              }
          

          Dans cette partie, j’ai rajouté à SendIcon :

          this.sendSocketNotification("printResult", payload)
          
          Mon node helper reçoit cette notification et exécutera printResult  function (payload) {}
          

          Est ce un bon début ?

          S 1 Reply Last reply Reply Quote 0
          • A Offline
            Alexandre-Venditti69 @sdetweil
            last edited by

            @sdetweil thanks for your intention 🙏🏼

            1 Reply Last reply Reply Quote 0
            • A Offline
              Alexandre-Venditti69 @sdetweil
              last edited by

              @sdetweil I read the print.js library, it is of substantial size, does such a volume remain “compatible” with a simple raspberry?

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @Alexandre-Venditti69
                last edited by

                @Alexandre-Venditti69 no clue… raspberry pi 3 has 1 gig or memory and pi4 can have up to 8gig.

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @Alexandre-Venditti69
                  last edited by

                  @Alexandre-Venditti69 said in Print:

                  Est ce un bon début ?

                  sorry, I have no idea.
                  I would have thought u could print directly from the browser, and not have to go to the helper.

                  never tried printing

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • 1
                  • 2
                  • 1 / 2
                  • First post
                    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