I really didn't think this was even possible until I came across, cross-referencing-to-included-pdf-with-counter-and-argument-in-the-label, reading that post gave me some hope.
I have a document, where the text will include references to a Bates numbered record, to be cited like this:
I really think that x proves y. [R page 132]
The problem I have is that my record consists of many pdf files, and some may be added, after I have started to draft references to that record.
The code I would like to modify, from the referenced post, is below:
\documentclass[12pt,a4paper,fleqn,parskip=half]{scrartcl}
\usepackage{lscape}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[demo]{graphicx}
\usepackage[scaled]{helvet}
\usepackage{caption}
\usepackage[breaklinks=true,colorlinks=true,linkcolor=black,citecolor=black,urlcolor=black]{hyperref}
\usepackage{xargs}
%---------------------------------------------------------------------
% % Macro to find the number of pages of included PDF document
%---------------------------------------------------------------------
\makeatletter
\newcounter{imagepage}
\newcommand*{\foreachpage}[2]{
\begingroup
\sbox0{\includegraphics{#1}}
\xdef\foreachpage@num{\the\pdflastximagepages}
\endgroup
\setcounter{imagepage}{0}
\@whilenum\value{imagepage}<\foreachpage@num\do{%
\stepcounter{imagepage}
#2\relax
}
}
\makeatother
%---------------------------------------------------------------------
% % Macro to include PDF document with page numbers in caption and label
%---------------------------------------------------------------------
\makeatletter
\newcommandx{\picTEST}[5][1=0.9, 2=0]
{
\foreachpage{#4}
{
\begin{figure}[h!]
\centering
\makebox[\textwidth]{\includegraphics[width=#1\hsize,page=\value{imagepage},angle=#2]{#4}}
\caption{#5 - Page \arabic{imagepage} of {\the\pdflastximagepages}}
\label{#3\theimagepage}
\end{figure}
\clearpage
}
}
\makeatother
\begin{document}
\section{Some Text}
Here is reference to page \ref{Document1_Label_Page3} of the included PDF document.
\newpage
\section{Some insert of PDF document}
\picTEST{Document1_Label_Page}{quickcode.pdf}{Document1}
\end{document}
The above referenced code could be used for this if:
Multiple pdfs can be output as "bates" numbering across the entire set of pdfs. For instance for two 10 page pdf documents the first pdf document is numbered 1-10, the second numbered 11-20 etc.
The word "figure" could be replaced with the word "record" and the printing of the pdf filename completely supressed.
The pdf produced could be bigger and centered instead of off to the right.
Thanks.