wonday / react-native-pdf

A <Pdf /> component for react-native

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FitPolicy does not work based on canvas width on iOS

MuazzezA opened this issue · comments

packege.json

 "react-native": "0.72.4",
 "react-native-blob-util": "^0.19.6",
 "react-native-pdf": "^6.7.4",

This error only happens on iOS platform.

In iOS, the first image of my pdf file is quite small compared to the other images. Think of it as a picture cropped in half.
I think it takes the size of the whole pdf according to the size of the first canvas. That's why I can't see the whole big image on the screen.

I have tried:

  • FitPolicy 0/1/2 all with the same result
  • I set the scale value smaller than normal
container: { // style for the view that wraps the pdf
    flex: 1,
    justifyContent: 'flex-start',
    alignItems: 'center',
  },
  pdf: { // for pdf 
    flex: 1,
    width: Dimensions.get('screen').width,
    height: Dimensions.get('screen').height,
   // screen or window values make no difference.
  },

Screenshot 2024-02-02 at 12 55 00

this is what I get in my native pdf viewer, but in the pdf package the cat image takes up the whole screen horizontally and the next image does not fit on the screen.
note: zooming out the image is not a solution for me.

Your help and feedback is appreciated 🙌