138
Views
5
Comments
Solved
[Ultimate PDF] Is it possible to use the page number value into an Expression?
ultimate-pdf
Reactive icon
Forge asset by Leonardo Fernandes
Application Type
Reactive
Service Studio Version
11.53.32 (Build 61761)

I need to use the page number value into an if clause to show items starting from the second page

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
Solution

@Lorenzo Levis the page number is not available inside expressions. But you could try using the HideHeaderOnFirstPage parameter of PrintLayout, and including a different header for the first page. This is used in the Résumé sample, please download the demo app and check it out.

2022-07-18 06-05-45
Lorenzo Levis

Hi Leonardo

the solution works but the header doesn't appear in the second page. Is a known issue or there is something else to do? i just set the property HideHeaderOnFirstPage to True

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP


Did you check the Résumé sample?

That sample hides the header on the first page:


If you check the contents of the Header placeholder, you will see that it corresponds to the top of the section I highlighted below, which includes the "Name, JobTitle" and the page number "1/N".


If you check the output pdf file, you will see that this header is only displayed on the second page. If the file had more than 2 pages, the header would be shown on every page but the first.


However, you will find a distinct "header" in the first page of the output file:


But in reality that is not a header, it's simply the top of the MainContent placeholder:




So, if you have two headers H1 and H2, and you want H1 to appear on the first page and H2 to appear on other pages, you should place H2 on the Header placeholder, hide it on the first page, and make sure that H1 is the topmost content of the MainContent placeholder.

Hope this helps.

2025-04-17 05-42-16
Ajit Kurane

Hi,

do you want to add page number and total number of pages at the footer part ?

you can check below post for more information .

https://www.outsystems.com/forums/discussion/72040/ultimate-pdf-obtain-page-number-programatically/

Thanks,

Ajit Kurane.

2022-07-18 06-05-45
Lorenzo Levis

Hi 

Thank you for answering

No, i need to use the page number value as a variable inside an expression component to check if the current page is first one or not, so I should display different graphics items 

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
Solution

@Lorenzo Levis the page number is not available inside expressions. But you could try using the HideHeaderOnFirstPage parameter of PrintLayout, and including a different header for the first page. This is used in the Résumé sample, please download the demo app and check it out.

2022-07-18 06-05-45
Lorenzo Levis

Hi Leonardo

the solution works but the header doesn't appear in the second page. Is a known issue or there is something else to do? i just set the property HideHeaderOnFirstPage to True

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP


Did you check the Résumé sample?

That sample hides the header on the first page:


If you check the contents of the Header placeholder, you will see that it corresponds to the top of the section I highlighted below, which includes the "Name, JobTitle" and the page number "1/N".


If you check the output pdf file, you will see that this header is only displayed on the second page. If the file had more than 2 pages, the header would be shown on every page but the first.


However, you will find a distinct "header" in the first page of the output file:


But in reality that is not a header, it's simply the top of the MainContent placeholder:




So, if you have two headers H1 and H2, and you want H1 to appear on the first page and H2 to appear on other pages, you should place H2 on the Header placeholder, hide it on the first page, and make sure that H1 is the topmost content of the MainContent placeholder.

Hope this helps.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.