Deleting PDF Pages in the Browser With pdf-lib, Without Uploading Files
Many online PDF tools upload files to a server before removing pages, which is risky for private documents like contracts or ID scans. The article explains how pages can instead be removed entirely within the browser using the open source pdf-lib library, so the file stays on the user's device. A PDF is a list of page objects, so deleting a page means removing one entry and saving the file again. The author shows sample code that deletes pages in reverse index order to keep indexes valid, and recommends checking the saved file's page order before deleting the original. The author also mentions a free browser-based tool they built using this approach.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in