8 Replies Latest reply on Jan 10, 2016 10:20 PM by bigtom

    Generate picture from print view

    JohnEriksson

      I would like to generate a png picture instead of a PDF from a print view.

      This picture will in next step (manually) be sent by text message from an iphone.

      I don't want PDF because many phones can't open it, and it can only be sent with iMessage.

       

      Any ideas?

        • 1. Re: Generate picture from print view
          siplus

          If you save the pdf (temporarypath), import it in a field, have a calc defined as

           

          GetThumbnail

           

          of that field (set the size yourself in the formula) and export the calc's field contents, you'll get your png.

          • 2. Re: Generate picture from print view
            JohnEriksson

            Thanks for the reply @siplus . I tried the approach you suggested, and found it to work somehow, but its still PDF and not PNG.

            I didn't get the InsertPDF script step to work, but Insert File did the trick and it seems to be the same result.

             

            Skärmavbild 2015-12-30 kl. 19.23.16.png

             

            Skärmavbild 2015-12-30 kl. 19.23.52.png

            • 3. Re: Generate picture from print view
              siplus

              It *might* have something to do with the format you choose for capturing a screenshot on your mac. I went with png (set it via Onyx).

               

              try the enclosed file.

               

              Select the field called thumb and from the Edit menu select export field contents.

               

              For me, it sets up a png as export.

              • 4. Re: Generate picture from print view
                JohnEriksson

                Hah, interesting. What decides if it will change format is the size. My source pdf has pixel dimensions of 311x385 (width x height). If I choose a size smaller than that I get a png, a size larger than that I get a pdf.

                 

                This is a really ugly way to solve it, but it does work.

                 

                Skärmavbild 2015-12-30 kl. 21.39.38.png

                 

                 

                This will have to do for now, and I'm very thankful for your idea.

                 

                I can confirm this "hack" works with FileMaker Go as well.

                Its also interesting how this script step Export Field Contents gave fewer export options on the iPhone. With the PDF I had the standard sharing pane with all apps. With this one I can only send by email or Save. And I don't understand where the picture actually goes when I select Save. Not the Camera Roll, not the FileMaker Go app, its just vanished.

                 

                The qr codes on the result are distorted but readable.

                Another problem is that I can't choose dpi for the conversion, it selects 72 dpi/inch, so the resulting pictures are in quite bad quality.

                 

                If someone has a different approach for this task I'm still interested.

                • 5. Re: Generate picture from print view
                  siplus

                  JohnEriksson wrote:

                   

                  Hah, interesting. What decides if it will change format is the size. My source pdf has pixel dimensions of 311x385 (width x height). If I choose a size smaller than that I get a png, a size larger than that I get a pdf.

                   

                  Hah, now let me say that your discovery is my discovery, too.

                  I guess we need a superior level authority to explain us this.


                  For the time being, I'm happy I learned something new, thanks to you.

                  • 6. Re: Generate picture from print view
                    bigtom

                    Interesting. The size thing is weird and could use some explanation.

                     

                    Depending on how you have everything setup (Mac) you could have a robot client running a script that captures a good resolution png screen grab from a specific layout and saves that file to a container for your use. I suppose there are a lot of options for doing this kind of thing. There are some free online pdf to png/jpg services and using these through FM / insert from URL may also be an option for you.

                    • 7. Re: Generate picture from print view
                      JohnEriksson

                      It has to work on iPhone, so external active folder scripts won't work.

                      What will work is of course yet again use Insert from URL and an api somewhere out there. Haven't found any free yet, but i'm sure there is. I have found to jpeg, but that's a bad choice for qr-codes.

                       

                      Best would of course be if FileMaker could do it in-house, so I won't need to waste bandwidth with this simple task. There might be another way I would never have thought about the first solution.

                      • 8. Re: Generate picture from print view
                        bigtom

                        Do you need only the QR code sent by text message? No additional text?

                         

                        You can generate the image and use export field contents to the temporary path on FMGo. Then you can send that by email to your phones via the phone's text email address (they all have one) or to your text service.