Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable27] Show forms as read only #849

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/files_pdfviewer-workersrc.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/files_pdfviewer-workersrc.js.map

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/workersrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
const urlParams = new URLSearchParams(queryString)
const canDownload = urlParams.get('canDownload')

function initializeCustomPDFViewerApplication() {

Check warning on line 37 in src/workersrc.js

View workflow job for this annotation

GitHub Actions / eslint

Missing JSDoc comment
const head = document.getElementsByTagName('head')[0]

// Preferences override options, so they must be disabled for
Expand All @@ -47,6 +47,9 @@
PDFViewerApplicationOptions.set('cMapUrl', head.getAttribute('data-cmapurl'))
PDFViewerApplicationOptions.set('enablePermissions', true)
PDFViewerApplicationOptions.set('imageResourcesPath', './js/pdfjs/web/images/')
// AnnotationMode.ENABLE value is 1 in PDF.js, which shows forms, but does
// not allow to interact with them
PDFViewerApplicationOptions.set('annotationMode', 1)

if (canDownload === '0') {
const pdfViewer = window.document.querySelector('.pdfViewer')
Expand Down
Loading