Pulsar Images API

Rich Text Image fields

When an org is configured to sync rich text images, a common task is to make those images available offline within a javascript/HTML customization. This is necessary because the salesforce field data only contains the Salesforce URL to the image, rather than the local Pulsar location for the image. The getrtfimages API call will read the field data, translate the Salesforce URL to a relative URL on the local web server, and return the modified rich text content.

Pulsar for Windows uses IronPDF for PDF generation, and that must run as an external process. External processes do not have access to Pulsar’s local web server so Pulsar automatically translates the local relative URL into a local file path as part of the PDF generation process.

The Id and Fields arguments are required for this API to work and return data. Not supplying Id argument will result in an error. Not supplying Fields argument will cause no data to be returned.

var request = { "type" : "getRTFImages", "object" : "Some_Custom_Object__c", // Required: the object type "data" : { // Required: Record Id for the object containing the Rich Text images fields "Id" : "0011000000iW9YuAAK", // Required: list of specific fields to retrieve. "Fields" : [ "RichText_Field1__c", "Rich_Text_2__c" ] } }; pulsarBridge.sendRequest(request, function (result) { if (result.type === 'getrtfimagesResponse') { var response = result.data; // this will be a dictionary of field->RichTextContent pairs alert('RichText_Field1__c content: ' + response['RichText_Field1__c']); alert('Rich_Text_2__c content: ' + response['Rich_Text_2__c']); } else { console.log('getrtfimages failed: '+ result.data) // data is an error string } });

Â