2

when I use pgfpages to resize my document all my hyperref links got displaced.

I need to scale my A4 document to 240mm x 170mm. But I want to keep all my bookmarks and document metadata.

Got anyone a solution or workaround?

Thanks!

Here is my MWE, note the cyan colored box, which is the actual clickable link to the website.

enter image description here

\documentclass[12pt, a4paper, oneside]{book}
\usepackage{pgfpages}
    \pgfpagesuselayout{resize to}[physical paper height=240mm, physical paper width=170mm]

\usepackage[
    %hidelinks,
]{hyperref}
\usepackage{lipsum}

\begin{document} 
\lipsum[2]\bigbreak
\url{https://tex.stackexchange.com}
\end{document}
  • 1
    well theoretically it is imho possible to calculate correct annotation coordinates. Pratically it is difficult. – Ulrike Fischer Apr 30 at 19:39
1

Unfortunately this is a long established limit using TeX to include PDF with links etc.

One possible method is to use a PDF rescale program and even Adobe products can have dificulties. I find the "easiest" to use is an online service that can either re define page (without scaling = similar to cropping) or scale (with/without constrained ratio) here are the results NOTE the page size is accurate to nearest 0.1 mm

enter image description here

  • That's not really a problem with including pdf (annotation simply vanish here) but of the rescaling. annotation coordinates are absolute page coordinates and don't honor transformations/scalings. – Ulrike Fischer May 1 at 9:32
  • @UlrikeFischer I could not see the relocated link highlights in second include (it may be the reader I used dropped them since it replaces missing ones with its own in the correct position) is there a setting I missed to show them – user170109 May 1 at 9:41
  • No, I only commented your first sentence. This here is a different problem to the standard "\includepdf loose links"-problem. – Ulrike Fischer May 1 at 9:51
  • Ok @UlrikeFischer would it be clearer to say link scaling is one of a few traditional problems when \including pdf's with links – user170109 May 1 at 11:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.