rrthomas / pdfjam

The pdfjam package for manipulating PDF files
GNU General Public License v2.0
378 stars 28 forks source link

pdfpages link possibility messed up #44

Open jalsti opened 3 years ago

jalsti commented 3 years ago

pdfpages link possibility gets messed up, if using more than one input file, through pdfjams method of passing full paths in the generated .tex file. If pdfjam would use \includepdfmerge[link=true]{source-1.pdf,-,source-2.pdf,-} in the resulting TeX file, instead of full temporary pathes like \includepdfmerge[link=true]{/tmp/pdfjam-b8ERTD/source-1.pdf,-,/tmp/pdfjam-b8ERTD/source-2.pdf,-} the users had the possibility to link to the pdf pages from the outside. e.g. with LaTeX command \href{file:/my/local/merged.pdf#source-1.pdf.1}{merged.pdf} and \href{file:/my/local/merged.pdf#source-2.pdf.1}{merged.pdf} one could link to pages 1 of source file 1 and source file 2. But with the existing pdfjam method, one can only link safely to the first file, through an additional parameter --linkname myfooname and \href{file:/my/local/merged.pdf#myfooname.1}{merged.pdf} but you can not link to page 1 of the second file, because the link target has the same name as the first one (you can not link to page 51, to reach page 1 of the second document, when the first has 50 pages, myfooname.51 would not exist (if no single document is longer than 50 pages), myfooname.1 would point to first document). Using relative paths would leave a workaround via the known source file names, which are not known if pdfjam uses the full temporary path. (pdfjam 3.03)