banthagroup / fslightbox-react

Basic version of Fullscreen Lightbox for React.js. Website: https://fslightbox.com/react
MIT License
169 stars 23 forks source link

[FR] Add support of PDF file in data sources #162

Closed ghost closed 3 years ago

ghost commented 4 years ago

Feature Request:

It would be nice if you add support, I was working on project where i have image, video and pdf files to show when clicked, images and videos are working great, but pdf not quite even if i try custom data sources, iframe and many other things.

piotrzdziarski commented 3 years ago

Custom source is directly copied into lightbox so there is nothing lightbox can do that you can't. If you don't know what kind of PDF look is best for you how can other people know? If I would be adding PDF support to lightbox I would do it via iframe. But size of package matter and I've decided that there will be no more than 3 basic types.

Maybe you didn't add the dimensions to iframe?

<FsLightbox
  sources={[
    <iframe src="example.pdf" width="1080px" height="1920px" />
  ]}
/>