5 Replies Latest reply on Dec 22, 2015 10:09 PM by padaddy

    Webviewer not fully loaded when printing or exporting

    allardmax

      Title

      Webviewer not fully loaded when printing or exporting

      Post

      Hi,

      I'm having an issue since FM11 with web viewers (i.e. maps) that are not fully loaded when they are being exported to pdf in a script (save records to pdf) or printed (I'm now using FM13). I tried several workaround like:

      -moving thru each record and waiting for the page to load before exporting, adding timeout;

      -moving to each record, pausing the script and using the fmp protocol within a web viewer to relaunch the script when it is fully loaded (actually, it makes FM to crash when exporting);

      I don't know what to do anymore and I NEED it working. It's just a stupid bug and I spend days and possibly weeks to try to solve this. Please help, I don't know what to do anymore.

      Max

        • 1. Re: Webviewer not fully loaded when printing or exporting
          philmodjunk

          You say that you are "having an issue" but don't spell out what that issue is.

          I'd guess that you are getting empty webviewers in your output.

          Are you saving one PDF with one map at a time or is this a multiple map, multiple record PDF?

          Have you tried setting a container field to the map image and using it for your PDF?

          • 2. Re: Webviewer not fully loaded when printing or exporting
            allardmax

            Thanks Phil for your quick answer. I'm not getting empty web viewer. WV are used to load maps. Map interface is loaded, and some tiles  in the background, but not all of them. If FM wait 0.1 sec more before producing the output the maps would be fine, but it doesn't wait. It is a multiple record PDF, sometimes hundreds. The map is not an image, it is a interactive page composed of an interface and several layers and tiles. I can't simply copy/paste it to a container. However it was a good clue.

            • 3. Re: Webviewer not fully loaded when printing or exporting
              philmodjunk

              I'm not getting empty web viewer.

              Then it's not clear to me what you ARE getting.

              FM can be scripted to wait and the wait can be calculated as a function of the number of records in your found set.

              Is this by any chance 1 map per page of the PDF?

              If so, you might generate one PDF at a time using the Save As PDF script step's "append" option to keep appending each record. That might make it easier to manage the "wait for download" part of the process as you can do this one map at a time.

              You might look into the getlayoutobjectAttribute function. You might be able to add a loop that waits for a short time, and then uses this function to check to see if any data is present in the web viewer before either looping again or generating a PDF of that one map.

              • 4. Re: Webviewer not fully loaded when printing or exporting
                allardmax

                I tried that. I have used a delay on each record, but it changes nothing. When the script loop thru the records I can see the whole map loaded, but the map seems to be reloaded internally when producing the pdf (I see a box telling me that the web viewer is loading). Whatever I do before the save records to pdf seems to have no effect on the way WV are managed by the pdf exports.

                • 5. Re: Webviewer not fully loaded when printing or exporting
                  padaddy

                  I am having the exact same issue.  I have a report created where each record produces a chart which is rendered in a web-viewer.  A typical report might consist of 20 records, each record generating a unique chart.  I can view the charts without any problem in the layout, but when printing to pdf the charts do not consistently render.  I'll usually get 1-2 charts out of 20, and it's never the same thing twice.  It is as though the pdf engine is not waiting quite long enough for the web viewer to generate before printing the page and moving on.  This is the last puzzle piece in a huge project!  I wonder if anyone came up with a solution??