feat: add support for disabling specific features in the PDF Editor

This commit is contained in:
alam00000
2026-03-29 23:02:58 +05:30
parent 245b48464b
commit a617279c2d
6 changed files with 66 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import { showAlert, showLoader, hideLoader } from '../ui.js';
import { formatBytes, downloadFile } from '../utils/helpers.js';
import { makeUniqueFileKey } from '../utils/deduplicate-filename.js';
import { batchDecryptIfNeeded } from '../utils/password-prompt.js';
import { getEditorDisabledCategories } from '../utils/disabled-tools.js';
const embedPdfWasmUrl = new URL(
'embedpdf-snippet/dist/pdfium.wasm',
@@ -130,7 +131,9 @@ async function handleFiles(files: FileList) {
pdfWrapper.classList.remove('hidden');
const { default: EmbedPDF } = await import('embedpdf-snippet');
const disabledCategories = getEditorDisabledCategories();
viewerInstance = EmbedPDF.init({
disabledCategories,
type: 'container',
target: pdfContainer,
worker: true,