Dynamic image not rendering to PDF via SSB

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

Dynamic image not rendering to PDF via SSB

Postby rafig » Wed Jul 03, 2013 9:58 pm

Hi,
I am creating a ServerSideBatch [SSB] Process (using a SSB solution module)that combines PDF prints of forms and emails them.
One of the forms is a letter that has a label block with HTML in it and a whole bunch of unstored calculation calls to dynamically build the letter based on various things.
At the bottom of the letter it then chooses one of two possible signatures to pull in from the media library using a calc
Code: Select all
function c_letter_sig ()
{
   var $sig_michael = '';
   var $sig_michelle = '';
   if ( scopes.globals.pc_is_headless )
   {
      $sig_michael = '<img alt="<michael_sig>" src="media:///ssb_sig_Michael.png" height="75" width="150">\
         <BR>\
         Michael Tobias';
      $sig_michelle = '<img alt="<michelle_sig>" src="media:///ssb_sig_Michelle.png" height="69" width="134">\
         <BR>\
         Michelle Tobias BSc FRICS';
   }
   else
   {
      $sig_michael = '<img alt="<michael_sig>" src="media:///sig_Michael.png" height="75" width="150">\
         <BR>\
         Michael Tobias';
      $sig_michelle = '<img alt="<michelle_sig>" src="media:///sig_Michelle.png" height="69" width="134">\
         <BR>\
         Michelle Tobias BSc FRICS';
   }

   if ( ( conf_code != null ) && ( conf_code != '' ) )
      if ( utils.hasRecords ( corresp_to_confs_by_conf_code ) )
         if ( corresp_to_confs_by_conf_code.flag_organiser == 1 )
            return $sig_michael;
         else
            return $sig_michelle;
      else
         return $sig_michelle;
   else
      return "";
}

At first this was only looking at one set of media (& also was originally using JPEG not PNG), but when it wasn't working on server, I thought I needed to put images into the SSB module as well, but basically it isn't working.
When I do the email of one item, using same code/form, in SmartClient signature appears in form, but when it is sent to server for 'printing/emailing' it gets the broken image link icon and just the 'img alt' tag text.
The form is based on another form, the basic letterhead, that has a header image that is put directly onto form, and that comes out ok.

Is headless client unable to render HTML stuff with images embedded like above?
How can I overcome this, other than having to create different forms for each signature and have them 'hard coded' on forms and pick the form via calc?? (I hope not, as I am hoping to go live any day now with this :( )
Thanks

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 481
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Dynamic image not rendering to PDF via SSB

Postby Andrei Costescu » Mon Jul 08, 2013 9:44 am

Do you see the same thing happening if you create a simple-separate (no module - no extended form sample) SSB - that just prints out that HTML?
If that works, try adding to it incrementally - an extended form, then modules. (trying to rule out the solution as a cause)
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 902
Joined: Tue Jun 26, 2007 3:14 pm

Re: Dynamic image not rendering to PDF via SSB

Postby rafig » Mon Jul 08, 2013 10:44 am

Hi Andrei,
for the moment I have had to do different forms for each signature as we have gone live today...
I will try your suggestion when I get a chance.

Thanks

Rafi
Servoy Certified Developer
Image
rafig
 
Posts: 481
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK


Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 1 guest