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

How to make plugins responsive #902

Closed
amansani15 opened this issue Dec 2, 2021 · 2 comments
Closed

How to make plugins responsive #902

amansani15 opened this issue Dec 2, 2021 · 2 comments
Labels
question Further information is requested

Comments

@amansani15
Copy link

Hello, thanks for the nice library.

When I resize the window using multiple plugins, few of them are not within the box. I know this is something to do with the css, but just wondering if you already have any fix on that. Like if I use toolbar plugin, then the options within the toolbar will get adjusted according to the size of the screen. How can we make this work with individual multiple plugins?

`<div
className="rpv-core__viewer"
style={{
border: '1px solid rgba(0, 0, 0, 0.3)',
display: 'flex',
flexDirection: 'column',
height: '100%',
width: '100%',
}}
>

        <div
            style={{
                alignItems: 'center',
                backgroundColor: '#eeeeee',
                borderBottom: '1px solid rgba(0, 0, 0, 0.3)',
                display: 'flex',
                justifyContent: 'center',
                padding: '4px',  
                position: 'relative'                  
            }}
        >
            <div style={{ padding: '0px 2px'}}>
                <GoToFirstPageButton />
            </div>                
            <div style={{ padding: '0px 2px' }}>
                <GoToPreviousPage />
            </div>
            <div style={{ padding: '0px 2px', width: '4rem' }}>
                <CurrentPageInput />
            </div>
            <div style={{ padding: '0px 2px' }}>
                <GoToNextPageButton />
            </div>
            <div style={{ padding: '0px 2px' }}>
                <GoToLastPageButton />
            </div> 
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <div style={{ padding: '0px 2px' }}>
                Search:                     
            </div>
            <div style={{ padding: '0px 2px' }}>                   
                <ShowSearchPopoverButton />
            </div> 
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <div style={{ padding: '0px 2px' }}>
                <CurrentPageLabel>
                    {(props: RenderCurrentPageLabelProps) => (
                        <span>{`${props.currentPage + 1} of ${props.numberOfPages}`}</span>
                    )}
                </CurrentPageLabel>
            </div>
            <div style={{ padding: '0px 2px' }}>
                <ZoomOutButton />
            </div>
            <div style={{ padding: '0px 2px' }}>
                <ZoomPopover />
            </div>
            <div style={{ padding: '0px 2px' }}>
                <ZoomInButton />
            </div>
            <EnterFullScreenButton />
            <DownloadButton />
            <OpenButton />
            <PrintButton />
            <ShowPropertiesButton />
        </div>
        
        <div
            style={{
                flex: 1,
                overflow: 'hidden',
            }}
        >                
            <Worker workerUrl="https://unpkg.com/pdfjs-dist@2.6.347/build/pdf.worker.min.js">                        
                <Viewer fileUrl={fileUrl} plugins={[pageNavigationPluginInstance, searchPluginInstance, fullScreenPluginInstance, getFilePluginInstance, openPluginInstance, printPluginInstance, propertiesPluginInstance, zoomPluginInstance]} initialPage={pageNumber} defaultScale={SpecialZoomLevel.PageFit}> 
                </Viewer>
            </Worker>
        </div>
    </div>`

image

@phuocng
Copy link
Member

phuocng commented Dec 3, 2021

You have to do it yourself. The library can't deal with the custom toolbar.

@phuocng phuocng added the question Further information is requested label Dec 3, 2021
@amansani15
Copy link
Author

Okay, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants