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

Bug: PDF preview can't show differing aspect ratios #320

Open
evamvid opened this issue Apr 13, 2023 · 1 comment
Open

Bug: PDF preview can't show differing aspect ratios #320

evamvid opened this issue Apr 13, 2023 · 1 comment

Comments

@evamvid
Copy link
Contributor

evamvid commented Apr 13, 2023

If individual pages are rotated in the PDF /Rotate page attribute (for example using the pdflscape package, the pdf preview displays them incorrectly.

In the PDF preview:
Screenshot from 2023-04-13 13-44-21

How it should look:
Screenshot from 2023-04-13 13-45-08

MWE:


\documentclass[]{report}

\usepackage{tabularx}
\usepackage{pdflscape}

\begin{document}

lorem ipsum
\pagebreak

\begin{landscape}
\begin{table}[h]
\begin{tabular}{cc}

lorem & ipsum\\ 

lorem & ipsum


\end{tabular}

\end{table}
\end{landscape}
\end{document}

The PDF should show the second page in a landscape format in this MWE.

@evamvid
Copy link
Contributor Author

evamvid commented Apr 14, 2023

Seems like the existing width/height code

            page_size = self.poppler_document.get_page(0).get_size()
            self.page_width = page_size.width
            self.page_height = page_size.height

actually will deliver widths and heights for rotated pages, without having to manually inspect the PDF page attributes. So to implement this, the layouter would need to query that for each individual page rather than just the first one. It makes the code for calculating the overall width and height, as well as zoom, offsets, and synctex boxes more complicated, though.

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

1 participant