PDF Fillable form make field bold using sn_pdfgeneratorutils.PDFGenerationAPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2024 07:29 AM
Hi,
I have created a PDF Fillable form using Adobe Acrobat. I am using a script include to populate this PDF form using sn_pdfgeneratorutils.PDFGenerationAPI.fillDocumentFields.
I have a field on the form that would need to be bold.
var v = new sn_pdfgeneratorutils.PDFGenerationAPI;
var fieldMap = new Object();
fieldMap["transaction_header"] = 'Test returned on note ending in 1234';
var result = v.fillDocumentFields(fieldMap, "XXXXXXXXXXXXXXXXXXXX106a", "x_new_app_request", 'XXXXXXXXXXXXXXXXXXXXdccd', "Test");
gs.info(JSON.stringify(result));
In the above script, I am trying to get the fieldMap["transaction_header"] value to be bold. I set up the PDF Fillable form font for that pdf field to be arial bold, but I don't think that the string is passing it so that it recognizes the font for that field. If I manually fill out the form, then the bold is working.
Does anyone know of a way to do this?
Any help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2024 06:29 AM
did you try this
var v = new sn_pdfgeneratorutils.PDFGenerationAPI;
var fieldMap = new Object();
fieldMap["transaction_header"] = '<html><body><b>Test returned on note ending in 1234</b></body></html>';
var result = v.fillDocumentFields(fieldMap, "XXXXXXXXXXXXXXXXXXXX106a", "x_new_app_request", 'XXXXXXXXXXXXXXXXXXXXdccd', "Test");
gs.info(JSON.stringify(result));
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2025 09:59 AM
I apologize for the delay, but no this is not working as servicenow passes the data as a plain text. It doesn't recognize html tags inIt is not recognizing I don't know how, but on some of my other PDFs I am using I made the adobe acrobat field font bold and that worked. For some reasons a couple of my other PDFs is not working with the same function on the Adobe field.