AnsweredAssumed Answered

Scaling Issue with JavaScript produced Data in WebViewer

Question asked by philmodjunk on Mar 12, 2018
Latest reply on Mar 13, 2018 by philmodjunk

The following is with a solution set up using FileMaker 16 and Windows 7.


I needed a quick barcode and found the following tool's custom function easily produced what I needed in a web viewer:


Since this is a custom function that uses Java Script to generate a barcode image in a web viewer, the problem could lie with the Java Script. To cover that option, I'm going to go to the above site and post feed back there with a link back here so that they can easily see the screenshots that I'm going to upload. I'll also include a brief overview of how I'm using this barcode just for those curious as to what I'm doing with a bar code in this solution.


But what I'm experiencing looks more like a display/refresh issue with the web viewer.


What I'm seeing is that the web viewer doesn't always scale the output of this custom function the same way even though the input has not changed.


The web viewer is located inside a popover and the input is simply the serial number that serves as the primary key. The custom function is simply entered into the Web Address box in the web viewer set up. What I find is that the first time that I click the popover, I get the first image shown here:


BarcodeImage Small.png


If I then click a button to move to a different record, click again to move back to this record, I get this image when I re-open the popover:


BarcodeImage Large.png


At first, this produced a barcode that I couldn't scan as the full code was not shown in the web viewer. I've temporarily fixed the issue by increasing the size of the web viewer and enclosing pop over panel so that the full code shows regardless of how it is scaled in the web viewer.


I've experimented with multiple options that reset or refresh the web viewer, that set the webviewer to the custom function results and have tried refreshing the window--even with flush cached join results. The only way that I've gotten the bar code to consistently re-display at the scale of the first image is to enter layout mode, return to browse mode and then open the popover.


The one possibly relevant clue produced by those experiments was that the set webviewer method of setting the web viewer to the function results (as a data URL) consistently produced the larger scaled copy of this bar code image. I may just switch to that option in order to get consistent output.


So to sum up, even though the input is exactly the same, the displayed image is not consistently scaled to the same size. Has anyone seen a similar result with an image displayed from a calculated result in a web viewer?


Back Story:

This is for a scrap metal (ie Junk ;-) dealer. They are required by law to take a picture of the customer and their scrap metal if the metal falls into a legally defined "non ferrous" category. I'm setting them up so that an iPhone or iPod can be used to take the picture and link it to the customer's purchase order record in the solution. It works like this: The user fills out the full Purchase order using FileMaker Pro on a workstation. When it's determined that a photo is needed, they click the popover and scan the barcode with an iOS device that has the same solution open over WiFi. The script involved uses insert from device to scan the barcode off the monitor screen and then uses the value of this barcode to find the record so that they can then use insert device with the camera parameter to take the person's picture and associate it with the correct PO record. This approach chops about 10 steps out of their current process with digital cameras.