1
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{amsfonts,amssymb}
\usepackage{txfonts}
\usepackage{ragged2e}
\usepackage{xcolor}
\usepackage{marginnote}
\usepackage{scrextend}
\usepackage{array}
\usepackage{enumitem}
\usepackage{mdwlist}
\usepackage[margin=1in]{geometry}
\usepackage{pgf}
\usepackage{pgfpages}
\usepackage{url}
\usepackage[colorlinks,urlcolor=blue]{hyperref}
\pgfpagesdeclarelayout{boxed}
{
  \edef\pgfpageoptionborder{0pt}
}
{
  \pgfpagesphysicalpageoptions
  {%
    logical pages=1,%
  }
  \pgfpageslogicalpageoptions{1}
  {
    border code=\pgfsetlinewidth{0.5pt}\pgfstroke,%
    border shrink=\pgfpageoptionborder,%
    resized width=0.92\pgfphysicalwidth,%
    resized height=.92\pgfphysicalheight,%
    center=\pgfpoint{.5\pgfphysicalwidth}{.5\pgfphysicalheight}%
  }%
}
\pgfpagesuselayout{boxed}
\begin{document}
\href{https://twitter.com/foodyrelish}{Go to Twitter}\\
\textcolor[rgb]{0.5,0,0.5}{\colorbox[rgb]{0.75,0.75,0.75}{\texttt{Internal Links}}}
\begin{enumerate}
\item{Link for Facebook: \url{https://twitter.com/foodyrelish}}
\item{Link for Twitter: \url{https://www.facebook.com/Foody-Relish-105377898514997}}
\item{Link for Instagram: \url{https://www.instagram.com/foodyrelish12/}}
\item{Link for Linkedin: \url{https://www.linkedin.com/in/vishakha-potdar-2205031aa/}}
\end{enumerate}
\end{document}
Ingmar
  • 6,690
  • 5
  • 26
  • 47
Vishakha
  • 119
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 14 '21 at 11:21
  • sorry but it won't work. If you shrink the page like this with pgfpages the links are misplaced. If you only want a border around the page you don't need pgfpages, you can draw it e.g. with eso-pic or the shipout hooks. – Ulrike Fischer Sep 14 '21 at 12:41

1 Answers1

2

The pgf manual explicitly warns about this

A word of warning: using pgfpages will destroy hyperlinks. Actually, the hyperlinks are not destroyed, only they will appear at totally wrong positions on the final output.

If you don't use colorlinks but links borders you can see the problem e.g. in adobe reader. All link rectangle are misplaced. It is therefore not recommended to use pgfpages if links are involved. Borders around pages can be easily implemented without it.

enter image description here

Ulrike Fischer
  • 327,261