Forum Discussion

MichaelTamoush's avatar
MichaelTamoush
Qrew Captain
5 years ago

Pictures on Exact Forms

I actually have posted this a couple times, but every few months I try again in case someone has figured it out, or maybe someone new stumbles across this.

Has anyone found a way to get pictures onto Exact Forms (either native or with Juiced Add On), that are
1) reduced in size (so that it does not bloat pdfs with multiple pictures) and
2) Correctly orientated the direction they were uploaded (portrait or landscape).

Challenges:
1)There are plenty of ways to reduce the viewed size (meaning changing the width and height) but that still leaves the file size of the image the same, when putting onto Exact Forms. Currently I use a juiced addon to reduce the size of the image (manual button push), and then insert on the pdf. However, this has drawbacks as reducing the photos in some instances also rotates the photo, and in other instances it does not.

2) The impossible file rotation quirk in QB. Depending on all kinds of variables including file size and browser, it is almost random what the orientation will be when printed (if originally taken portrait). I currently used a Juiced Add-on but even this is difficult, because of caching issues some browsers will not view the image as rotated.

I'm on a forever quest to solve this issue....even if there is a third party add-on that can magically do all this I am in the market....

------------------------------
Mike Tamoush
------------------------------
  • I've not run into the image rotation issue you mention, but I can tell you how to add an image in EF+.

    You're going to start with 4 fields

    1. The actual File Attachment field - called [FA] for our purposes
    2. A Formula URL field that results in the URL for the FA - [FA URL]
      1. URLRoot() & "up/" & DBid() & "/a/r" & [Record ID#] & "/e16/v0"  - where 16 would be replaced with the FID of the FA field
    3. A Formula Rich Text field that displays the image referenced by the URL - [FA Image]
      1. "<div><img src=\""&[FA URL] & "\"></div>"
    4. A Formula Rich Text field that creates the necessary EF+ code - [EF Image]
      1. "<div style='text-align: left'>~i:45:80~</div>" - Where 45 would be replaced with the FID of the FA Image field
    When building your EF+ document, you'll need to insert the FID for [EF Image] into the document where you want the image to appear. You'll also need to include both the FID for [FA Image] AND [EF Image] in the CLIST section of the Document Template setup, being sure to put the [EF Image] FID before the [FA Image] FID.

    Now, as for re-sizing the image, that is done with the 2nd number in the formula for the [EF Image] - in this example, 80. This controls the Width and will re-size the image based on that value and will maintain the aspect ratio of the original image.

    Now, with all that said, feel free to combine any of the formulas, if you're comfortable with that.

    ------------------------------
    Blake Harrison
    bharrison@datablender.io
    DataBlender - Quick Base Solution Provider
    Atlanta GA
    404.800.1702 / http://datablender.io/
    ------------------------------
    • MichaelTamoush's avatar
      MichaelTamoush
      Qrew Captain
      Blake,

      I have attempted all of that. The problem is, that only re-sizes the viewed picture. Meaning, it will look smaller when on the pdf, but if it was 5 megs before, it will still be 5 megs.

      My issue is that if I have 5 pictures on a pdf, it becomes a 25 meg pdf. I can 'shrink' the pictures using the above formulas and instead of 80, use say 1 (extreme example), and it will still be 25 meg. I can make the 80, 5000. Still 25 megs. It doesn't change the file size, only how big or small it visibly prints.

      Have you had success with it shrinking the actual file size itself using the above method?

      ------------------------------
      Mike Tamoush
      ------------------------------
      • BlakeHarrison's avatar
        BlakeHarrison
        Qrew Captain
        Yeah, you're correct. Any formulas in Quick Base will only change the displayed size. To actually change the size of the image, you may need to use a service like Kraken.io or something similar. Fortunately, they have APIs for scaling as well as for orientation. I've not used the service, so I can't speak for their reliability or ease of integration, but it looks pretty straightforward.

        ------------------------------
        Blake Harrison
        bharrison@datablender.io
        DataBlender - Quick Base Solution Provider
        Atlanta GA
        404.800.1702 / http://datablender.io/
        ------------------------------