I would like to obtain the number of pages in a DOCX document. Is there anyway?
Solved! Go to Solution.
Hi @vmarv,
You can convert it to a pdf and count the pages with an expression from the $content property (after converting it to a string).
Kudos to @Paulie78 for the expression: https://powerusers.microsoft.com/t5/Building-Flows/Number-of-pages-in-a-PDF-file/m-p/932846/highligh...
Below is an example of that approach with a docx.
Be aware that Convert action is a part of a premium connector.
sub(length(split(replace(base64ToString(outputs('Convert_Word_Document_to_PDF')?['body']['$content']), 'Type/Pages', ''), 'Type/Page')),1)
Hi @vmarv,
You can convert it to a pdf and count the pages with an expression from the $content property (after converting it to a string).
Kudos to @Paulie78 for the expression: https://powerusers.microsoft.com/t5/Building-Flows/Number-of-pages-in-a-PDF-file/m-p/932846/highligh...
Below is an example of that approach with a docx.
Be aware that Convert action is a part of a premium connector.
sub(length(split(replace(base64ToString(outputs('Convert_Word_Document_to_PDF')?['body']['$content']), 'Type/Pages', ''), 'Type/Page')),1)
Thanks! 😁😁😁😁😁😁
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.