latex3 / pdfresources

LaTeX PDF resource management
LaTeX Project Public License v1.3c
23 stars 7 forks source link

pdfpages incompabilities #15

Closed u-fischer closed 3 years ago

u-fischer commented 3 years ago

pdfpages uses a command of pdflscape which is not longer there in the replacement.

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{uncompress}
\documentclass{article}
\usepackage{pdfpages}
\begin{document}
\includepdf[landscape=true]{example-image}
\end{document}

gives

! Undefined control sequence.
\AM@setRotate ->\PLS@Rotate 

pdfpages should use the pdfmanagement commands instead., but this need further analyzing.

u-fischer commented 3 years ago

This here should probably work:

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{uncompress}
\documentclass{article}
\usepackage{pdfpages}
\makeatletter

\ExplSyntaxOn\makeatletter
\def\AM@setRotate{\pdfmanagement_add:nnn{Page}{Rotate}{90}}
\def\AM@resetRotate{\pdfmanagement_remove:nn{Page}{Rotate}}
\ExplSyntaxOff \makeatother
\begin{document}
\includepdf[landscape=true]{example-image}
\end{document}

The main question is if pdfpages should try to store an existing rotation first ... or if actually should use \pdfmanagement_add:nnn{ThisPage}{Rotate}{90}

AndreasMatthias commented 3 years ago

Pdfpages version 0.5t will fix this issue. I've just uploaded it to CTAN.