Open gabrielastro opened 6 days ago
pdfjam is a shell-script front end to the LaTeX 'pdfpages' package (for which, see http://www.ctan.org/tex-archive/macros/latex/contrib/pdfpages). (cf. https://github.com/rrthomas/pdfjam/blob/master/pdfjam-help.txt#L1-L2)
In particular, pdfjam
is a wrapper script for using \includepdfmerge
in the pdfpages
package.
So, I guess, if \includepdfmerge
were able to do it, pdfjam
would be also.
Ok, that makes sense. Thanks! Maybe we can leave this open in case someone else has a solution (it does not seem easy with \includepdfmerge
).
Maybe this sort of thing could somehow be helpful?
pdfjam --pagecommand '' --preamble '\usepackage{fancyhdr} \pagestyle{fancy} \fancyfoot[c]{\texttt{the-file-name.pdf}} \usepackage[bottom=40pt]{geometry}' the-file-name.pdf
If that's the sort of thing you want, then it should be easily scriptable. The fancyhdr and geometry packages offer a lot of possibilities for headers, footers and their placement.
Hello David,
Thank you for your answer! That would need to be done for every document (i.e., every page of the final PDF collecting all documents) and then those temporary ones combined, yes? I guess one could script that (with a wrapper for pdfjam
that uses pdfjam
subprocesses, I guess). There are a few issues here:
--fitpaper 'true' --pagecommand '\thispagestyle{headings} \markboth{\texttt{the-file-name.pdf}}{\texttt{the-file-name.pdf}}'
is better, although the header is being put at some "random" position on the pageOne would need to look into the options of fancyhdr
(or headings
) to see how to put the file name at the top or bottom of the (non-standard-sized) pages.
I guess a wrapper script to pdfjam
would be the way, and the best would be if it were possible to activate it with an option to pdfjam
(--writefilenames [top|middle|bottom]-[left|right|centre]
or so).
Thanks,
Gabriel
First of all, thank you for this great script! Is there a way of adding to every output page the name of the original document? I am combining several one-page PDFs and important information is in the title of each document. Doing:
leads to a PDF with "a" as title (and then also the page number of the global output PDF, which I was not expecting but is not the biggest problem). Using
--no-tidy
and looking in/tmp/pdfjam-…/
reveals the reason:pdfjam
creates a temporary file nameda.tex
containing the include commands for the individual files. Is there a solution or a work-around? At worse in two steps, somehow first printing the file name on each individual document (onto a copy) and then combining those?I am surprised that no one else seems to have asked this… Thanks!