B4J Question BANanoPDFMake: Pagenumber and Total pages missing

prbmjr

Active Member
Licensed User
Hi Guys, How can I get and use the dynamic pagenumber and total of pages information to be used into each page footer? I can't find the correct property already implemented in the library, please anyone could help me to find it? Or is there a alternative way to obtain this information if this property is not implemented yet?

Thanks in advance!

Paulo Bueno
 

prbmjr

Active Member
Licensed User
I am of the opinion that if a property / method is available from the original library this is based from, http://pdfmake.org/#/

Then such is possible.

Perfect! I found inside pdfmake.org manual the follow information: https://pdfmake.github.io/docs/0.1/document-definition-object/page/ , that talks about the page number using the pageBreakBefore: "If pageBreakBefore returns true, a page break will be added before the currentNode. Current node has the following information attached:"

{
id: '<as specified in doc definition>',
headlineLevel: '<as specified in doc definition>',
text: '<as specified in doc definition>',
ul: '<as specified in doc definition>',
ol: '<as specified in doc definition>',
table: '<as specified in doc definition>',
image: '<as specified in doc definition>',
qr: '<as specified in doc definition>',
canvas: '<as specified in doc definition>',
columns: '<as specified in doc definition>',
style: '<as specified in doc definition>',
pageOrientation '<as specified in doc definition>',
pageNumbers: [2, 3], // The pages this element is visible on (e.g. multi-line text could be on more than one page)
pages: 6, // the total number of pages of this document
stack: false, // if this is an element which encapsulates multiple sub-objects
startPosition: {
pageNumber: 2, // the page this node starts on
pageOrientation: 'landscape', // the orientation of this page
left: 60, // the left position
right: 60, // the right position
verticalRatio: 0.2, // the ratio of space used vertically in this document (excluding margins)
horizontalRatio: 0.0 // the ratio of space used horizontally in this document (excluding margins)
}
}

Could you help to find a way to get this information?

Thank you!

Paulo
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
Please see this post about how to create pages


Im mot sure if one is able to get the total pages and page number though..
 
Upvote 0
Top