Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically created /MediaBox entry cannot be overwritten by setting it manually. #44

Open
khzimmer opened this issue Jan 10, 2023 · 2 comments

Comments

@khzimmer
Copy link

khzimmer commented Jan 10, 2023

Hi,
I am using LuaHBTeX, Version 1.15.0 (TeX Live 2022)
Development id: 7509

Problem: It is not possible to remove/overwrite the automatically created /MediaBox entry.

Example:

\DocumentMetadata{uncompress}
\documentclass[paper = 180bp:280bp]{scrbook}
\ExplSyntaxOn
\pdfmanagement_remove:nn{Page}{MediaBox}
\ExplSyntaxOff
\PDFManagementAdd{Page}{MediaBox}{[0\space0\space200\space300]}
\begin{document}
x
\end{document}

This appears in the PDF:

<< /Type /Page /Contents 8 0 R /Resources 6 0 R /MediaBox [ 0 0 180 280 ] /MediaBox [0 0 200 300] /Parent 10 0 R >>

So the pdfmanagement_remove call seems to be ignored, and I now have two entries, instead of just the second one.

Cheers
Karl-Heinz

@khzimmer khzimmer changed the title Automatically created /MediaBox entry has too small size, and changing it produces two entries. Automatically created /MediaBox entry has too small size. Jan 10, 2023
@khzimmer khzimmer changed the title Automatically created /MediaBox entry has too small size. Automatically created /MediaBox entry cannot be overwritten by setting it manually. Jan 10, 2023
@u-fischer
Copy link
Member

Basically this is a luatex problem. Unlike pdftex the engine doesn't remove an existing /MediaBox if another one is added with the equivalent of \pdfpageattr.

I will write to the luatex list perhaps that can be improved. For now I suggest that you set the mediabox with \pageheight and \pagewidth. That works fine.

@khzimmer
Copy link
Author

That's great. Thank you. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants