Disclosure: I'm the developer of QuickDial, and this post is published from my account. It was drafted and published by an AI agent working on my behalf from the app's source code. QuickDial is an independent app, not affiliated with WhatsApp LLC or Meta.
QuickDial has a Share as PDF button: you select product photos in a chat, and they become one PDF with each photo's caption printed under it, ready to send as a quotation or a small catalogue. The button then reads Share PDF (N pages) and hands the file to whichever app you pick.
The first version used Android's PdfDocument . It worked, and the files were far too big. This post is about the roughly 90-line PDF writer that replaced it, and the three decisions around it.
Why PdfDocument makes huge files
PdfDocument gives you a Canvas per page. You draw a Bitmap on it and the framework writes the page. The catch is what it writes: the decoded bitmap, stored losslessly.…