shapdf = shape + pdf
Create Shapes into PDF
GitHub: Teddy-van-Jerry/shapdf
Motivation
- Efficient programmable generation of shapes in PDF (rather than slow compilation of LaTeX TikZ or Typst CeTZ);
- Minimal dependencies in Rust, relying mostly on PDF primitives.
Capabilities
- Shapes
- Line
- Circle (filled)
- Rectangle (filled)
- Polygon
- Text
- Color
- Opacity
- Rotation & Anchor
- PDF Stream Compression (feature
compress)
More features are coming soon!
Example
The usage of this library is quite simple:
use *;
use Error;
More examples are available in the examples directory.
Implementation Facts
- Filled circle is actually implemented using a zero-length line with the rounded line cap.
License
This project is distributed under the GPL-3.0 License.
© 2025 Teddy van Jerry (Wuqiong Zhao)