react-doc-viewer icon indicating copy to clipboard operation
react-doc-viewer copied to clipboard

Doc viewer height not being adjusted

Open khaledgaaieb opened this issue 1 year ago • 7 comments

the height is not being update even when using the following code:

 <DocViewer
        documents={docs}
        pluginRenderers={DocViewerRenderers}
        style={{ height: "1000", width: "100%" }}
        config={{ header: { disableHeader: true } }}
      />

Image

khaledgaaieb avatar Apr 23 '25 20:04 khaledgaaieb

+1 please fix this as soon as possible.

nirmitsaini1024 avatar Apr 26 '25 13:04 nirmitsaini1024

https://view.officeapps.live.com/op/embed.aspx?src=${url_to_your_doc}

I ended up using view from officeapps

khaledgaaieb avatar Apr 27 '25 21:04 khaledgaaieb

https://view.officeapps.live.com/op/embed.aspx?src=${url_to_your_doc}

I ended up using view from officeapps

Thanks for the reply, also after embedding it, is there any way to search using a custom search bar and highlight the word in the viewer in brower. just like it does in pdf viewer locally.

nirmitsaini1024 avatar Apr 28 '25 10:04 nirmitsaini1024

+1 please fix this

joel-henry avatar Jun 23 '25 18:06 joel-henry

I ended up using:

#msdoc-iframe {
    height: 100vh;
  }

JosephScript avatar Jun 26 '25 12:06 JosephScript

.react-doc-viewer .fBdFME { height: 100% !important; }

Exclusiveideas avatar Aug 03 '25 13:08 Exclusiveideas

Added a custom container class

.chat-preview-wrapper { height: 100%;

#proxy-renderer { height: 100%; }

#msdoc-renderer { height: 100%; } }

jayesh96 avatar Aug 06 '25 10:08 jayesh96

Wrap the DocViewer in a container with a fixed height and override the internal element heights via CSS:

.doc-viewer-wrapper {
  height: 100%;
}

.doc-viewer-wrapper #react-doc-viewer,
.doc-viewer-wrapper #react-doc-viewer > div,
.doc-viewer-wrapper #proxy-renderer,
.doc-viewer-wrapper #msdoc-renderer,
.doc-viewer-wrapper #msdoc-iframe {
  height: 100% !important;
  overflow: auto;
}
<div className="doc-viewer-wrapper" style={{ height: '70vh' }}>
  <DocViewer
    documents={docs}
    pluginRenderers={DocViewerRenderers}
    style={{ height: '100%' }}
    config={{ header: { disableHeader: true } }}
  />
</div>

velrino avatar Feb 10 '26 23:02 velrino

Hello

I have create another please use that active maintaining

https://github.com/mehuljariwala/react-doc-viewer

mehul-faster avatar Feb 11 '26 05:02 mehul-faster