How to get the image to script include and convert to PDF to generate the image in letters
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 06:59 AM
How to get the image that is stored in db_image table and then generate the letters which contains that image.
The image is a Signature and we have created a M2M mapping table to get the sys id of the image , this is done successfully using Glide record.
Note :- Field 'u_siganture_image' is the backend name of 'Signature image' field which is referenced to db_image table.
var m2m_table = new GlideRecord('sn_hr_core_gepi_m2m_mapping');
m2m_table.addQuery('u_data_type', 'Attachment');
m2m_table.setLimit(1);
m2m_table.query();
if (m2m_table.next()) {
attasys_id = m2m_table.u_siganture_image.toString();
gs.info('Attachment sys_id ' +attasys_id);
}
After getting the sys id that need to be passed in the variable which is called in 'HR Document template' table to generate letters.
Below code is written to pass the image 'Signature.jpg' to the variable 'Signature_image' but it is not working.
Please help!
parsedBody = parsedBody.replace(/\$\[Signature_Image\]/gi, '<p><span style="font-family: verdana, geneva; font-size: 8pt;"><img src="Signature.jpg" width="539" height="268"/></span></p>');
Name of the image is 'Signature.jpg'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 10:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2022 10:43 PM
Hi,
that signature image has some characters which you want to fetch?
Can you share screenshot for better explanation?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2022 12:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2022 12:32 AM
Hi,
I didn't get your requirement actually.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader