mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-10-14 19:27:04 -04:00
* M14: text the fonts can't draw is kept and reported, never written as ? silently Form values and captions, text boxes, callouts, Fill & Sign text, measurement labels and stamp by-lines keep text the standard fonts can't draw, draw ? for it, mark the annotation (PCUndrawn) and report the edit (interface notice, tools' warnings); forms set /NeedAppearances (not in PDF/A). Flattening, redaction overlay text, typed and visible signatures and create-from-text refuse instead. Reports escape such characters as [U+XXXX]. * Catalogs: the two new can't-draw messages in Czech, Slovene, Kazakh, Turkish and Greek; refresh hashes --------- Co-authored-by: Brandon Thomas <[email protected]>
pdfcraft-create
Layer L4. Create a PDF (Acrobat's Create a PDF tool), execution plan M10.2:
blank(width, height, pages): an empty document;from_images(&[(name, bytes)]): one page per image, sized from the image's resolution (PNGpHYs, JPEG JFIF density; 72 dpi when absent). JPEG data is embedded as is (/DCTDecode, grey, RGB or Adobe-inverted CMYK); PNG is decoded and stored with Flate, with transparency as a soft mask. An ICC profile in the file (JPEGAPP2 ICC_PROFILE, PNGiCCP) that matches the image's colour space is kept as an/ICCBasedcolour space with the device space as/Alternate; images with the same profile share one profile object. JPEG metadata scanning skips marker fill bytes and reads application segments after the frame header, stopping at the first scan or end marker. Broken or mismatched ICC profiles still fall back to the device colour space;from_images_with_resolution(images, ImageResolution::Dpi(dpi)): override the page resolution (1–1200 dpi), without resampling or recompressing image pixels. Use 72 dpi for one point per pixel, orImageResolution::Embeddedfor the same behavior asfrom_images. The largest page side is still capped at 14,400 points;from_text(text, …): plain text set in Helvetica, wrapped and paginated. Text Helvetica can't draw is refused, naming the line and the character, never set as?.from_text_escaped(text, …): the same for reports PdfCraft generates from documents (comment summaries, compare reports): such characters are written as[U+XXXX]and the first line says so (ESCAPED_NOTE).
Every function returns a pdfcraft_cos::Document; the caller writes it.