How show the page number in the footer ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 10:02 AM
Hello. How i show the pagenumber in the footer (in the Business rule to do a pdf) ?
The code:
(function executeRule(current, previous /*null when async*/ ) {
var html = current.html_template_resumo_adm;
var tablename = ('x_bdb_5wa_00000447_solicitacoes');
var targetTableSysId = current.getValue('sys_id');
var funci = current.funci_beneficiario.name;
var prefixo = current.prefixo_beneficiario.name;
var fileName = 'Solicitação ' + (current.getDisplayValue('number')) + " " + (current.sys_updated_on);
var a = html.replace('x_funci', funci);
var b = a.replace('x_prefixo', prefixo);
var pageProperties = {
PageSize: 'A4',
GeneratePageNumber: 'true',
TopOrBottomMargin: '72',
LeftOrRightMargin: '36'
};
var v = new sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDFWithHeaderFooter(b, tablename, targetTableSysId, fileName, pageProperties);
current.update();
})(current, previous);
The pdf:
Labels:
- Labels:
-
Command Line Interface
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 10:43 AM
You need to update page rule, please follow below article to achieve the same(look for @page rule)
:
Generating Custom PDFs - using the new PDFGenerationAPI
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Best Regards
Aman Kumar
Aman Kumar
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2022 06:20 AM
(function executeRule(current, previous /*null when async*/ ) {
var html = current.html_template_resumo_adm;
var tablename = ('x_bdb_5wa_00000447_solicitacoes');
var targetTableSysId = current.getValue('sys_id');
var funci = current.funci_beneficiario.name;
var prefixo = current.prefixo_beneficiario.name;
var fileName = 'Solicitação ' + (current.getDisplayValue('number')) + " " + (current.sys_updated_on);
var a = html.replace('x_funci', funci);
var b = a.replace('x_prefixo', prefixo);
var pageProperties = {
PageSize: 'A4',
GeneratePageNumber: 'true',
TopOrBottomMargin: '72',
LeftOrRightMargin: '36'
};
<style>
@page {
size: A4 landscape;
margin-left: 1cm;
margin-top: 3cm;
margin-right: 1cm;
margin-bottom: 3cm;
@bottom-right {
font-family: sans-serif;
font-weight: bold;
font-size: 1em;
content: counter(page);
}
}
</style>
var v = new sn_pdfgeneratorutils.PDFGenerationAPI().convertToPDFWithHeaderFooter(b, tablename, targetTableSysId, fileName, pageProperties);
current.update();
})(current, previous);