Skip to content

Add gradients, links, bookmarks, QR codes, and dashed curves to VectorCanvas - #4

Merged
sahebansari merged 1 commit into
sahebansari:masterfrom
pgourlain:users/pgo/improvements
Sep 26, 2026
Merged

sahebansari merged 1 commit into
sahebansari:masterfrom
pgourlain:users/pgo/improvements

Conversation

@pgourlain

Copy link
Copy Markdown
Contributor

Summary

Extend the vector canvas with the remaining drawing and interaction features, documented and tested to the same level as the canvas media PR.

Added:

  • Dash patterns and phases on ellipses, rounded rectangles, pie sectors, and arbitrary paths (PathDescriptor.Dash), scoped with q/Q like dashed lines and rectangles.
  • PathDescriptor.RoundedRect, with the radius clamped to half the shorter side.
  • Linear and radial two-stop gradient fills (FillLinearGradient, FillRadialGradient), written as PDF axial/radial shadings clipped to the path. Stroke, even-odd fill, opacity, and dashes still apply; Fill() and the gradient methods replace each other.
  • VectorCanvas.Link, InternalLink, and Bookmark for URI links, in-document links, and outline entries at absolute canvas positions.
  • VectorCanvas.QrCode, drawn as one filled vector path of merged module runs; oversize data and invalid colors fail at the call site.

Docs and samples:

  • CHANGELOG [Unreleased], README features, docs/vector-graphics.md and docs/bookmarks.md, CONTRIBUTING test table.
  • New sample 19_CanvasExtrasShowcase.cs.

Tests: CanvasExtrasTests covers output operators, resources, annotations, outlines, and argument validation.

…Canvas

Extend the vector canvas with the remaining drawing and interaction
features, documented and tested to the same level as the canvas media PR.

Added:
- Dash patterns and phases on ellipses, rounded rectangles, pie sectors,
  and arbitrary paths (PathDescriptor.Dash), scoped with q/Q like dashed
  lines and rectangles.
- PathDescriptor.RoundedRect, with the radius clamped to half the shorter
  side.
- Linear and radial two-stop gradient fills (FillLinearGradient,
  FillRadialGradient), written as PDF axial/radial shadings clipped to the
  path. Stroke, even-odd fill, opacity, and dashes still apply; Fill() and
  the gradient methods replace each other.
- VectorCanvas.Link, InternalLink, and Bookmark for URI links, in-document
  links, and outline entries at absolute canvas positions.
- VectorCanvas.QrCode, drawn as one filled vector path of merged module
  runs; oversize data and invalid colors fail at the call site.

Docs and samples:
- CHANGELOG [Unreleased], README features, docs/vector-graphics.md and
  docs/bookmarks.md, CONTRIBUTING test table.
- New sample 19_CanvasExtrasShowcase.cs.

Tests: CanvasExtrasTests covers output operators, resources, annotations,
outlines, and argument validation.
@sahebansari sahebansari self-assigned this Sep 26, 2026
@sahebansari
sahebansari self-requested a review September 26, 2026 14:08

@sahebansari sahebansari left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sahebansari
sahebansari merged commit 61f5c50 into sahebansari:master Sep 26, 2026
1 check passed
@pgourlain
pgourlain deleted the users/pgo/improvements branch September 26, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants