Back
Advanced PDF Protector | Oxford TRG
Advanced PDF Protector
Protect your PDF files with passwords and permissions
Oxford TRG
Upload a PDF, set passwords and permissions, apply protection, and download the secured version. Note: Owner password allows full access, user password restricts based on permissions.

PDF Protector

Drag & Drop your PDF here

or click to browse files

Passwords

Permissions

Actions

Reset

Preview & Export

Protection info

Protected PDF will appear here

Original Size: N/A
Protected Size: N/A

© Oxford TRG | Advanced PDF Protector Tool

${originalSize.textContent}
${protectedSize.textContent}
`; } catch (error) { showNotification('Error protecting PDF: ' + error.message, 'warning'); } } // Reset protector settings function resetProtector() { userPassword.value = ''; ownerPassword.value = ''; allowPrinting.checked = true; allowCopying.checked = true; allowModifying.checked = true; allowAnnotations.checked = true; allowFillingForms.checked = true; allowAccessibility.checked = true; showNotification('Settings reset', 'info'); } // Clear all function clearAll() { currentPdfBytes = null; protectedBlob = null; pdfUpload.value = ''; protectorArea.innerHTML = `

Drag & Drop your PDF here

or click to browse files

`; originalSize.textContent = 'Original Size: N/A'; protectedSize.textContent = 'Protected Size: N/A'; finalPreview.innerHTML = `

Protected PDF will appear here

`; resetProtector(); showNotification('All cleared. Upload a new PDF to start.', 'info'); } // Download PDF function downloadPdf() { if (!protectedBlob) { showNotification('Please protect a PDF first', 'warning'); return; } const name = fileName.value || 'protected-pdf'; const url = URL.createObjectURL(protectedBlob); const a = document.createElement('a'); a.href = url; a.download = `${name}.pdf`; a.click(); URL.revokeObjectURL(url); showNotification('PDF downloaded successfully!', 'success'); } // Show notification function showNotification(message, type) { const existing = document.querySelector('.notification'); if (existing) existing.remove(); const notification = document.createElement('div'); notification.className = `notification ${type}`; notification.innerHTML = ` ${message} `; document.body.appendChild(notification); notification.style.position = 'fixed'; notification.style.top = '20px'; notification.style.right = '20px'; notification.style.padding = '15px 20px'; notification.style.background = type === 'success' ? '#4CAF50' : type === 'warning' ? '#FF9800' : '#2196F3'; notification.style.color = 'white'; notification.style.borderRadius = '8px'; notification.style.boxShadow = '0 4px 12px rgba(0,0,0,0.15)'; notification.style.zIndex = '1000'; notification.style.display = 'flex'; notification.style.alignItems = 'center'; notification.style.gap = '10px'; notification.style.animation = 'fadeIn 0.3s ease-out'; const style = document.createElement('style'); style.innerHTML = ` @keyframes fadeIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } } `; document.head.appendChild(style); setTimeout(() => { notification.style.animation = 'fadeOut 0.3s ease-out'; const fadeOutStyle = document.createElement('style'); fadeOutStyle.innerHTML = ` @keyframes fadeOut { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } } `; document.head.appendChild(fadeOutStyle); setTimeout(() => { notification.remove(); fadeOutStyle.remove(); }, 300); }, 3000); } // Initialize initEventListeners(); });