Skip to content

Commit

Permalink
fix(pdf): Re-enable support for unverified signatures in PDF files (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoffan committed Aug 29, 2019
1 parent 4154bd3 commit da531a9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 32 deletions.
8 changes: 1 addition & 7 deletions build/upgrade_pdfjs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ echo "--------------------------------------------------------------------------
\cp -rf pdfjs-dist/cmaps/* src/third-party/doc/${DOC_STATIC_ASSETS_VERSION}/cmaps/
rm -rf ./pdfjs-dist/

# Fix Chrome console warning issue by not testing for moz-chunked-arraybuffer support in Chrome
echo "-----------------------------------------------------------------------------------"
echo "Tweaking pdf.js for Chrome..."
echo "-----------------------------------------------------------------------------------"
sed -e 's/function supportsMozChunkedClosure/!\(\/Chrome\/\.test\(navigator\.userAgent\)\) \&\& function supportsMozChunkedClosure/' -i '' src/third-party/doc/${DOC_STATIC_ASSETS_VERSION}/pdf.js

# Decreased default cached pages size to 5 on mobile web to lower memory usage
echo "-----------------------------------------------------------------------------------"
echo "Decreasing # of cached pages on mobile web..."
Expand All @@ -49,7 +43,7 @@ sed -e 's@var DEFAULT_CACHE_SIZE = 10;@var DEFAULT_CACHE_SIZE = /iphone|ipad|ipo
echo "-----------------------------------------------------------------------------------"
echo "Enabling e-signature rendering without validation..."
echo "-----------------------------------------------------------------------------------"
sed -e 's@_this2.setFlags(_util.AnnotationFlag.HIDDEN);@\/\/_this2.setFlags(_util.AnnotationFlag.HIDDEN);@' -i '' src/third-party/doc/${DOC_STATIC_ASSETS_VERSION}/pdf.worker.js
sed -e 's@_this3.setFlags(_util.AnnotationFlag.HIDDEN);@\/\/_this3.setFlags(_util.AnnotationFlag.HIDDEN);@' -i '' src/third-party/doc/${DOC_STATIC_ASSETS_VERSION}/pdf.worker.js

# Miniy the libraries
./build/minify_pdfjs.sh
2 changes: 1 addition & 1 deletion src/third-party/doc/2.16.0/pdf.worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -28995,7 +28995,7 @@ function (_Annotation2) {
if (data.fieldType === 'Sig') {
data.fieldValue = null;

_this3.setFlags(_util.AnnotationFlag.HIDDEN);
// _this3.setFlags(_util.AnnotationFlag.HIDDEN);
}

return _this3;
Expand Down

0 comments on commit da531a9

Please sign in to comment.