fluid-pdf alternatives and similar libraries
Based on the "Misc" category.
Alternatively, view fluid-pdf alternatives based on common mentions on social networks and blogs.
-
jclasslib
jclasslib bytecode editor is a tool that visualizes all aspects of compiled Java class files and the contained bytecode. -
kotlin-logging
Lightweight Multiplatform logging framework for Kotlin. A convenient and performant logging facade. -
lingua
The most accurate natural language detection library for Java and the JVM, suitable for long and short text alike -
Kotlift
DISCONTINUED. Kotlift is the first source-to-source language transpiler from Kotlin to Swift -
Humanizer.jvm
Humanizer.jvm meets all your jvm needs for manipulating and displaying strings, enums, dates, times, timespans, numbers and quantities. -
klutter
A mix of random small libraries for Kotlin, the smallest reside here until big enough for their own repository. -
solr-undertow
Solr / SolrCloud running in high performance server - tiny, fast startup, simple to configure, easy deployment without an application server. -
kassava
This library provides some useful kotlin extension functions for implementing toString(), hashCode() and equals() without all of the boilerplate. -
SimpleDNN
SimpleDNN is a machine learning lightweight open-source library written in Kotlin designed to support relevant neural network architectures in natural language processing tasks -
kasechange
🐫🐍🍢🅿 Multiplatform Kotlin library to convert strings between various case formats including Camel Case, Snake Case, Pascal Case and Kebab Case -
kotlin-futures
A collections of extension functions to make the JVM Future, CompletableFuture, ListenableFuture API more functional and Kotlin like. -
PrimeCalendar
PrimeCalendar provides all of the java.util.Calendar functionalities for Persian, Hijri, and ... dates. It is also possible to convert dates to each other. -
log4k
Lightweight logging library for Kotlin/Multiplatform. Supports Android, iOS, JavaScript and plain JVM environments.
CodeRabbit: AI Code Reviews for Developers
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of fluid-pdf or a related project?
README
fluid-pdf
Easy PDF generation with HTML & CSS using Chromium or Google Chrome
Installation
build.gradle.kts
:
dependencies {
implementation("io.fluidsonic.pdf:fluid-pdf:0.16.0")
}
Usage
HTML file to PDF file
import io.fluidsonic.pdf.*
import java.nio.file.*
suspend fun main() {
// TODO Change the binary file path to your local Chromium or Google Chrome installation.
val sourceFile = Path.of("input.html").toAbsolutePath()
val destinationFile = Path.of("output.pdf").toAbsolutePath()
ChromiumPdfGenerator.launch(
binaryFile = Path.of("/Applications/Google Chrome.app/Contents/MacOS/Google Chrome")
).use { generator ->
generator.generate(PdfGenerationSource.HtmlFile(sourceFile))
.writeTo(destinationFile)
}
println("PDF has been generated at $destinationFile")
}
- Use
ChromiumPdfGenerator.launch()
to launch a browser instance for PDF generation. - Use
ChromiumPdfGenerator.lazy()
to launch the browser not immediately but automatically with the first PDF generation. - Use
ChromiumPdfGenerator
's.close()
to shut down the browser when you are done generating PDFs. - Use
PdfGenerator
's.generate()
to create any number of PDFs. - Use
PdfGenerator
interface to hide implementation details (use of Chromium,.close()
) as needed.
HTML string to PDF file
generator.generate(PdfGenerationSource.Html("<strong>Hello world!</strong>"))
.writeTo(PdfGenerationDestination.File(destinationFile))
💡 Relative paths in HTML & CSS won't resolve. Using <base href="…">
to specify the base path should help.
HTML stream to PDF file
val sourceStream: InputStream = …
generator.generate(PdfGenerationSource.HtmlStream(sourceStream))
.writeTo(PdfGenerationDestination.File(destinationFile))
💡 Relative paths in HTML & CSS won't resolve. Using <base href="…">
to specify the base path should help.
PDF generation settings
generator.generate(
source = PdfGenerationSource.Html("<strong>Hello world!</strong>"),
settings = PdfGenerationSettings.default.copy(
includeBackgrounds = false,
metadata = PdfMetadata(
title = "My PDF"
),
pageMargins = PdfMargins.cm(top = 2.0, right = 2.0, bottom = 1.0, left = 2.0),
pageOrientation = PdfOrientation.landscape,
pageSize = PdfSize.A5,
preferCssPageSize = false
)
)
.writeTo(destinationFile)
Output to stream
generator.generate(PdfGenerationSource.Html("<strong>Hello world!</strong>"))
.writeTo(outputStream)
💡 Closing the output stream is the responsibility of the caller. It will not be closed automatically.
TO-DO
Contributions welcome 🙏
- Add unit tests.
- Add KDoc to all public API.
- Check if
.generate()
works well if used from multiple threads and document if that is the case. - Add support for header & footer templates.
License
Apache 2.0
*Note that all licence references and agreements mentioned in the fluid-pdf README section above
are relevant to that project's source code only.