SharinPix Bulk PDF Generation Feature (Developer-oriented)
Overview
How It Works
Sample Code
// Initialize a list to hold the parameters for PDF generation
List<sharinpix.SharinPixCacheBuilder.Params> paramsList = new List<sharinpix.SharinPixCacheBuilder.Params>();
// Query all Account records (this can be customized based on your use case)
for (Account acc : [SELECT Id FROM Account]) {
// Create a new Params instance for each record
sharinpix.SharinPixCacheBuilder.Params params = new sharinpix.SharinPixCacheBuilder.Params();
params.recordId = acc.Id; // Set the record Id
params.filenameFieldApiName = 'Name'; // Specify the field to be used as the filename of the PDF
params.firstPageFieldApiName = null; // Specify the field for the first page content (if any)
params.imageUrlFieldApiName = 'sharinpix__ImageURLThumbnail__c'; // Set the field for image URLs
params.preDescriptionFieldApiName = 'Description'; // Set the field for a description before the content
// Add the Params instance to the list
paramsList.add(params);
}
// Call the render method to start the Batch Apex process for PDF generation
list<Id> pdfIds = sharinpix.SharinPixCacheBuilder.render(paramsList);Parameters
Execution
Last updated
Was this helpful?

