PDF Generation API
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 06:42 AM
var hfInfo = {
"HeaderImageAttachmentId": "fd0eac2a1b2d9e100c80dc6fe54bcb69",
"HeaderImageAlignment": "right",
"FooterText": gs.nowDateTime(),
"PageSize": "A4",
"GeneratePageNumber": "true",
"FooterTextAlignment": "BOTTOM_LEFT",
};
skillsHTML = buildSkillsHTML(data.skills, userName);
data.skillsHTML = skillsHTML;
// Set the file name for the PDF dynamically, using the user's name
var pdfFileName = "CV for " + userName + " - " + gs.nowDateTime();
var pdfFileNameEXT = pdfFileName + ".pdf";
// Generate the PDF
var pdfGenerator = new sn_pdfgeneratorutils.PDFGenerationAPI();
var result = pdfGenerator.convertToPDFWithHeaderFooter(skillsHTML, "sys_user", userSys, pdfFileName, hfInfo, '55fc6e4c1b3592100c80dc6fe54bcba9');
This is the code I used in a widget (Server Side Script). The HTML is also generated in the server side.
Instead of page number, client wants userName to be displayed at the header section (top left) of the PDF. Any suggestions on how this can be done?
Note: I tried to follow this suggestion, but not sure how to implement this.
0 REPLIES 0