[texhax] [RESOLVED] TeX based presentations -- setting up "print dialog presets"

Suresh Govindachar sgovindachar at yahoo.com
Tue Apr 1 07:00:37 CEST 2014


Good news!: For the situation of a pdf file being generated from TeX, 
have figured out how to initialize the "Print Page Range" entry of the 
section titled "Print Dialog Presets" in the pdf document's properties 
with values that would results in printing just the pages 
1,3,6,9,12,16-18,20-22,26,30,32,33:

Essentially, in the TeX file, add code along the lines of:

   \immediate\pdfobj
   { [0 0 2 2 5 5 8 8 11 11 15 17 19 21 25 25 29 29 31 31 32 32] }

   \xdef\objDLJS{\the\pdflastobj\space 0 R}
   \pdfcatalog{
      /Type/Catalog/ViewerPreferences<</PrintPageRange \objDLJS>>
   }

When the resulting pdf file is opened in a text editor, one will see 
something like:

   3 0 obj
    [0 0 2 2 5 5 8 8 11 11 15 17 19 21 25 25 29 29 31 31 32 32]
   endobj

   849 0 obj <<
   /Type /Catalog
   /Pages 839 0 R
   /Outlines 840 0 R
   /Names 848 0 R
    /Type/Catalog/ViewerPreferences<</PrintPageRange 3 0 R>>  /PageMode 
/UseOutlines
   >> endobj

You might not see the stuff about Outlines;  I see them because my TeX 
file additionally has \pdfcatalog{/PageMode /UseOutlines}

--Suresh










More information about the texhax mailing list