[luatex] [EXT] Iteration over the dictionary of a stream

Andreas Matthias andreas.matthias at gmail.com
Wed Mar 31 21:13:44 CEST 2021


Hans Hagen wrote:
>
>     local doc = pdfe.open ('h.pdf')
>     local page = doc.Pages[1]
>     local a = pdfe.dictionarytotable(page)
>     print("page",a)
>     local b = a.Contents
>     print("contents",b[1],b[2],b[3])
>     local c, d, e = pdfe.getfromreference(b[2])
>     print("stream",c,d,e)
>     local f = pdfe.dictionarytotable(e)
>     print("whatever",f)
>
> a stream object is a referenced object with a stream and a dictionary

Thank you, this helped a lot. It seemed to be trickier than I thought it would
be. But it also revealed that I had some other flaws in my code, because
I did not respect reference correctly. I was always wondering why one would
need getfromreference() at all. Now I know better. Thanks.

Andreas


More information about the luatex mailing list.