Visokio website     Downloads     Video tutorials     KnowledgeBase  
Scheduler: PDF batch outputs - image retrieval & rendering time? - Visokio Forums
Scheduler: PDF batch outputs - image retrieval & rendering time?
  •        CRead December 15, 2014 3:10PM
    I'm using a URL call to pull a local image for rendering (before and after shots), and finding that a lot of the times the batch output does not capture the image. Loading the file on the Scheduler and applying the filters will show the image, but if the network is busy there is a slight delay. The images are shown in multi page document view, and run on a 2.8 Server Scheduler.

    Is there any way to add a delay (or event wait) to allow the images to load, or alternatively, change the way I call them? I've tried adding them as an image directory, but that only allows for tile view, which doesn't suit my needs (I need to size them consistently using html).
  • 12 Comments
  •     tjbate December 17, 2014 6:59AM
    Colin - There is an Action called 'Wait for file', which you can add to the Task List, and allows you to specify the Scheduler sleep time, as well as a total time-out for the task.

    It currently requires you to pre-specify the full file path for the file, however.

    Another option is to use Execute Command Option to reference a shell command that takes the OS some time to complete, and ticking the Wait until terminated option, which causes the Scheduler to wait until the OS shell command is finished.

    On Windows, you could use a shell command like this:

    Use the ping command to attempt to ping an invalid IP address:
    ping 1.1.1.1 -n 1 -w 5000 > nul
    1.1.1.1 is an invalid IP address and can never be reached.
    -n 1 means only attempt to connect once.
    -w 5000 means wait 5 seconds for reply.
    nul means gobble the output.


  •        CRead December 17, 2014 7:51AM
    I don't understand how I run that once a tab is opened? The IOM and jpg files already exist, but for the html to pull them completely from disk and render them sometimes takes longer than the screenshot delay which produces the output PDF.

    I may be looking for something like: http://stackoverflow.com/questions/12635577/detect-when-html-has-finished-loading-and-rendering-on-the-page or I may be looking for something like 'screenshot capture delay'... I'm not sure at the moment.
  •     tjbate December 17, 2014 9:29AM
    The Scheduler tasks only operate at the level of files, rather than tabs or views, so OS or Scheduler processing delays cannot be interspersed within processing of a file in one single pass.

    Rather than the Scheduler Task List, the wait would have to be configured inside the IOM/IOK file. Which view are you using to display the (refreshed) images?
  •        CRead December 17, 2014 9:44AM
    The tab is set to show multi page document view, the content is not inside a specific (e.g. content) view type at present, but in plain html, that's why I was wondering about the option I found on stackoverflow.
  •     tjbate December 17, 2014 9:53AM
    So you are using Tab > New > From Image or PowerPoint pointing to a specific .JPG image file? ....and the problem occurs when you are refreshing the file using the Scheduler?
  •        CRead December 17, 2014 9:58AM
    I am not using that new tab option. Refreshing the file does not cause problems, the issue arises when I batch output PDFs.

    The file has a lot of IDs, with information about each, and two photos where they exist. The file itself is small, but there are quite a lot of IDs, and the IDs change every month, and photos are added at other times.

    The batch output specifies the ID, and the tab is rendered for this ID. The two images are only one part of what is shown. The entire content forms a cover sheet for a PDF pack.

    Manually viewing the tab always results in the pictures being rendered, and the pictures are saved on the same network as the scheduler, so there's normally no problem.
  •     tjbate December 17, 2014 10:10AM
    It would help if you could send an example of the file? What happens if you embed the images in the file?
  •        CRead December 17, 2014 11:35AM
    If I embed the images I can't display them acceptably as per my initial post.

    In the attached file the images will never load, as they are hosted locally to the scheduler on an internal network drive. For your testing I'd suggest using .jpg photos of ~100kb each on a network share. You'll need to change the html to point to those obviously.
  •     tjbate December 18, 2014 6:36AM
    Colin - This file uses the Content View and a formula to generate HTML strings to display different images by inserting a different value into each string in the HTML page.

    Unfortunately, the Content View is not a full browser, and loading of local images in the Content View is asynchronous, so we cannot add a JavaScript wait logic, or add another blank image at the bottom etc. etc.

    There is currently no way to make sure the Content View has completed loading every local image before the screenshotting for PDF output begins as an automatic Scheduler task.

    The workaround is to use the Web View and refer to the images on a remote web page, rather than as individual formula-resolved image files on the local network. There is a Web View screenshot grab delay setting for files available at:

    Settings {Application-wide} > Miscellaneous >Web View screenshot delay grab (seconds)
  •        CRead December 18, 2014 7:24AM
    That might work... I suspect I'd have to create the web pages using a different batch output first. I was hoping that there was something like that option for normal screenshot based capture.
  •     tjbate December 18, 2014 7:30AM
    Probably worth posting that as an Idea.
  •        CRead January 12, 2015 10:57AM
    To update - I managed to work around this by copying the files to the local user directory on the scheduler. This works around the busy network issue.

Welcome!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership