You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add your version/tag release information on the change log
Getting started
Add the library in your package.json under dependencies "@thisisme/pdfgeneration-lib": "https://github.com/ThisIsMe-dev/PDFGeneration-lib#5.3.0"
npm install to install all your dependencies for your project
Examples
Create a pdf_req.js file in your service that exports the following:
Generates a PDF Report with Content
generatePDFContent: (response,event,requestTimestamp,requestParams,dataSource)=>{console.log('Generating PDF Object');constpdfLimiter=pdf.pdfLimiter;constpdfHelpers=newpdf.PDFHelpers(event,requestTimestamp,dataSource,requestParams);constreportHeaders={businessInformation: {title: 'Business Information',new_page: true},linkedAddress: {title: 'Linked Addresses',new_page: true},aliases: {title: 'Known Aliases',new_page: false},notes: {title: 'Notes',new_page: true},linkedBusinesses: {title: 'Linked Businesses',new_page: false},linkedPersons: {title: 'Known Associates',new_page: true},};// These are custom headers for you service that the PDF needs to know are headers so it can adjust the look accordinglyconstcontent=pdfHelpers.generateResultsFoundPDFStartingContent(reportHeaders,constants.PDFType.CONTENTS_OF_PAGE);returnpopulateRestOfReport(pdfLimiter,reportHeaders,pdfHelpers,response,content);// this is your custom function that handles the rest of your custom service's pdf}
constPDFType={DEFAULT: 0,// old style search/responseCONTENTS_OF_PAGE: 1,NO_SERVICE_RESPONSE_HEADER: 2,COVER_AND_CONTENTS_OF_PAGE: 3,};
Document Line Types
constPDFDocumentLineType={DEFAULT_LINE: 0,// Just a placeholder, this currently does the same as a KEY_VALUE_LINEHEADER_LINE: 1,// A headerline (just a bit bolder than the normal lines)KEY_VALUE_LINE: 2,// The basic line we use for just a label and text lineEMPTY_LINE: 3,// Functionally the same as END_LINE at the moment, this is just a more visible label for the user to understand what they are trying to accomplishADDRESS_LINE: 4,// This splits a string on its commas into multiple linesCOLUMN_INFO: 5,// This requires a value of object with rows defined in (SINGLE_COLUMN, DOUBLE_COLUMN, END_LINE) - this has a different type of header than META_INFOMETA_INFO: 6,// This requires a value of object with rows defined in (SINGLE_COLUMN, DOUBLE_COLUMN, END_LINE)SINGLE_COLUMN: 7,// This specifies that a row can only have 1 columnDOUBLE_COLUMN: 8,// This specifies that you can have 2 columnsEND_LINE: 9,// Normally used to signal that your section endedGRID: 10,// Helps to create a list/table like display with columns, taking an array of objectsTABLE_OF_CONTENTS_LINE: 11,// Line used to define table of contents page linesKEY_LINK_LINE: 12,// A line that allows the user to click to go to the provided URLINDICATIVE_BAR_LINE: 13,// Indicative bars designed with Credit Scores in mindIMAGE_LINE: 14,// A line that represents an imagePAGE_BREAK: 15,// Skips to the top of a new page}