I have a problem that is bothering me for quite a while. I would like to insert a couple of pdfs automatically as attachments to a document. The user copies a bunch of pdfs in a folder, where he finds a .bat file that will create the attachments.tex document from all files automatically. The process is automated pretty far, the .bat creates a \section{} element for every pdf, too, checks for signs incompatible with Latex and removes them, such as $, & or spaces and so on.
Because it is doing all by itself already, I don't want to bother the user with the parameters of the inlcudepdf command. So, landscape documents should be included on landscape paper automatically.
I could do that by using the command
\includepdf[fitpaper]{attachment.pdf}
Unfortunately, there are often pretty large drawings (A3,A2 paper). So I would like to have them scaled down to A4. Using the command
\includepdf[templatesize={211mm}{298mm},rotateoversize]{attachment.pdf}
I was able to have them all scaled down to A4 and automatically rotated, which is close to what I was looking for and the best solution so far.
What I cannot find is a scale down to A4, without a rotation for oversize pages. The parameter 'landscape=true' needs to be set manually for all landscape documents at the moment, which is tedious. Basically what I would need is parameter for pdfpages like
landscapeoversize
Unfortunately, this does not exist. Is there any workaround with the pdfpages package itself which I just did not think of?