cyntler / react-doc-viewer

File viewer for React.
https://cyntler.github.io/react-doc-viewer
Apache License 2.0
391 stars 127 forks source link

Manage Pdf controles #216

Open RutvikJR opened 10 months ago

RutvikJR commented 10 months ago

I want to disable the download option in pdf control. I have gone through the documentation and code but have not been able to find any way to do it. I think I can do it manually by overriding CSS but it will be better if we have options to manage it in config. `<DocViewer style={{ width: "30vw" }} documents={[ { uri: getFileUrl(document?.document_path ?? ""), fileName: document.document_type, }, ]}

            config={{
              pdfZoom: {
                defaultZoom: 0.5,
                zoomJump: 0.2,
              },

              header: {
                disableHeader: true,
              },
            }}
          />`

image Here in the image I don't want to show the download button dynamically.

avichovatiya67 commented 7 months ago

Found any way out?

TheThinkPotato commented 5 months ago

Try using styling through className = in the DocViewer component

            <DocViewer
                config={config}
                documents={previewFile}
                className={style.docViewer}
            />

================= MY Styles.ts ================================

image

` export default mergeStyleSets({ docViewer: {

        zIndex: 10,
        justifyContent: "center",
    },
    ["#pdf-download"]: {
        visibility: "hidden",
    },
},

}); `