diff --git a/README.md b/README.md index 886ab28d..e3a03dd0 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,9 @@ A4. Expo does not support native module. you can read more expo caveats [`here`] ### ChangeLog +v5.0.3 +1. add enableAnnotationRendering property support, default enableAnnotationRendering=true + v5.0.2 1. fix file successfully download check @@ -169,7 +172,7 @@ const styles = StyleSheet.create({ | enableAntialiasing | bool | true | improve rendering a little bit on low-res screens, but maybe course some problem on Android 4.4, so add a switch | ✖ | ✔ | <3.0 | | enablePaging | bool | false | only show one page in screen | ✔ | ✔ | 5.0.1 | | enableRTL | bool | false | scroll page as "page3, page2, page1" | ✔ | ✖ | 5.0.1 | -| enableAnnotationRendering | bool | false | enable rendering annotation | ✔ | ✔ | 5.0.3 | +| enableAnnotationRendering | bool | true | enable rendering annotation | ✔ | ✔ | 5.0.3 | | onLoadProgress | function(percent) | null | callback when loading, return loading progress (0-1) | ✔ | ✔ | <3.0 | | onLoadComplete | function(numberOfPages, path, {width, height}) | null | callback when pdf load completed, return total page count and pdf local/cache path | ✔ | ✔ | <3.0 | | onPageChanged | function(page,numberOfPages) | null | callback when page changed ,return current page and total page count | ✔ | ✔ | <3.0 | diff --git a/index.js b/index.js index c29cb32b..835963d5 100644 --- a/index.js +++ b/index.js @@ -75,7 +75,7 @@ export default class Pdf extends Component { horizontal: false, page: 1, enableAntialiasing: true, - enableAnnotationRendering: false, + enableAnnotationRendering: true, enablePaging: false, enableRTL: false, activityIndicatorProps: {color: '#009900', progressTintColor: '#009900'}, diff --git a/ios/RCTPdf/RCTPdfView.m b/ios/RCTPdf/RCTPdfView.m index 49e2096e..afab28a1 100644 --- a/ios/RCTPdf/RCTPdfView.m +++ b/ios/RCTPdf/RCTPdfView.m @@ -57,7 +57,7 @@ - (instancetype)init _horizontal = NO; _enablePaging = NO; _enableRTL = NO; - _enableAnnotationRendering = NO; + _enableAnnotationRendering = YES; _fitPolicy = 2; _spacing = 10; @@ -141,10 +141,14 @@ - (void)didSetProps:(NSArray *)changedProps } if (_pdfDocument && ([changedProps containsObject:@"path"] || [changedProps containsObject:@"enableAnnotationRendering"])) { - int pageCount = _pdfDocument.pageCount; - for (int i=0; i