react-native-pdf-renderer 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -65,8 +65,6 @@ For more details, see the [Sample Project](https://github.com/douglasjunior/reac
65
65
 
66
66
  ## PdfRendererView props
67
67
 
68
- Inherits [View Props](https://reactnative.dev/docs/view#props).
69
-
70
68
  |Name|Value|Default|Description|
71
69
  |-|-|-|-|
72
70
  |source|`string`||Path to a file stored on device.|
@@ -74,6 +72,7 @@ Inherits [View Props](https://reactnative.dev/docs/view#props).
74
72
  |maxZoom|`number`|`5`|Max zoom scale.|
75
73
  |singlePage|`boolean`|`false`|(Experimental) Renders only the first page without scroll. (useful for display thumbnail)|
76
74
  |onPageChange|`(current: number, total: number) => void`||Invoked on pages scroll.|
75
+ |style|`StyleProp<ViewStyle>`||Styles to be applied to the View |
77
76
 
78
77
  ## Limitations
79
78
 
@@ -156,7 +156,9 @@ public class PdfRendererRecyclerView extends RecyclerView {
156
156
  @Override
157
157
  protected void onSizeChanged(int w, int h, int oldw, int oldh) {
158
158
  super.onSizeChanged(w, h, oldw, oldh);
159
- float scale = Math.max(w / mWidth, h / mHeight);
159
+ float scale = mWidth > 0 && mHeight > 0
160
+ ? Math.max(w / mWidth, h / mHeight)
161
+ : 1;
160
162
  mMatrix.setScale(scale, scale);
161
163
  mMatrix.postTranslate((w - scale * mWidth) / 2f, (h - scale * mHeight) / 2f);
162
164
  }
@@ -1,5 +1,6 @@
1
1
  import { ViewProps } from 'react-native';
2
- export declare type PdfRendererViewPropsType = ViewProps & {
2
+ export declare type PdfRendererViewPropsType = {
3
+ style?: ViewProps['style'];
3
4
  source?: string;
4
5
  distanceBetweenPages: number;
5
6
  maxZoom: number;
@@ -1 +1 @@
1
- {"version":3,"file":"PdfRendererView.js","sourceRoot":"","sources":["../src/PdfRendererView.tsx"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;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,CAAC;IAEb,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,CAAC,KAAkD,EAAE,EAAE;QACrD,YAAY,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IACtE,CAAC,EACD,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,eAAO,EACpB,GAAG,EAAE,CAAC,CAAC;QACL,MAAM;QACN,UAAU;QACV,OAAO;KACR,CAAC,EACF,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,CAC9B,CAAC;IAEF,OAAO,CACL,8BAAC,iBAAiB,OACZ,MAAM,EACV,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,gBAAgB,GAC9B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,CAAC,YAAY,GAAG;IAC7B,OAAO,EAAE,CAAC;IACV,oBAAoB,EAAE,EAAE;IACxB,UAAU,EAAE,KAAK;CAClB,CAAC;AAEF,kBAAe,eAAe,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-pdf-renderer",
3
3
  "displayName": "React-Native Pdf Renderer",
4
- "version": "1.1.1",
4
+ "version": "1.2.0",
5
5
  "description": "⚛ A zoomable, blazing fast, zero dependencies, pure native, typed PDF Renderer for Android and iOS.",
6
6
  "main": "dist",
7
7
  "license": "MIT",