From 4d61afa8d287982c4e96dd6f2194c7959cf8bb18 Mon Sep 17 00:00:00 2001 From: Jeremy Press Date: Tue, 23 Oct 2018 14:05:23 -0700 Subject: [PATCH] Chore: Enable PDF signatures in future builds of PDF.js (#852) --- build/upgrade_pdfjs.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/upgrade_pdfjs.sh b/build/upgrade_pdfjs.sh index acfc46dca..34adb9723 100755 --- a/build/upgrade_pdfjs.sh +++ b/build/upgrade_pdfjs.sh @@ -35,3 +35,11 @@ echo "-------------------------------------------------------------------------- echo "Decreasing # of cached pages on mobile web" echo "-----------------------------------------------------------------------------------" sed -e 's@var DEFAULT_CACHE_SIZE = 10;@var DEFAULT_CACHE_SIZE = /iphone|ipad|ipod|android|blackberry|bb10|mini|windows\sce|palm/i.test(navigator.userAgent) ? 5 : 10;@' -i '' src/third-party/doc/$DOC_STATIC_ASSETS_VERSION/pdf_viewer.js + +# Deletes code hiding PDF signatures. +# For preview purposes, it is acceptable to show signatures without verifying them. +echo "-----------------------------------------------------------------------------------" +echo "Enabling PDF signatures" +echo "-----------------------------------------------------------------------------------" +# Deletes a block of code that starts with `if (data.fieldType === 'Sig') {``, and ends with `}` +sed -e "/if (data.fieldType === 'Sig') {/,/}/d" -i '' src/third-party/doc/$DOC_STATIC_ASSETS_VERSION/pdf.worker.js