mirror of
https://github.com/pdfme/pdfme.git
synced 2026-06-16 02:09:10 -04:00
On narrow viewports (< ~445px) the open right sidebar consumed more width than the screen provides, producing a negative base scale that locked the Designer on the loading spinner forever. The sidebar now auto-closes when it would not leave usable canvas width, the canvas width is clamped to a non-negative value, and the base scale is kept strictly positive. Real-PDF templates also crashed mobile Safari because page backgrounds were rendered at the maxZoom scale (5x with the playground's maxZoom: 500), creating canvases above iOS Safari's ~16.7M pixel limit. pdf2img now accepts a maxCanvasPixels option that clamps the render scale per page, and the UI caps background rendering at 4096x4096 pixels. arrayBufferToBase64 also encodes in 32KB chunks instead of byte-by-byte concatenation to reduce peak memory while encoding multi-megabyte background images. Co-authored-by: Cursor <cursoragent@cursor.com>