My PDF document generated with LaTeX has roman numbering for the frontmatter.

My problem is: if I want to print a certain range of pages, it is very difficult to select them, because my PDF Viewer (Skim.app or Preview.app in MacOS X 10.6.8) seems to count the pages from the beginning of the PDF (1 = first page of PDF), but it displays the correct page numbers of the document (so page 1 is the first page of the mainmatter).

Is there a way to solve this so that the page numbers displayed are the same like those I have to enter in the printing dialog?

Here is a simple example:

\documentclass{scrbook}
\usepackage{hyperref}
\begin{document}
\frontmatter
\section{Here starts the Frontmatter}
text frontmatter
\mainmatter
\section{here starts the mainmatter}
text mainmatter: in my PDF viewer this is page 1, but when I would like to print it, I'd have to print page 3 (selecting page 1 in the print dialog would print page i, the first page of the PDF)
\backmatter
\section{here comes the backmatter}
text backmatter
\end{document}

I do not know about Adobe Reader (can’t test here) but both Foxit and SumatraPDF show both numbers, the TeX number (i, ii, 1, 2, 3) and the PDF number (1, 2, 3, 4, 5). (In SumatraPDF you can even type “ii” to get to the second PDF page.) Though you still have to choose the PDF number to select the printing range.
–
QrrbrbirlbelJan 3 '13 at 23:30

2

@TorbjørnT. Acrobat shows the "text" page numbers and uses them in the print dialog as well, so never dare to have two pages with the same number (2 and ii is ok, but ii and ii is not). Another problem might be with a page that accidentally has no page number at all.
–
yo'Jan 3 '13 at 23:38

1

@tohecz: Seems like a serious bug in AR: The labels are just labels and every page can have the same or none. Viewers must cope with that.
–
Martin SchröderJan 4 '13 at 10:35

Try to put this in your preamble. We use \EveryShipout to step our new counter xpage with every shipped page, then we use \texorpdfstring to write something different in text and in PDF comments. In the PDF comments we write this number. The modification of \pagenumbering ensures that our modified numbering is used correctly everywhere.

\makeatletter
\usepackage{everyshi}
\newcounter{xpage}\stepcounter{xpage}
\def\@xnumber#1#2{\texorpdfstring{#1{#2}}{\@arabic\c@xpage}}
\def\@xroman{\@xnumber{\@roman}} % repeat for every numbering style you use
\def\@xRoman{\@xnumber{\@Roman}} % repeat for every numbering style you use
\def\@xarabic{\@xnumber{\@arabic}} % repeat for every numbering style you use
\let\@xpagenumbering\pagenumbering
\def\pagenumbering#1{\@xpagenumbering{x#1}}
\pagenumbering{arabic}
\EveryShipout{\stepcounter{xpage}}
\makeatother

thanks a lot for your help! Could your code have any side-effects on other things or features? I'm sorry, I found a simple solution to my printing problem myself (see my answer tex.stackexchange.com/a/89192/4009 )
–
MartinJan 3 '13 at 23:32