question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to display single pages in book mode?

See original GitHub issue

Hi Stephan,

I’m trying to build a mobile PDF viewer. I need to display only one page at the same time. pageViewMode="book" always shows 2 pages at the same time. When I use [scrollMode]="1", there isn’t this paging feeling.

What’s the right way to only display one page at the same time and allow paging?

Regards, Marius

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mariusbolikcommented, Nov 3, 2022

Got it, using only CSS. Thank you for the hints @stephanrauh!

 #viewerContainer {
   scroll-snap-points-x: repeat(100vw);
   scroll-snap-type: x mandatory;
   scroll-snap-stop: always;
   scroll-behavior: smooth;
   scrollbar-color: transparent transparent;
   -webkit-overflow-scrolling: touch;

   .page {
     scroll-snap-align: start;
   }
 }
0reactions
stephanrauhcommented, Nov 23, 2022

Thanks for keeping me up-to-date! I need to keep your hints in mind, because I’d like to add a demo using your ideas to the showcase. Too bad the list of nice ideas is piling up faster than I can solve them at the moment. I guess it’ll take a while.

BTW, this article seems to be a comprehensive wrap-up of CSS scroll snapping: https://css-tricks.com/practical-css-scroll-snapping/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can display single page view in Books on … - Apple Community
Hi,. Since I updated to iOS 14, Books will only display texts (.ePub) in two page view - not single page view.
Read more >
iBooks now displays in 2 pages mode. I want 1 page ... - Reddit
The Books app lays out in single or double column mode based on a concept called “readable width.” Generally, this is ~50 or...
Read more >
Can my flipbook be displayed as single pages? - FlippingBook
Open the Flipbooks tab in your account · Hover over a flipbook and click Customize · Click on the Settings group to expand...
Read more >
[Adobe InDesign] Change a spreads document to single ...
Your client needs to see multiple pages as spreads. Your printer needs single pages with bleeds and crops. Changing from spreads to single...
Read more >
Create a booklet or book in Word - Microsoft Support
Go to Layout and select the Page Setup dialog launch icon at the bottom-right corner. · On the Margins tab, change the setting...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found