[NTG-context] page-ini.lua, was Re: option for printing range

Rik Kabel context at rik.users.panix.com
Sat Feb 24 21:29:16 CET 2018


On 2018-02-24 13:50, Hans Hagen wrote:
> On 2/24/2018 11:31 AM, Pablo Rodriguez wrote:
>> Hans,
>>
>> would it be possible to add an key to \setupinteractionscreen that
>> implements the /PrintPageRange key in the /ViewerPreferences dictionary
>> (https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf#page=373)? 
>>
>>
>> For example, "\setupinteractionscreen[range={2, 4-7, 10}]" should add
>> the "/PrintPageRange [1 1 3 6 9 9]" in /ViewerPreferences. (BTW, the key
>> name is the first one that came to my mind.)
>>
>> This is extremely useful to help the user to print only the required
>> pages and not the whole document (which may be required only for viewing
>> purposes).
> well, 'extremely' is a bit of a exaggeration i guess as most of these 
> fancy acrobat only features are hardly used or requested (i still have 
> to meet a publisher who wants anything fancy pdf anyway) so we're 
> talking of yet another feature creep that probably only one person 
> will use
>
> anyway, that said, as we use abstraction and as we don't know pages in 
> advance the only way i'm willing to support it is by using the 
> (probably unknown) marked pages feature
>
> \setupinteractionscreen
>   [print={foo,oof}]
>
> \starttext
>
> % \markpage[foo][1,4,5]
> % \markpage[foo][+2]
>
> \markpage[foo] foo \page
> \markpage[foo] foo \page
> \markpage[oof] oof \page
> \markpage[bar] bar \page
> \markpage[foo] foo \page
> \markpage[foo] foo \page
> \markpage[bar] bar \page
> \markpage[foo] foo \page
> \markpage[oof] oof \page
> \markpage[bar] bar \page
>
> \stoptext
Hans,

A question on the code in page-ini.lua.

Should there be a test for a '-' with subtraction from realpage if 
present, as there is for '+' and addition to realpage, around line 
number 28-30, or is it the case that it does not make sense to mark a 
prior page? (If it does not make sense, why parse the '-'?)

-- 
Rik


More information about the ntg-context mailing list