Urgent.News

What's breaking now, across thousands of outlets.

Tech

pdf-lib is silently deleting characters from your users' data

I generate invoices in a Node serverless function with pdf-lib . It is a good library. It also quietly destroyed a client's company name, threw nothing, logged nothing, and produced a PDF that opened perfectly. The name was Łódź Sp. z o.o. The invoice said ód Sp. z o.o. Here is what is going on, because it will hit anyone generating documents from user-supplied text. The standard 14 fonts are…

The article discusses a bug in the pdf-lib library that silently removes characters from user-supplied data in generated PDF documents. The issue occurs when trying to draw non-Latin-1 characters, such as Ł, outside the 1990s WinAnsi encoding table. pdf-lib throws an error for unsupported characters, but the crash is not logged or visible in logs.

To resolve the issue, developers should embed a TrueType or OpenType font instead of relying on the default 1990s encoding table. This ensures the document can display a wider range of characters without silent data loss. The article also highlights the importance of caching font reads in serverless functions to avoid unnecessary latency.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Email Is Not a Web Page

An HTML email can be generated correctly, accepted by a provider, and delivered successfully—then arrive with its most important image missing or transformed. That is not only a design problem.

  • Email is distinct from web page, despite visual similarity
  • Remote images cause recipient client software issues
  • Critical info should be embedded, not conveyed via images

Oracle Manipulation Risk Report: Hyperliquid Bridge

Oracle Manipulation Risk Report: Hyperliquid Bridge Target Protocol : Hyperliquid Bridge (TVL: $6540.8M) Oracle Manipulation Risk Report: Hyperliquid Bridge Protocol: Hyperliquid Bridge Network…

  • Oracle Manipulation Risk Report focuses on Hyperliquid Bridge between Ethereum Mainnet and L2
  • State Root Manipulation via compromised relayer classified as Critical risk
  • Oracle Price Staleness in collateral valuation presents Medium risk

Dockerfile CMD Explained: Build-Time vs Runtime and How CMD Override Works

Dockerfile শেখার সময় FROM , RUN , WORKDIR , এবং COPY নিয়ে কাজ করার পর খুব স্বাভাবিকভাবেই একটি প্রশ্ন আসে: Container start হলে application automatically কীভাবে run করবে?

  • CMD instruction determines default runtime command for container
  • Executed during container start, not during build process
  • In example, Go server runs on port 8080 when launched

More from Sunday 30 August →