Wednesday, February 7, 2024
HomeiOS Developmentjavascript - FitPolicy doesn't work primarily based on canvas width on iOS

javascript – FitPolicy doesn’t work primarily based on canvas width on iOS


This error solely occurs on iOS platform.

"react-native": "0.72.4",
"react-native-blob-util": "^0.19.6",
"react-native-pdf": "^6.7.4",
[![enter code here][1]][1]

In iOS, the primary picture of my pdf file is kind of small in comparison with the opposite pictures. Consider it as an image cropped in half.
I feel it takes the dimensions of the entire pdf in accordance with the dimensions of the primary canvas. That is why I am unable to see the entire massive picture on the display.

I’ve tried:

FitPolicy 0/1/2 all with the identical end result
I set the size worth smaller than regular

container: { // fashion for the view that wraps the pdf
    flex: 1,
    justifyContent: 'flex-start',
    alignItems: 'middle',
  },
  pdf: { // for pdf 
    flex: 1,
    width: Dimensions.get('display').width,
    peak: Dimensions.get('display').peak,
   // display or window values make no distinction.
  },

that is what I get in my native pdf viewer, however within the pdf package deal the cat picture takes up the entire display horizontally and the following picture doesn’t match on the display.
observe: zooming out the picture will not be an answer for me.

Your assist and suggestions is appreciated 🙌



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments