Power Automate - Open PDF and move last page to front

Hi @dwells1,

Yes, it's possible

  1. You need to count the number of pages in the source PDF. Add Compose action and this expression.

image

sub(length(split(replace(base64ToString(outputs('Get_file_content')?['body']['$content']), 'Type/Pages', ''), 'Type/Page')),1)
  1. Add an integer variable to get the number of pages without the last page.

image

  1. Finally, replace all static page number values in the Plumsaill actions.

This is how the entire flow looks like

Best regards,
Petr
Plumsail team