-
Notifications
You must be signed in to change notification settings - Fork 675
Open
Description
https://github.com/LibrePDF/OpenPDF/tree/master/openpdf-kotlin
π‘ Ideas to Improve openpdf-kotlin Module
-
Add Kotlin extension functions for common PDF tasks
- π Provide idiomatic Kotlin APIs like
pdfDocument.addParagraph("..."). - π Benefit: Cleaner and more concise Kotlin usage.
- π Provide idiomatic Kotlin APIs like
-
Use Kotlin DSL for document creation
- π Create a builder-style DSL for PDF generation (e.g.,
pdf { paragraph("Hello") }). - π Benefit: Makes PDF creation more readable and expressive in Kotlin.
- π Create a builder-style DSL for PDF generation (e.g.,
-
Add coroutines support for asynchronous PDF operations
- π§΅ Wrap I/O-heavy tasks in suspend functions.
- π Benefit: Enables better integration with modern Kotlin apps using coroutines.
-
Improve null safety with Kotlin types
- β
Replace nullable Java types with Kotlin
?syntax and smart casting. - π Benefit: Safer code and better IDE support for Kotlin developers.
- β
Replace nullable Java types with Kotlin
-
Write idiomatic Kotlin sample projects
- π Provide clean Kotlin examples in the
examples/directory or as a separate repo. - π Benefit: Lowers the entry barrier for Kotlin users.
- π Provide clean Kotlin examples in the
-
Add Kotlin wrappers for OpenPDF core classes
- π§© Provide simplified Kotlin APIs for
PdfWriter,PdfDocument, etc. - π Benefit: Reduce boilerplate and increase developer productivity.
- π§© Provide simplified Kotlin APIs for
-
Publish multiplatform Kotlin targets
- π Explore compatibility with Kotlin Multiplatform (JVM + Native/JS later).
- π Benefit: Enables cross-platform use (e.g., Android + Desktop).
-
Add unit tests written in Kotlin
- β Write tests in Kotlin to cover wrapper functions and DSLs.
- π Benefit: Ensures quality and demonstrates usage patterns.
-
Provide integration with Kotlin logging frameworks
- πͺ΅ Integrate with
kotlin-loggingor SLF4J wrappers. - π Benefit: Enables better debugging and diagnostics for Kotlin users.
- πͺ΅ Integrate with
-
Use Kotlinβs
Resulttype for error handling- β Replace exception-heavy APIs with idiomatic
Result<T>returns. - π Benefit: Clearer error handling without deep try/catch blocks.
- β Replace exception-heavy APIs with idiomatic
3-BodyCoding and rashid-topedge
Metadata
Metadata
Assignees
Labels
No labels