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

Add single page view for browsers #184

Open
NCC1701M opened this issue Feb 23, 2024 · 3 comments
Open

Add single page view for browsers #184

NCC1701M opened this issue Feb 23, 2024 · 3 comments

Comments

@NCC1701M
Copy link

The document in the browser will be displayed with two pages side by side. This even doesn't change when reading the document on a smaller device like a tablet or a phone. This isn't pretty comfortable and responsive.

Instead add an optional single page view for browser, like the Adobe Acrobat Reader provides. So people can scroll through the pages more comfortable and more space to the left and right can be used to display the page.

This single page view could also be switched to when the size of the browser falls below a certain size.

@julientaq
Copy link
Collaborator

hello.

pagedjs has no css to show pages on screen by default. It’s up to the user to set a css to preview the page if they want to.

That said, we have a basic interface.css we use often which has the possibility to show page vs spread (the css file is commented to easily allow this).

https://gitlab.coko.foundation/pagedjs/interface-polyfill/blob/master/interface.css

One detail. we shouldn’t take the window size into account to define how the pages are gonna show. Pagedjs is a tool to make paginated version (pdf and print) and can’t compete with all the tools for accessibility a single html page can bring.

Someone on a very small screen may want to make a very big book, and it’s up to them to decide how they wanna do it.

But your issue makes me wonder if we should have a paged.preview.js to give a preconfigured screen preview for user who’d need it.

@NCC1701M
Copy link
Author

I was refering to the interface.css because it was mentioned here.

So I thought you might support also other layouts for browsers.

But your issue makes me wonder if we should have a paged.preview.js to give a preconfigured screen preview for user who’d need it.

In my opinion this would be great

@itlackey
Copy link

itlackey commented May 15, 2024

I changed the width property of .pagedjs_page to use minmax which allows one or two page layout depending on viewport width. This is a quick hack but worked for my use case.

  .pagedjs_pages {
        display: flex;
        width: minmax(var(--pagedjs-width), calc(var(--pagedjs-width) * 2));
        flex: 0;
        flex-wrap: wrap;
        margin: 0 auto;
        justify-content: center;
    }

This does not solve the problem of viewing on small screens. However, this strategy of modifying the interface.css could go a long way in making the preview more responsive.

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

3 participants