You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Form filling. PdfFormField.SetValue, SetValues, SetChecked and Reset, and PdfAcroForm.SetValue, SetValues, SetChecked, ResetAll and GenerateMissingAppearances, for documents opened with AllowEditing: text (with /MaxLen), combo and list boxes (export or display values, multi-select), check boxes and radio groups. /V and /AS are updated, generated normal appearances are stored in /AP, and /NeedAppearances is cleared once every widget has one. Refused values throw PdfFormValueException (an ArgumentException) with a PdfFormValueError reason; PdfFillOptions controls read-only fields, truncation and appearance generation. Scripts never run. See docs/forms.md.
Flattening. PdfDocument.Flatten(PdfFlattenOptions?) bakes widget appearances (and optionally other annotations) into page content as Form XObjects, removes the annotations and fields, and drops an empty /AcroForm; it returns a PdfFlattenResult.
The appearance fuzz target also fills, flattens, saves and reopens.
Page operations on editable documents: RemovePage/RemovePages, MovePage, ReorderPages, RotatePage/SetPageRotation, InsertBlankPage, DuplicatePage, and PdfDocument.CreateEmpty. Deleting a page repairs the bookmarks, links, named destinations, open action, form fields and page labels that referred to it.
Pages across documents: PdfDocument.ImportPages copies pages with their whole dependency graph (resources, fonts, images, annotations with appearances; inherited /Resources, /MediaBox, /CropBox and /Rotate written into the page), each shared object once. Bookmarks, named destinations used by links, form fields (clashing names renamed), optional content, page labels and the structure tree of tagged files come along (PdfImportOptions). PdfDocument.Merge joins documents; PdfDocument.Split cuts one into several (PdfPageRange, or a number of pages per part). See docs/page-operations.md.
Content creation. PdfPage.BeginContent returns a PdfPageContentBuilder that adds content over or under a page's own (the existing content is wrapped so its graphics state cannot leak in); PdfDocument.BeginForm builds a reusable Form XObject. PdfContentBuilder writes paths (fill, stroke, clip, dashes, caps, joins), DeviceGray/RGB/CMYK colours, opacity and blend modes (ExtGState), a transform stack, text (character and word spacing, render modes, MeasureText, WrapText, DrawTextAligned, DrawTextBox), JPEG bytes embedded as they are, raw 8-bit images with an alpha plane, and images and forms already in the document. Fonts: PdfDocument.AddStandardFont (WinAnsi, Adobe metrics) and AddFont for TrueType and OpenType (CFF) files, written as Type 0 fonts with Identity-H, a /W array and a /ToUnicode map, subset to the glyphs used (own glyf/loca and CFF subsetters; ISO 32000-2 9.6.4 tags; the OS/2fsType embedding and no-subsetting bits are honoured, with PdfFontEmbeddingException and an explicit override). AddTextStamp and AddImageStamp watermark chosen pages through one shared form. PdfSaveOptions.DocumentId fixes the trailer /ID so saves are reproducible. See docs/content-creation.md.
A fontsubset fuzz target.
docs/migrating-from-pdfsharp.md, a guide for moving from PDFsharp.
The save fuzz target also runs page operations, merge and split.
PdfImageDecodeRequest.TargetWidth and TargetHeight: the size in device pixels the image covers on the page (the unit square under the CTM and output transform, rounded up, never above the image's own size), or 0 when unknown. A JPEG 2000 decoder can use it to decode at a reduced resolution. PdfImage.TargetWidth/TargetHeight expose the same values to devices. Decoding outside a page leaves them 0; existing decoders can ignore them.
A decoder may return fewer pixels than the dictionary declares. OnePDF passes the reduced size through (PdfImageData.Width/Height) without resampling; placement is unchanged because the image fills the unit square. No warning is recorded when a target size was given and the result is not larger than declared.
Fixed
TrueType instructions (fonts whose composites need their programs): ISECT now uses exact 128-bit arithmetic instead of treating a discriminant of -1 as degenerate. A glyph program that fails on its own now leaves only its own component unhinted; the whole glyph is drawn from its plain outline only when the shared per-glyph instruction budget is spent.