diff --git a/README.md b/README.md index 743019c..af47b99 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ **BentoPDF** is a powerful, privacy-first, client-side PDF toolkit that is self hostable and allows you to manipulate, edit, merge, and process PDF files directly in your browser. No server-side processing is required, ensuring your files remain secure and private. -![Docker Pulls](https://img.shields.io/docker/pulls/bentopdfteam/bentopdf) [![Ko-fi](https://img.shields.io/badge/Buy%20me%20a%20Coffee-yellow?logo=kofi&style=flat-square)](https://ko-fi.com/alio01) ![GitHub Stars](https://img.shields.io/github/stars/alam00000/bentopdf?style=social) +[![Docker Downloads](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fghcr-badge.elias.eu.org%2Fapi%2Falam00000%2Fbentopdf%2Fbentopdf&query=%24.downloadCount&logo=docker&label=Docker%20Downloads&color=blue)](https://github.com/alam00000/bentopdf/pkgs/container/bentopdf) [![Ko-fi](https://img.shields.io/badge/Buy%20me%20a%20Coffee-yellow?logo=kofi&style=flat-square)](https://ko-fi.com/alio01) ![GitHub Stars](https://img.shields.io/github/stars/alam00000/bentopdf?style=social) [![Sponsor me on GitHub](https://img.shields.io/badge/Sponsor-%E2%9D%A4-ff69b4)](https://github.com/sponsors/alam00000) ![BentoPDF Tools](public/images/bentopdf-tools.png) diff --git a/nginx.conf b/nginx.conf index ecf93a6..e30d20d 100644 --- a/nginx.conf +++ b/nginx.conf @@ -25,7 +25,8 @@ http { server_name localhost; root /usr/share/nginx/html; index index.html; - + absolute_redirect off; + location ~* \.html$ { expires 1h; diff --git a/src/js/logic/compress-pdf-page.ts b/src/js/logic/compress-pdf-page.ts index c5ec5e7..0500f2a 100644 --- a/src/js/logic/compress-pdf-page.ts +++ b/src/js/logic/compress-pdf-page.ts @@ -121,6 +121,15 @@ async function performCondenseCompression( return { ...result, usedFallback: true }; } + if ( + errorMessage.includes('closed or encrypted') || + errorMessage.includes('encrypted') + ) { + throw new Error( + 'This PDF is encrypted or password-protected. Please remove the password first using the Unlock PDF tool, then try compressing again.' + ); + } + throw new Error(`PDF compression failed: ${errorMessage}`); } }