From e6b14932773fe8e0ac2e4b205e83b564e75b3e66 Mon Sep 17 00:00:00 2001 From: Manan Gadhiya Date: Tue, 26 Jul 2022 21:33:03 +0530 Subject: [PATCH 1/2] Decode File Path --- ios/RCTPdf/RCTPdfView.m | 1 + 1 file changed, 1 insertion(+) diff --git a/ios/RCTPdf/RCTPdfView.m b/ios/RCTPdf/RCTPdfView.m index 5674eccd..f291f1a0 100644 --- a/ios/RCTPdf/RCTPdfView.m +++ b/ios/RCTPdf/RCTPdfView.m @@ -118,6 +118,7 @@ - (void)didSetProps:(NSArray *)changedProps if ([changedProps containsObject:@"path"]) { + _path = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapes(NULL, (CFStringRef)_path, CFSTR("")); if (_pdfDocument != Nil) { //Release old doc From fdb501ed96bfa340d7b2bd3c21ebeadf9b382741 Mon Sep 17 00:00:00 2001 From: Manan Gadhiya Date: Wed, 27 Jul 2022 10:16:02 +0530 Subject: [PATCH 2/2] update decode file path --- ios/RCTPdf/RCTPdfView.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ios/RCTPdf/RCTPdfView.m b/ios/RCTPdf/RCTPdfView.m index f291f1a0..d4880839 100644 --- a/ios/RCTPdf/RCTPdfView.m +++ b/ios/RCTPdf/RCTPdfView.m @@ -118,7 +118,6 @@ - (void)didSetProps:(NSArray *)changedProps if ([changedProps containsObject:@"path"]) { - _path = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapes(NULL, (CFStringRef)_path, CFSTR("")); if (_pdfDocument != Nil) { //Release old doc @@ -133,6 +132,9 @@ - (void)didSetProps:(NSArray *)changedProps _pdfDocument = [[PDFDocument alloc] initWithData:blobData]; } } else { + + // decode file path + _path = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapes(NULL, (CFStringRef)_path, CFSTR("")); NSURL *fileURL = [NSURL fileURLWithPath:_path]; _pdfDocument = [[PDFDocument alloc] initWithURL:fileURL]; }