diff options
author | Luigi Scarso <luigi.scarso@gmail.com> | 2019-10-23 10:18:54 +0000 |
---|---|---|
committer | Luigi Scarso <luigi.scarso@gmail.com> | 2019-10-23 10:18:54 +0000 |
commit | 51f7cee7467569b9546d4d6d734f17da517b2b7a (patch) | |
tree | 540f68a0e6492622fe14f5a9072aa705847fcd35 /Master/texmf-dist/doc/luatex | |
parent | 4d6504c339b37aa04c36ab3e5af83c5d3ed170d4 (diff) |
luatex: different page reshuffle callback. WARNING: DROPPED the "page_objnum_provider" callback, replaced with "page_order_index". (HH)
git-svn-id: svn://tug.org/texlive/trunk@52497 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/luatex')
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex-callbacks.tex | 27 | ||||
-rw-r--r-- | Master/texmf-dist/doc/luatex/base/luatex.pdf | bin | 1562033 -> 1562048 bytes |
2 files changed, 13 insertions, 14 deletions
diff --git a/Master/texmf-dist/doc/luatex/base/luatex-callbacks.tex b/Master/texmf-dist/doc/luatex/base/luatex-callbacks.tex index 9be3e363547..965fba80629 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex-callbacks.tex +++ b/Master/texmf-dist/doc/luatex/base/luatex-callbacks.tex @@ -1038,7 +1038,7 @@ end This callback is called after the \PDF\ page stream has been assembled and before the page object gets finalized. -\subsection{\cbk {page_objnum_provider}} +\subsection{\cbk {page_order_index}} \topicindex{callbacks+\PDF\ file} @@ -1046,28 +1046,27 @@ This is one that experts can use to juggle the page tree, a data structure that determines the order in a \PDF\ file: \startfunctioncall -function(objnum) - return objnum +function(pagenumber) + return pagenumber end \stopfunctioncall -We can for instance swap the first and last page: +Say that we have 12 pages, then we can do this: \starttyping -local n = 0 -callback.register("page_objnum_provider",function(objnum) - n = n + 1 - if n == 1 then - return pdf.getpageref(tex.count[0]) - elseif n == tex.count[0] then - return pdf.getpageref(1) - else - return objnum +callback.register("page_order_index",function(page) + if page == 1 then return 12 + elseif page == 2 then return 11 + elseif page == 11 then return 2 + elseif page == 12 then return 1 + else return page end end) \stoptyping -When you mess things up \unknown\ don't complain. +This will swap the first two and last two pages. You need to know the number of +pages which is a side effect of the implementation. When you mess things up +\unknown\ don't complain. \subsection{\cbk {process_pdf_image_content}} diff --git a/Master/texmf-dist/doc/luatex/base/luatex.pdf b/Master/texmf-dist/doc/luatex/base/luatex.pdf Binary files differindex 023d11189da..f84677d0c27 100644 --- a/Master/texmf-dist/doc/luatex/base/luatex.pdf +++ b/Master/texmf-dist/doc/luatex/base/luatex.pdf |