[Tex/LaTex] Different page labels/numbering in PDF viewer

arabichyperrefnumberingpage-numberingroman

I am using the report class and would like to have front matter with a different numbering than the main matter.
So I use Roman numbering at first and then Arabic numbering later on, but what I would like is when viewing the PDF that page 1 corresponds to the actual page 1 (and not I) etc when quickly jumping to a page (and then I would give the page with page number I).

So I tried to include:

\usepackage[
    pdfpagelabels,
    hidelinks
]{hyperref}

Which in essence works, but it's giving me all kinds of problems, so I was wondering whether it was possible to do this without using hyperref?

MWE, this is essentially what I want to achieve, but hopefully without hyperref.

\documentclass{report}
\usepackage[%
    pdfpagelabels,
]{hyperref}

\pagenumbering{Roman}

\begin{document}

\chapter{chap1}

Bla bla bla

\cleardoublepage

\pagenumbering{arabic}

\chapter{chap2}
bla bla bla 

\end{document}

Thanks in advance!

Best Answer

For pdfTeX:

\documentclass{report}

\pagenumbering{Roman}

\begin{document}

\chapter{chap1}

Bla bla bla

\cleardoublepage
% Best place at the start of the Arabic numbered pages
% after \cleardoublepage and before the page number is
% reset in \pagenumbering{arabic}.
\pdfcatalog{%
  /PageLabels<<%
    /Nums[%
      % Page numbers are zero based.
      % Uppercase roman numbers starting with first page.
      0<</S/R>>%
      % Arabic numbers starting with current page.
      \the\numexpr\value{page}-1\relax<</S/D>>%
    ]%
  >>%
}
\pagenumbering{arabic}

\chapter{chap2}
bla bla bla

\end{document}

The syntax for /PageLabels is specified in the PDF specification, section "12.4.2 Page Labels".