HR PDF document templates in legacy HR
HR document templates are used to generate PDF documents that include information from an employee's HR profile, in the non-scoped version of HR. You can generate PDF employment verification letters for existing employees. You configure PDF document templates with your company information and logo.
- Employee Verification Letter in Canada
- Employee Verification Letter in USA
- A page of your company's letterhead.
- Copies of your current employment verification letter and offer letter templates, if available.
- The logo image to use in your header. The header image can be a maximum of 50px high. If your letterhead includes a logo and text, ensure that the logo image includes the text, as you can only configure the image in the header.
- The logo image to use in your footer, if applicable. The logo image can be a maximum of 15px high. You can configure both an image and text in the footer.
Modify an HR PDF document template in legacy HR
You can modify the predefined HR PDF document templates with your company logo and custom text.
Before you begin
Role required: admin, hr_manager, or hr_admin
About this task
Each pdf document template contains configurable areas for the header, body, and footer. You can enter the body of the letter in a WYSIWYG text editor, and place variables to retrieve information from the employee's or candidate's HR profile.
Procedure
- Navigate to .
-
To add a header image, such as your logo, complete the following steps.
- Next to Header image, select Click to add.
- Click Choose File and select the header logo image from your computer, then click OK.
- From the Image position choice list, select the position of the logo.
-
To edit the body, perform the following steps.
-
To configure the footer, perform the following steps.
- Click Update.
What to do next
Add an HR PDF document template in legacy HR
You can add HR pdf document templates for employment verification or job offers as needed.
Before you begin
About this task
The easiest way to add a new HR PDF document template is to open one of the existing templates and save it as a new template. The steps below follow this process.
Procedure
What to do next
PDF APIs and PDF document templates in legacy HR
Use PDF APIs to create PDF document templates.
PDF APIs are called through server-side scripts like business rules and script includes.
API Details
The GeneralFormAPI.setDocument() sets document parameters for PDF generation. The parameters are: setDocument(.
| headerImage | Image in the header of the document template. |
| , footerImage | Image in the footer of the document template. |
| , footnote | Footnote at bottom center. |
| , headerPosition | Position of header image. Values are Left, Right, and Center. |
| , footerPosition | Position of footer image. Values are Left, Right, and Center. |
| , pageSize | Sets page size for document template. Values are Letter, Legal, and A4. |
var generalFormAPI = new global.GeneralFormAPI(this.fileName, this.targetTable, this.targetId);
generalFormAPI.setDocument(this.headerImage, this.footerImage, this.footnote, this.headerPosition, this.footerPosition, this.pageSize);
generalFormAPI.createPDF)this.body);Document generation APIs and script includes in legacy HR
The following APIs and script includes are available for generating PDF documents.
| API | Input | Output | Description |
|---|---|---|---|
| generate | manual (Boolean) | Generation status (Boolean) | Generates a PDF document. When set to true, generates documents manually. For example, Generate action on Preview Document. This API returns a boolean value when a pdf is generated. |
| createPDF | tableName (String), tableId (String) | N/A | The inactivateRelatedDrafts inactivates draft documents for the tableName and tableId input parameters. When the tableId is the sys_id of a case with child tasks, then draft_documents for the tasks are also inactivated. |
| hasDraftDocument | tableName (String), tableId (String) | Boolean | Returns a boolean value when a draft document is attached. Input parameters are tableName (takes name of the table the draft document is attached), tableId (takes the sys_id of the table). The table can be the HR Task or HR Case when the sys_class_name within the api call. |
| getDraftDocument | tableName (String), tableId (String) | draft document Glide Record (GlideRecord) | Takes tableName and tableId of the record that the draft document is attached to. It returns the draft document GlideRecord matching queried based on input values. |
| remove_all_variables | parsedBody (String) | parsedBody (String) | The remove_all_variables method takes document body and removes tags (${dummy_tag_value}). |
| validateTemplate | parsedBody (String), tableName (String) | parsedBody (String) | Validates tags in a document template body. The variables in the tags are matched against the fields/dot-walked fields of the tableName passed as an input argument. |
| API | Input | Output | Description |
|---|---|---|---|
| setDocument | headerImage (String), footerImage (String), footnote (String), headerPosition (String), footerPosition (String), pageSize (String) | N/A | Sets the building blocks/parameters of a document for PDF generation. |
| createPDF | body (String), pages (number) | N/A | Takes body and number of pages and generates the PDF document. After the document is generated, it is attached to the table that the createPDF action is requested. |
| setDocTempleInfo | headerImage (String), footerImage (String), footnote (String), headerPosition (String), footerPosition (String), pageSize (String) | N/A | A setter method for setting document template building blocks. |
| startHTMLParser | N/A | N/A | Opens a write stream for htmlparser to enable document generation. |
| API | Input | Output | Description |
|---|---|---|---|
| setDocument | headerImage (String), footerImage (String), footnote (String), headerPosition (String), footerPosition (String), pageSize (String) | N/A | Sets document template building blocks. |
| startHTMLParser | N/A | N/A | Opens a write stream for htmlparser to enable document generation. |
| stopHTMLParser | N/A | N/A | Closes the write stream after document generation method is complete. |
| addHTML | html (String) | N/A | Appends html snnipets to the document body. |
| addNewPage | N/A | N/A | Moves the cursor to the next page. |
| addCells | cells (Object), row_length (String) | N/A | Adds cells, relevant text, and properties to a table. |
| addSVG | svg (String), position (Object) | N/A | Adds svg to a document template. |
| setPDFDoc | pdfDoc (Object) | N/A | Sets pdfDoc objects. |
| setProperties | properties (Object) | N/A | Sets document properties. |
| setHeader | header (String) | N/A | Sets the header for a document template. Note: Not used. |
| setFooter | footer (String) | N/A | Sets the footer for a document template. Note: Not used. |
| setWatermark | watermark (String) | N/A | Sets watermarks on a generated PDF document. |
| get | N/A | ByteArrayInputStream | Returns a document as a ByteArrayInputStream. |