typst/pdf-writer
 Watch   
 Star   
 Fork   
2025-10-02 17:50:40
pdf-writer

Version 0.14.0

  • Added PDF 2.0 Tagged PDF and document structure features
    • Added capability to use structure namespaces
    • Added PDF 2.0 structure roles with their relations to PDF 1.7 structure roles
    • Added capability to specify the pronunciation for structure tree elements
    • Added StructElement::refs to write the /Ref key, specifying structure elements this element refers to
    • Added PDF 2.0 attribute owners Artifact, HTML-5.00, CSS-3, RDFa-1.10, ARIA-1.1, NSO
    • Allowed writing PDF 2.0 form of the CSS 1 and 2 attribute owners by adding a parameter to Attributes::owner (Breaking change)
    • Added ArtifactAttributes writer
    • Added LayoutAttributes::text_position to write the /TextPosition attribute
    • Added ListAttributes::continued_list and ListAttributes::continued_from to write the /ContinuedList and /ContinuedFrom attributes
    • Added TableAttributes::short to write the /Short attribute
    • Added PDF 2.0 variants to ListNumbering enum (Breaking change)
    • Added boolean parameter to FieldAttributes::checked to use the PDF 2.0 serialization
    • Added variant ListBox to FieldRole enum (Breaking change)
    • Added capability to associate a file with the structure tree root
  • Added the PDF/UA-2 attribute owner FENote and the FENoteAttributes writer
  • Added the missing H structure role from PDF 1.7 (Breaking change)
  • Added default values based on the spec to applicable enums
  • Added the capability to write Auto as a value of LayoutAttributes::glyph_orientation_vertical. The signature of the function changed to accommodate the new data type (Breaking change)
  • Added the capability to write text strings with language escape sequences using TextStrWithLang. For this purpose, many writer methods that previously accepted TextStr as an argument now accept an implementor of the TextStrLike trait (TextStr and TextStrWithLang, Breaking change)
  • Added a mechanism to retrieve the category of a structure role
  • Added PDF 2.0 variants to AssociationKind enum (Breaking change)
  • Fixed a bug where the BlockAlign enum contained the variant Begin instead of Before (Breaking change)
  • Fixed a bug where AttributeOwner::User was serialized to UserDefined instead of the correct UserProperties
  • Fixed an inconsistency where attributes allowing either one or multiple values for each side of a rectangle only exposed one of the APIs. Affected attributes are BorderColor and TPadding (allowed only one side) as well as BorderStyle, BorderThickness, Padding, and TBorderStyle (forced writing all four sides) (Breaking change)
  • Fixed a typo in the API: AppearanceCharacteristics::alterante_caption has been renamed to alternate_caption (Breaking change)
  • Fixed an inconsistency where attributes allowing either one or multiple values for each track in a column container only exposed the latter API. Affected attributes are ColumnWidths and ColumnGap (Breaking change)
  • Fixed a bug where LayoutAttributes::line_height could not be used because the LineHeight struct was not exported
2025-04-02 16:14:54
pdf-writer

Version 0.13.0

  • Added infrastructure for tracking PDF implementation limits
    • Added Buf type
    • Added Limits type
    • Added Chunk::{limits, merge_limits}
    • Content::finish, UnicodeCmap::finish, and PostScriptOp::encode now return a Buf (Breaking change)
  • The GlyphId trait is now properly public
2025-02-04 21:17:53
pdf-writer

Version 0.12.1

  • PostScript operations are now space- instead of newline-delimited
  • Added StructElement::id
  • Added ViewerPreferences::display_doc_title
  • Fixed DecodeParms::colors writing the wrong name
  • Fixed DeveloperExtension writing the wrong /Type
2024-09-30 21:33:28
pdf-writer

Version 0.12.0

  • Added Content::state_nesting_depth, which can be used to get the q/Q nesting depth for PDF implementation limit compliance
  • Added association_kind method to FileSpec
  • Added AssociationKind enum
  • Added associated_files to Annotation, Catalog, Page, ImageXObject, and FormXObject
  • Added embedded_file_with_unicode to FileSpec
  • Added additional PageModes (Breaking change)
  • Fixed return type of Chunk::refs (from impl IntoIterator to impl ExactSizeIterator, so maybe not actually breaking?)
2024-09-04 22:57:47
pdf-writer

Version 0.11.0

  • Added Pdf::set_binary_marker (thanks to @LaurenzV)
  • Added Chunk::refs (thanks to @LaurenzV)
  • Added Catalog::associated_files (thanks to @NiklasEi)
  • Added FontDescriptor::{style, descriptor_override, cid_set}
  • Added FontDescriptorOverride type and methods
  • Added CjkClass and WMode enums
  • Added Cmap::{writing_mode, use_cmap_stream, use_cmap_predefined}
  • Added UnicodeCmap::with_writing_mode
  • Added lots of documentation about PDF/A compliance
  • Fixed return type of Catalog::output_intents (Breaking change)
2024-06-01 20:04:02
pdf-writer

Version 0.10.0

  • Added support for interactive forms (thanks to @tingerrr), specifically
    • Widget annotations
    • Trigger events
    • Field dictionaries
    • Form field types
    • Interactive form dictionaries
  • Added support for videos and multimedia (thanks to @awehrfritz)
  • Added Chunk::destination (thanks to @Heinenen)
  • Added support for decode parameters
  • Fixed Page::annotations, which shall contain indirect references (Breaking change, thanks to @tingerrr)
2024-04-17 22:56:53
pdf-writer

Version 0.9.3

This release makes UnicodeCmap generic with a default to u16 to fix writing of CMaps for Type 3 and other simple fonts, which support just 256 glyphs.

2023-11-02 04:56:31
pdf-writer

Version 0.9.2

This release adds an as_bytes function the Chunk type (thanks to @cmoog).

2023-10-24 21:16:59
pdf-writer

Version 0.9.1

This release fixes a bug with string writing introduced in the previous version. The bug affected the writing of invisible ASCII characters that have one of the two high bits set (only DEL).

2023-10-04 19:03:25
pdf-writer

Version 0.9.0

  • Renamed PdfWriter type to Pdf(Breaking change)
  • Added Chunk type for writing two things at once
  • Moved top-level writers from PdfWriter to Chunk, Pdf now derefs to Chunk (Breaking change)
  • Added Chunk::renumber and Chunk::renumber_into for changing indirect reference IDs after writing
  • Added Pdf::set_file_id function for setting the file ID
  • Added Ref::{next, bump} for simple ID allocation
  • Marked Ref::{new, get} as const
  • Improved writing of PDF strings
  • Removed Type trait (it wasn't exported before, but used in bounds)