<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Nurmuhammad</title>
    <description>The latest articles on DEV Community by Nurmuhammad (@conamobile).</description>
    <link>https://dev.to/conamobile</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3934627%2F6cd2a7ef-503f-4326-bf7c-4dc3b1bd0a16.png</url>
      <title>DEV Community: Nurmuhammad</title>
      <link>https://dev.to/conamobile</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/conamobile"/>
    <language>en</language>
    <item>
      <title>PdfKmp 1.0 — A Kotlin Multiplatform PDF Library for Android and iOS</title>
      <dc:creator>Nurmuhammad</dc:creator>
      <pubDate>Sat, 16 May 2026 10:33:02 +0000</pubDate>
      <link>https://dev.to/conamobile/pdfkmp-10-a-kotlin-multiplatform-pdf-library-for-android-and-ios-2pn</link>
      <guid>https://dev.to/conamobile/pdfkmp-10-a-kotlin-multiplatform-pdf-library-for-android-and-ios-2pn</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgt4r8j87itq0p9iv9p1e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgt4r8j87itq0p9iv9p1e.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Built specifically for Kotlin Multiplatform
&lt;/h2&gt;

&lt;p&gt;PdfKmp is a &lt;strong&gt;KMP-first&lt;/strong&gt; library. The DSL, the layout engine, and the document model all live in &lt;code&gt;commonMain&lt;/code&gt;. Rendering dispatches to each OS's native PDF stack — &lt;code&gt;android.graphics.pdf.PdfDocument&lt;/code&gt; on Android, &lt;code&gt;UIGraphicsBeginPDFContextToData&lt;/code&gt; + Core Graphics on iOS. You write the document once and ship it to both stores.&lt;/p&gt;

&lt;p&gt;If you only target Android, you can still use it as a plain Android library (&lt;code&gt;pdfkmp-android&lt;/code&gt; artifact).&lt;/p&gt;




&lt;h2&gt;
  
  
  What's in the box
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Document structure
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;A Compose-style DSL: &lt;code&gt;pdf { … }&lt;/code&gt;, &lt;code&gt;page { … }&lt;/code&gt;, &lt;code&gt;column&lt;/code&gt;, &lt;code&gt;row&lt;/code&gt;, &lt;code&gt;box&lt;/code&gt;, &lt;code&gt;card&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Spacing, padding, weighted children, alignment&lt;/li&gt;
&lt;li&gt;Multi-page documents with automatic pagination&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Text rendering
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Vector glyph paths — every character is a real PDF text operator, not a bitmap&lt;/li&gt;
&lt;li&gt;Single-style &lt;code&gt;text(...)&lt;/code&gt; blocks and multi-style &lt;code&gt;richText { span(...) }&lt;/code&gt; runs&lt;/li&gt;
&lt;li&gt;Font weights, italics, underline, strikethrough, letter spacing, line height, alignment&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tables
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Column weights and per-cell styling&lt;/li&gt;
&lt;li&gt;Header rows that repeat on every page&lt;/li&gt;
&lt;li&gt;Automatic page-break across long tables — no orphan rows&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Decorations
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Backgrounds, rounded corners, borders, gradients&lt;/li&gt;
&lt;li&gt;Dividers, lines, circles, ellipses&lt;/li&gt;
&lt;li&gt;Bullet and numbered lists&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Page-level features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Headers and footers with access to current page number and total page count&lt;/li&gt;
&lt;li&gt;Watermarks&lt;/li&gt;
&lt;li&gt;Page numbers in any format you write&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Hyperlinks
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;link(url) { … }&lt;/code&gt; emits real PDF link annotations — clickable in Adobe Reader, Preview, Chrome, and any spec-compliant viewer&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Internationalisation
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Bundled &lt;strong&gt;Inter&lt;/strong&gt; font, exposed as &lt;code&gt;PdfFont.Default&lt;/code&gt;, identical bytes on both platforms&lt;/li&gt;
&lt;li&gt;Opt-in system fallbacks for non-Latin scripts: &lt;code&gt;PdfFont.SystemCJK&lt;/code&gt;, &lt;code&gt;PdfFont.SystemArabic&lt;/code&gt;, &lt;code&gt;PdfFont.SystemPersian&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Custom fonts via &lt;code&gt;registerFont(PdfFont.Custom(name, bytes))&lt;/code&gt; for brand or licence-bound typefaces&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Images and vector graphics
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Raster images (JPEG / PNG) embedded as-is for real photos&lt;/li&gt;
&lt;li&gt;Vector and SVG images stay vector — sharp at any zoom&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Storage
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;StorageLocation.Documents&lt;/code&gt; / &lt;code&gt;Downloads&lt;/code&gt; / &lt;code&gt;Cache&lt;/code&gt; / &lt;code&gt;AppFiles&lt;/code&gt; / &lt;code&gt;Temp&lt;/code&gt; / &lt;code&gt;Custom&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;MediaStore on Android Q+ (no runtime permission needed)&lt;/li&gt;
&lt;li&gt;Sandboxed paths on iOS&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Opt-in companion modules
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;pdfkmp-viewer&lt;/code&gt;&lt;/strong&gt; — a Compose Multiplatform PDF viewer composable with topbar, share sheet, zoom, search, and text selection. Works as a standalone viewer for any PDF, not just PdfKmp-generated ones.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;pdfkmp-compose-resources&lt;/code&gt;&lt;/strong&gt; — bridges Compose Multiplatform &lt;code&gt;DrawableResource&lt;/code&gt; references into the PdfKmp DSL.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The core &lt;code&gt;pdfkmp&lt;/code&gt; artifact stays Compose-free. If you don't use Compose, you don't pay for it.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why vector matters
&lt;/h2&gt;

&lt;p&gt;Most "save to PDF" flows on mobile rasterise — they snapshot a &lt;code&gt;View&lt;/code&gt; and embed that bitmap. PdfKmp is vector-only for everything except real photos. That gives you three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Small file size.&lt;/strong&gt; A typical text-heavy invoice lands in the tens of kilobytes, not megabytes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Crisp output at any zoom.&lt;/strong&gt; Path operators are resolution-independent.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Searchable, accessible documents.&lt;/strong&gt; Real text means Preview's ⌘F finds the order number, and screen readers can read the page.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Cross-platform parity is the contract
&lt;/h2&gt;

&lt;p&gt;PdfKmp pins the bundled Inter font on both platforms so glyph metrics match exactly. Same DSL → same line breaks → same page splits → same final file. For non-Latin scripts that rely on system fonts, the fallback is named explicitly so any divergence is visible instead of silent.&lt;/p&gt;

&lt;p&gt;If the output ever differs between Android and iOS on a document you care about, that's a bug — open an issue with the DSL snippet.&lt;/p&gt;




&lt;h2&gt;
  
  
  Stability signals
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1.0 stable&lt;/strong&gt;, follows SemVer — no breaking changes within the 1.x line&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;explicitApi()&lt;/code&gt; enforced&lt;/strong&gt; — every public declaration is intentional&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Apache 2.0&lt;/strong&gt; — drop-in for enterprise, no AGPL friction&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;R8-clean&lt;/strong&gt; — no keep rules required&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No third-party engines&lt;/strong&gt; — output goes through the OS's native PDF stack&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/ConaMobileDev/PdfKmp" rel="noopener noreferrer"&gt;https://github.com/ConaMobileDev/PdfKmp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>kmp</category>
      <category>kotlin</category>
      <category>compose</category>
      <category>pdf</category>
    </item>
  </channel>
</rss>
