0

I am attempting to get the total number of pages of an external PDF document as a lua variable through

\saveimageresource{index.pdf}%
\the\lastsavedimageresourcepages

see: How to get number of pages of external pdf file in Lualatex?

However, when i call the lua code, the returned value is nil.

token.get_macro('lastsavedimageresourcepages') returns nil

I also tried tex.count['lastsavedimageresourcepages'] but it throws an error.

1 Answers1

2

You want

tex.lastsavedimageresourcepages

to access the value from Lua

David Carlisle
  • 757,742