How to get a png/jpg image format instead of a iix?

ghezal salma2
Kilo Contributor

Hi ,

Using this script :

     var rec = new GlideRecord('Name_Of_App');
    rec.addQuery('number=id');
   rec.query();
  var image='' ;
  while (rec.next()) {
       image= rec.attachement.getDisplayValue() ;
      gs.warn("image : "+image);
  }

I'm getting an .iix file outputted . I want this file to be outputted as either .png or .jpg for another operation " scan image" .

 
is there a possibility to get the jpg ?

Thanks,

Salma

 
 
1 ACCEPTED SOLUTION

Varsha21
Giga Guru

Hi

You will not get png or jpg file 

please check the sys_attachment table,here you will get all the attachment from all table.

here you can check if possibility is there to get it.

 

varsha

View solution in original post

2 REPLIES 2

Varsha21
Giga Guru

Hi

You will not get png or jpg file 

please check the sys_attachment table,here you will get all the attachment from all table.

here you can check if possibility is there to get it.

 

varsha

Thank you for this suggestion. It worked well for me.

This was my scenario:

I am using Document Templates to generate PDF documents dynamically based on certain records. These records have images (using image fields), which must be shown on the PDF. As discussed here, the images are provided in the .iix format. Apparently, ServiceNow's PDF generator/viewer is unable to render .iix files.

The solution was to get the image from the attachment table. Interestingly, the Sys ID stored in an image field is the attachment record's Sys ID for that image. While using HTML, all I had to do was set the image source to "sys_attachment.do?sys_id=<image/attachment Sys ID>".

Example:

<img src="sys_attachment.do?sys_id=3ecd7574dbd8bb44feb1a851ca961982" />

Thanks again for your input on this.