Skip to main content
Question

Preview first 2 pages

  • May 22, 2025
  • 2 replies
  • 11 views

Forum|alt.badge.img

I wanted to check if there is any API which I can use to display first 2 or 3 pages of document uploaded on box? it can be PDF or word or PPT. so originally it can have 10 pages but in preview i want to show first 2 or  pages only

2 replies

Forum|alt.badge.img

This isn't supported at the moment. If you're using the Preview component (https://github.com/box/box-content-preview), you can fork the code and modify behavior yourself by adding something like:

 

Object.defineProperty(doc, 'numPages', { value: Math.min(doc.numPages, 2) });
 

Forum|alt.badge.img

Hi, I wanted to achieve something similar but in asp.net on server side. Please suggest how to get the same. Thanks.