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

Multiple page orientations / Workaround for wide tables #1398

Closed
buhtz opened this issue Jul 14, 2021 · 2 comments
Closed

Multiple page orientations / Workaround for wide tables #1398

buhtz opened this issue Jul 14, 2021 · 2 comments
Labels
CSS Questions about how to do something with CSS

Comments

@buhtz
Copy link

buhtz commented Jul 14, 2021

I know about the problems with to big/wide tables (e.g. #36) and understand how WeasyPrint work with this currently. This is not a bug report about that problem!

In my case I do not want to modify the big tables but I want to modify the related PDF pages. I want to change there orientation to horizontal and/or make them bigger (e.g. A3 or A2).

But I want to do this just for the one page with the big table not for all.

Technically (for Python3) broken down my questions:

  1. Can I have different page orientations and sizes in one PDF file? And how do I do this? e.g. a piece of html-code like <pdf:page-break:horizontal> and after the table-code back <pdf:page-break:default>.
  2. Is there a way check if a table is to wide for a page, e.g. a warning or an Exception.
@grewn0uille
Copy link
Member

grewn0uille commented Jul 15, 2021

Hello!

Can I have different page orientations and sizes in one PDF file? And how do I do this? e.g. a piece of html-code like pdf:page-break:horizontal and after the table-code back pdf:page-break:default.

Yes you can have different page orientations and sizes in a PDF file.
To do that, you can use @page CSS at-rule.

For example, if your HTML looks like:

<div>bonjour</div>
<div class="horizontal">hello</div>

And your CSS:

@page my_page {
    size: landscape;
}

.horizontal {
    page: my_page;
}

The first div will be on a portrait page, and the second one will be on a other page in landscape mode.

Is there a way check if a table is to wide for a page, e.g. a warning or an Exception.

No there isn’t.

@liZe liZe added the CSS Questions about how to do something with CSS label Jul 15, 2021
@liZe
Copy link
Member

liZe commented Aug 17, 2021

@Codeberg-AsGithubAlternative-buhtz Is there anything more we can do for you?

@buhtz buhtz closed this as completed Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Questions about how to do something with CSS
Projects
None yet
Development

No branches or pull requests

3 participants