-1

The PDF that should be in the middle

In the image above, I have to start the PDF from the left; otherwise, if I use the centre alignment, it causes horizontal scrolling issues.

So I don't want the horizontal scroll to break, and I want it to enlarge starting from the left.

 <div ref={containerRef} className="flex flex-col items-start py-4 w-full h-full overflow-auto" > <Document file={patch} onLoadSuccess={onLoadSuccess}> {Array.from(new Array(numPages), (_, i) => ( <div key={i} ref={(el) => (pageRefs.current[i] = el)} className="flex mb-4 w-full" > <Page pageNumber={i + 1} width={containerWidth} scale={zoom} renderTextLayer={false} renderAnnotationLayer={false} /> </div> ))} </Document> </div > 
1
  • You wrapped the Document in a flex container. Unfortunately, without a reproduction I can only guess that in a column-oriented flex you should use items-center instead of items-start (play.tailwindcss.com/Fld6RqemJ2). It's also unclear whether Document is a real DOM element or a virtual one (if it's a DOM element, why on earth does it need flex flex-col? If it's virtual, then I assume you mean the pages). The layout is quite messy. A reproduction would help a lot. Commented 2 days ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.