Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: coregx/gxpdf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.0
Choose a base ref
...
head repository: coregx/gxpdf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.4.0
Choose a head ref
  • 9 commits
  • 17 files changed
  • 1 contributor

Commits on Feb 20, 2026

  1. feat: expand paper sizes to 35+ with map-based architecture

    Add 27 new page size constants to both domain and creator layers:
    - Extended ISO A series: A0, A1, A2, A6, A7, A8
    - Extended ISO B series: B0, B1, B2, B3, B6
    - ISO C/Envelope: C4, C5, C6, DL
    - North American: Executive, HalfLetter
    - ANSI Engineering: ANSIC, ANSID, ANSIE
    - Photo: Photo4x6, Photo5x7, Photo8x10
    - Book Publishing: Digest, USTradeBook
    - Presentation (unique): Slide16x9, Slide4x3
    - US Envelope: Envelope10
    - JIS B (Japanese): JISB4, JISB5
    
    Domain layer uses single pageSizeMap as source of truth (no switch
    duplication). Creator layer iota values mirror domain 1:1 via direct
    cast — validated by compile-time structural test.
    
    Tests cover all 35+ sizes, A-series halving invariant, JIS vs ISO
    B-series distinction, presentation aspect ratios, and iota order guard.
    kolkov committed Feb 20, 2026
    Configuration menu
    Copy the full SHA
    49ca529 View commit details
    Browse the repository at this point in the history
  2. feat: add custom page dimensions API (NewPageWithDimensions)

    Add document.AddPageWithRect for domain-level custom page creation.
    Add creator.NewPageWithDimensions(widthPt, heightPt) for ergonomic
    custom dimensions at the creator layer.
    
    Both methods initialize all page fields identically to the existing
    AddPage/NewPageWithSize methods. Negative and zero dimensions are
    rejected with descriptive errors.
    
    Unit conversion helpers (InchesToPoints, MMToPoints, CMToPoints) and
    their constants are now also exported from the creator package,
    delegating to the domain layer implementations to avoid duplication.
    
    Tests cover: correct dimensions, validation errors, page count
    increment, mixed use with standard sizes, PDF write round-trip,
    default margins, and content area calculation.
    kolkov committed Feb 20, 2026
    Configuration menu
    Copy the full SHA
    8faef4d View commit details
    Browse the repository at this point in the history
  3. feat: add text rotation support (AddTextRotated)

    Add Rotation float64 field to creator.TextOperation and writer.TextOp
    structs. Rotation is in degrees, counter-clockwise, around the text
    origin point (X, Y).
    
    New creator.Page methods:
      AddTextRotated(text, x, y, font, size, rotation) error
      AddTextColorRotated(text, x, y, font, size, color, rotation) error
    
    Content stream generation now uses the Tm (text matrix) PDF operator
    when Rotation != 0, computing cos/sin from the degree value. Zero
    rotation continues to use the Td (MoveTextPosition) operator, preserving
    backward compatibility.
    
    convertTextOps propagates the Rotation field from creator to writer.
    
    Tests cover: 0/90/45/negative degree values, color and validation, Tm
    vs Td operator selection, matrix math correctness, end-to-end PDF
    write, multiple rotations on one page, and AddText regression guard.
    kolkov committed Feb 20, 2026
    Configuration menu
    Copy the full SHA
    d31f191 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fc11f2b View commit details
    Browse the repository at this point in the history
  5. feat: add Orientation type with Landscape/Portrait support for NewPag…

    …eWithSize
    
    NewPageWithSize now accepts an optional orientation parameter — the
    industry-standard approach used by PDFKit, jsPDF, gofpdf, TCPDF, and others.
    Uses swapped-MediaBox (93% industry consensus), no /Rotate.
    kolkov committed Feb 20, 2026
    Configuration menu
    Copy the full SHA
    eb2aa9f View commit details
    Browse the repository at this point in the history
  6. fix: address code review findings before merge

    - Fix stale godoc: ToRectangle() referenced SetRotation for landscape,
      now points to NewPageWithSize with Landscape option
    - Fix misleading comment: 'compile-time check' → 'runtime check'
    - Add reverse conversion functions to creator layer (PointsToInches,
      PointsToMM, PointsToCM) for API symmetry with forward conversions
    - Add domain-layer test for AddPageWithRect (was only tested indirectly)
    - Fix rotation tests: now assert actual content stream matrix bytes
      instead of testing Go math library
    kolkov committed Feb 20, 2026
    Configuration menu
    Copy the full SHA
    c66a698 View commit details
    Browse the repository at this point in the history
  7. docs: update public documentation for v0.4.0 features

    - CHANGELOG: add v0.4.0 section (35+ page sizes, custom dimensions,
      landscape orientation, text rotation)
    - README: add new features to Key Features section, update version plan
    - ROADMAP: add v0.4.0 'Creator API' section, shift encryption/signatures
      to v0.5.0, update feature status table and backlog
    kolkov committed Feb 20, 2026
    Configuration menu
    Copy the full SHA
    43b714b View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2026

  1. feat: normalize rotation angles to [0,360) and improve godoc

    - Add normalizeAngle() helper for consistent angle representation
    - Apply normalization in AddTextColorRotated and AddTextCustomFontColorRotated
    - Negative angles accepted: -90 becomes 270, -45 becomes 315
    - Fractional angles (22.5°, 33.3°) fully supported
    - Document CCW-positive convention per ISO 32000 §8.3
    - Clarify Slide16x9/Slide4x3 are already landscape-oriented
    - Note Orientation behavior with presentation sizes
    - Add 16 normalization test cases + equivalence tests
    kolkov committed Feb 21, 2026
    Configuration menu
    Copy the full SHA
    a05403e View commit details
    Browse the repository at this point in the history
  2. Merge pull request #44 from coregx/feat/v0.4.0-creator-api

    feat: v0.4.0 Creator API — page sizes, custom dimensions, landscape, text rotation
    kolkov authored Feb 21, 2026
    Configuration menu
    Copy the full SHA
    1e84281 View commit details
    Browse the repository at this point in the history
Loading