From bb27aca200fef8340e1b7495e7b6a0878fc8842d Mon Sep 17 00:00:00 2001 From: Jeremy Press Date: Tue, 23 Oct 2018 12:07:37 -0700 Subject: [PATCH 1/2] Chore: Enable PDF signatures in future builds of PDF.js --- build/upgrade_pdfjs.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/upgrade_pdfjs.sh b/build/upgrade_pdfjs.sh index acfc46dca..fc0ca1492 100755 --- a/build/upgrade_pdfjs.sh +++ b/build/upgrade_pdfjs.sh @@ -35,3 +35,12 @@ 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/1.30.0/pdf.worker.js From 83b10966fc37030b90ed41e1c909d928bdf4e1e3 Mon Sep 17 00:00:00 2001 From: Jeremy Press Date: Tue, 23 Oct 2018 12:20:26 -0700 Subject: [PATCH 2/2] Fix: Use current version --- build/upgrade_pdfjs.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build/upgrade_pdfjs.sh b/build/upgrade_pdfjs.sh index fc0ca1492..34adb9723 100755 --- a/build/upgrade_pdfjs.sh +++ b/build/upgrade_pdfjs.sh @@ -36,11 +36,10 @@ 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/1.30.0/pdf.worker.js +sed -e "/if (data.fieldType === 'Sig') {/,/}/d" -i '' src/third-party/doc/$DOC_STATIC_ASSETS_VERSION/pdf.worker.js