Stats.NumberOfPages

Post Reply
User avatar
foxpalace
Member
Posts: 33
Joined: Fri Jan 14, 2011 12:25 pm
Location: Germany

Stats.NumberOfPages

Post by foxpalace »

Hi,
how do I get the Switch-Stats-Values in NodeJS?
Greeting
Michael
laurentd
Member
Posts: 137
Joined: Wed Mar 13, 2019 2:06 pm

Re: Stats.NumberOfPages

Post by laurentd »

Hi Michael,

Switch 2021 Spring will bring PdfDocument and PdfPage Classes.
getNumberOfPages( ) is what you need.
It will be released on May 27th.
Laurent De Wilde, Solution Architect @ Enfocus
User avatar
foxpalace
Member
Posts: 33
Joined: Fri Jan 14, 2011 12:25 pm
Location: Germany

Re: Stats.NumberOfPages

Post by foxpalace »

Hi Laurentd,

today ist May 27th, System requirements is uptodate, but I can't download 2021 spring. I would like to update my Switch-Dev-Version :)
laurentd
Member
Posts: 137
Joined: Wed Mar 13, 2019 2:06 pm

Re: Stats.NumberOfPages

Post by laurentd »

Hi Michael,

The mail about Switch 2021 Spring has been sent an hour ago.
https://www.enfocus.com/en/support/rele ... ease-notes
Laurent De Wilde, Solution Architect @ Enfocus
Sunnyland
Member
Posts: 56
Joined: Mon Aug 19, 2013 1:34 am

Re: Stats.NumberOfPages

Post by Sunnyland »

Looking to get the Width and Height of the PDF Document. I have upgraded to Switch Fall 2021 my node script has be written previous to PdfDocument being added to Spring 2021.

What do I need to do to update my script as it is not reconising PdfDocument as a class?

My nodejs version is 14.15.0
laurentd
Member
Posts: 137
Joined: Wed Mar 13, 2019 2:06 pm

Re: Stats.NumberOfPages

Post by laurentd »

Here is an example how to use PdfDocument and PdfPage classes on our EnfocusSW GitHub:

https://github.com/EnfocusSW/PdfProperties
Laurent De Wilde, Solution Architect @ Enfocus
Sunnyland
Member
Posts: 56
Joined: Mon Aug 19, 2013 1:34 am

Re: Stats.NumberOfPages

Post by Sunnyland »

Thanks Laurentd,
But from what can figure out my script is using verion 1.0.1 of types-switch-scripting, To update to fall 2021 I think I should be using version 21.1.0. What is the best way to update this without writing the script again?
laurentd
Member
Posts: 137
Joined: Wed Mar 13, 2019 2:06 pm

Re: Stats.NumberOfPages

Post by laurentd »

The PdfDocument and PdfPage classes were introduced with Switch 2021 Spring.
This will update the type definition:
npm i @types/switch-scripting@1.1.0
Laurent De Wilde, Solution Architect @ Enfocus
Sunnyland
Member
Posts: 56
Joined: Mon Aug 19, 2013 1:34 am

Re: Stats.NumberOfPages

Post by Sunnyland »

Thanks Laurentd,
Really appreciate the replies.
I received an error '@types/switch-scripting@1.1.0' is not in the npm registry.

I just had to change npm i @types/switch-scripting@1.1.0
to
npm i @types/switch-scripting and it updated fine.
Post Reply