Skip to content

Commit c97d4cf

Browse files
Christopher Jenkinsclaude
authored andcommitted
Improve SEO, discoverability, and Skia PR visibility
- Expand README intro with "Kotlin JVM library", "PDF generation" keywords - Add Maven Central badge to README - Add "How it works" section explaining Skia SVG→PDFBox pipeline - Reference JetBrains/skiko#775 (native PDF backend) in README and docs - Expand POM description for better Maven Central search ranking - Add SEO metadata to docs _config.yml (tagline, author, lang) - Update docs homepage H1 to "compose2pdf — Kotlin PDF Library for Compose Desktop" - Add "Future: native Skia PDF backend" section to architecture guide Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent e26f756 commit c97d4cf

File tree

5 files changed

+58
-6
lines changed

5 files changed

+58
-6
lines changed

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Compose 2 PDF
22

33
[![CI](https://github.com/chrisjenx/compose2pdf/actions/workflows/ci.yml/badge.svg)](https://github.com/chrisjenx/compose2pdf/actions/workflows/ci.yml)
4+
[![Maven Central](https://img.shields.io/maven-central/v/com.chrisjenx/compose2pdf)](https://central.sonatype.com/artifact/com.chrisjenx/compose2pdf)
45
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)
56

6-
Render [Compose Desktop](https://www.jetbrains.com/compose-multiplatform/) content directly to PDF.
7+
A **Kotlin JVM library** for rendering [Compose Desktop](https://www.jetbrains.com/compose-multiplatform/) content directly to PDF. Generate production-quality PDF documents with vector text, embedded fonts, auto-pagination, and server-side streaming support.
78

89
```kotlin
910
val pdfBytes = renderToPdf {
@@ -29,6 +30,7 @@ File("hello.pdf").writeBytes(pdfBytes)
2930
- **Auto-pagination** — content automatically flows across pages; elements are kept together at page boundaries
3031
- **Multi-page** — render multiple pages in a single PDF (manual or automatic)
3132
- **Page presets** — A4, Letter, A3 with configurable margins and landscape support
33+
- **Streaming output** — write PDFs directly to an `OutputStream` for Ktor, servlets, or any JVM server
3234

3335
## Installation
3436

@@ -111,6 +113,17 @@ PdfLink(href = "https://example.com") {
111113
}
112114
```
113115

116+
## How it works
117+
118+
compose2pdf renders Compose content through a **Skia SVGCanvas → Apache PDFBox** pipeline:
119+
120+
1. Your `@Composable` content is rendered by Compose Desktop's layout engine
121+
2. Skia's SVGCanvas captures the draw calls as SVG
122+
3. compose2pdf converts the SVG to PDF vector commands via PDFBox
123+
4. Fonts are resolved, subsetted, and embedded; link annotations are mapped to PDF coordinates
124+
125+
> **Want native PDF output from Skia?** The [Skiko PR #775](https://github.com/JetBrains/skiko/pull/775) proposes adding a direct PDF backend to Skia/Skiko, which would eliminate the SVG intermediary entirely — producing smaller files, faster rendering, and full gradient/effect support in vector mode. If this matters to you, upvote the PR!
126+
114127
## Documentation
115128

116129
**[Full documentation](https://chrisjenx.github.io/compose2pdf/)** — getting started, usage guides, API reference, examples, and more.

compose2pdf/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ mavenPublishing {
2727
coordinates("com.chrisjenx", "compose2pdf", version.toString())
2828
pom {
2929
name.set("compose2pdf")
30-
description.set("Render Compose Desktop content to PDF")
30+
description.set(
31+
"Kotlin JVM library for rendering Compose Desktop content to production-quality PDFs " +
32+
"with vector text, embedded fonts, auto-pagination, and server-side streaming support."
33+
)
3134
url.set("https://github.com/chrisjenx/compose2pdf")
3235
licenses {
3336
license {

docs/_config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
title: compose2pdf
2-
description: Render Compose Desktop content directly to PDF
2+
description: "Kotlin JVM library for rendering Compose Desktop content to production-quality PDFs with vector text, embedded fonts, auto-pagination, and server-side streaming."
3+
tagline: "Kotlin PDF library for Compose Desktop"
34
remote_theme: just-the-docs/just-the-docs@v0.10.0
5+
author: Christopher Jenkins
6+
lang: en
47

58
url: "https://chrisjenx.github.io"
69
baseurl: "/compose2pdf"

docs/guides/architecture.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,27 @@ PDFBox's `PDType0Font.load()` automatically subsets embedded fonts -- only the g
132132

133133
---
134134

135+
## Future: native Skia PDF backend
136+
137+
The current vector pipeline goes through an SVG intermediary: **Compose → Skia Picture → SVGCanvas → SVG string → XML parse → PDFBox commands**. This works well but introduces inherent limitations — gradients and some visual effects don't survive the SVG round-trip.
138+
139+
[**Skiko PR #775**](https://github.com/JetBrains/skiko/pull/775) proposes adding a thin wrapper around Skia's native PDF backend (`SkDocument`). If merged, this would enable a much simpler pipeline:
140+
141+
```
142+
Current: Compose → Skia → SVG → parse → PDFBox → PDF
143+
Future: Compose → Skia → PDF (direct)
144+
```
145+
146+
Benefits of the native PDF backend:
147+
- **Full visual fidelity** — gradients, shadows, blur, and all Skia effects preserved
148+
- **Faster rendering** — no SVG serialization/parsing overhead
149+
- **Smaller file sizes** — Skia's PDF backend is optimized for compactness
150+
- **Simpler codebase** — eliminates SvgToPdfConverter, SvgPathParser, SvgColorParser, CoordinateTransform
151+
152+
If native PDF rendering in Compose Desktop matters to you, please upvote [JetBrains/skiko#775](https://github.com/JetBrains/skiko/pull/775).
153+
154+
---
155+
135156
## See also
136157

137158
- [Vector vs Raster]({{ site.baseurl }}/usage/vector-vs-raster) -- User-facing comparison

docs/index.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
title: Home
33
layout: home
44
nav_order: 1
5+
description: "Kotlin JVM library for PDF generation from Compose Desktop — vector text, embedded fonts, auto-pagination, and server-side streaming with Ktor."
56
---
67

7-
# compose2pdf
8+
# compose2pdf — Kotlin PDF Library for Compose Desktop
89

9-
**Render Compose Desktop content directly to PDF** -- vector text, embedded fonts, and page-perfect layout.
10+
**Generate production-quality PDFs from Compose Desktop content** vector text, embedded fonts, auto-pagination, and server-side streaming. A Kotlin JVM library that turns your `@Composable` functions into PDF documents.
1011
{: .fs-6 .fw-300 }
1112

1213
[Get Started]({{ site.baseurl }}/getting-started){: .btn .btn-primary .fs-5 .mb-4 .mb-md-0 .mr-2 }
@@ -78,13 +79,24 @@ No new DSL to learn. Write `@Composable` functions, pass them to `renderToPdf()`
7879
| **Raster fallback** | Pixel-perfect rendering as an embedded image |
7980
| **Font embedding** | Bundled Inter fonts or system font resolution with automatic subsetting |
8081
| **Link annotations** | Clickable URLs in the PDF via `PdfLink` |
81-
| **Multi-page** | Render multiple pages in a single PDF |
82+
| **Auto-pagination** | Content automatically flows across pages; elements kept together at boundaries |
83+
| **Multi-page** | Render multiple pages in a single PDF (automatic or manual) |
84+
| **Streaming output** | Write PDFs directly to an `OutputStream` for Ktor, servlets, or files |
8285
| **Page presets** | A4, Letter, A3 with configurable margins and landscape support |
8386
| **Shapes** | Backgrounds, borders, clips, rounded corners, Canvas drawing |
8487
| **Images** | Embed bitmap images with clipping and layout |
8588

8689
---
8790

91+
## How it works
92+
93+
compose2pdf renders your Compose content through a **Skia SVGCanvas → Apache PDFBox** pipeline. Compose Desktop's layout engine runs your composables, Skia captures the draw calls as SVG, and compose2pdf converts that to vector PDF commands with embedded fonts and link annotations.
94+
95+
{: .note }
96+
**Want native PDF output from Skia?** [Skiko PR #775](https://github.com/JetBrains/skiko/pull/775) proposes adding a direct PDF backend to Skia/Skiko. This would eliminate the SVG intermediary — faster rendering, smaller files, and full gradient/effect support in vector mode. If this matters to you, upvote the PR!
97+
98+
---
99+
88100
## Requirements
89101

90102
- **JDK 17** or later

0 commit comments

Comments
 (0)