Skip to content
sosterPublic

About

An enhanced version of pdfjet (http://www.pdfjet.com), an Android compatible Java library to generate PDF documents. This version fixes some problems for adding content to certain pdf files.

Resources

Stars

41 stars

Watchers

4 watching

Forks

Repository files navigation

PDFjet

License

About

PDFjet is a programming library that enables universal reporting in your web or desktop application, without forcing your user to install special software. Virtually all personal and business users will be able to see your reports exactly the way that you designed them.

The home of PDFjet is GitHub: https://github.com/edragoev1/pdfjet — the current documentation, the examples, the changelog and every new release live there. Everything below only describes this fork.

This fork is used for my Android app HandWrite Pro: http://www.hand-write.com

What this fork adds

The fork is based on the open source edition v7.07.3 (PDF.producer still reports PDFjet v7.07.3). On top of that it has changes needed by HandWrite Pro, some of which are not in the release — and partially not even in the commercially available edition:

  • Support for more input PDF files without corrupting additional content (happened especially with PDF files generated by Microsoft Print to PDF).
  • Support for input PDF files with mixed line endings.
  • Transparency for additional content on top of input PDF files, plus de-duplication of the /ExtGState dictionary of an imported page.
  • Blend modes in GraphicsState — setBlendMode() writes /BM /<name>, needed for the highlighter's /BM /Multiply.
  • /AcroForm of an imported document survives the rewrite of the catalog, so filled form fields stay visible and the file stays a form.

Some of these have been merged into the official library in the meantime — check the upstream repository before fixing one of them here.

Note on upstream v9.x

Upstream has moved well beyond v7 (v9.0.9 is on Maven Central as com.pdfjet:pdfjet) and v9 carries a very large number of improvements over the version vendored here. It is worth a look before the next feature that touches PDF output — but some APIs have changed, so an update means re-applying the bullets above to the new base and adapting PdfExporter in scribmasterlib; it is not a drop-in jar swap.

Build

In HandWrite Pro the pdfjet classes are built as part of :scribmasterlib, which adds pdfjet/src/main/java to its own main source set — there is no separate step.

To build the jar on its own you need gradle (only gradle/wrapper/gradle-wrapper.properties is committed here, the gradlew scripts are not):

gradle jar

You find pdfjet-6.99.jar in the folder build/libs after a successful build.

The unit tests (in src/test) run with:

gradle test

The examples in src/examples are still the ones of the version this fork was cut from and no longer compile against it (gradle examplesClasses fails). For runnable examples of the current API see the examples of the upstream repository.

About

An enhanced version of pdfjet (http://www.pdfjet.com), an Android compatible Java library to generate PDF documents. This version fixes some problems for adding content to certain pdf files.

Resources

Stars

41 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages