SShortSingh.
Back to feed

Merge and compress PDFs in the browser with pdf-lib and PDF.js, without uploads

0
·2 views

Many free PDF tools upload files to a server, which poses a privacy risk for sensitive documents like contracts or bank statements. Modern browsers can handle common PDF tasks such as merging and compressing locally, using the pdf-lib and PDF.js libraries without any backend. Merging is straightforward: each file's pages are copied into a new document and saved with object streams, which can reduce size by a few percent. Compression is limited, since lossless re-saving only helps text-heavy files, while shrinking scanned images requires lossy rasterization that flattens text into pixels. Developers must also handle password-protected files, user-controlled ordering, memory limits on low-end devices, and the fact that bookmarks are not preserved by default.

Read the full story at DEV Community

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

Related stories

0
ProgrammingDEV Community ·

Why None Is Not Enough: Sentinel Values for PATCH Updates in Python

A recent Hacker News discussion on sentinel values in Python prompted the author to recall a production bug from an update function that used None to mean both "not provided" and "clear the value." The problem surfaces clearly in PATCH APIs, where a field can be absent, explicitly null, or set to a value, and a plain None default cannot distinguish the first two cases. The article reviews the common object()-based sentinel and points out its drawbacks: an unhelpful repr, unreliable copying and pickling, and poor type-checker support. It then proposes an Enum-based sentinel that keeps a readable repr, survives deepcopy and pickle as a singleton, and lets type checkers narrow the type correctly.

0
ProgrammingDEV Community ·

AIClaw 3.7.29 Separates Agent Progress From Final Answers

AIClaw 3.7.29 changes its desktop conversation view so that execution progress is kept apart from the final answer. Progress messages and tool activity stay in chronological order within each turn, rather than being merged into one prose block. The final answer appears with its own presentation, copy action, and file references, and is shown only once the turn is no longer running. Tool-created files such as helper scripts or screenshots are no longer treated automatically as deliverables. The article notes that these are display rules and do not verify whether the task itself succeeded.

0
ProgrammingDEV Community ·

How WARN Act Layoff Notice Rights Work When an Employer Files for Bankruptcy

When a company facing layoffs files for bankruptcy, workers may find that the 60-day notice or back pay owed under the federal WARN Act is hard to collect. Bankruptcy does not cancel WARN obligations, but an automatic stay routes claims into the bankruptcy case, where payment order is decided by the court and unsecured creditors often recover little or nothing. Claim priority can depend on whether layoffs happened before or after the filing, and employers may invoke WARN exceptions such as faltering company or unforeseeable business circumstances, which they must prove. Affected workers are advised to keep their notices and pay records and to file a proof of claim before the bar date, since missing it can forfeit the claim. This is general information, and workers should consult an employment lawyer or union representative promptly.

0
ProgrammingDEV Community ·

Interactive mind map links 51 dev.to posts by shared threads and references

A dev.to author built an interactive mind map of their 51 posts, published from August 2020 through October 2026. The map groups the posts into 8 thematic threads and draws 62 connections between them. Connections are marked as explicit, where the author linked or cited another post, or as inferred, based on shared ideas or motifs. The project was generated with Claude and runs as a single self-contained HTML file with no build step. The author has shared the code on GitHub along with a prompt that lets other readers create a similar map for their own dev.to profile.