itext-jruby

IText (4.2.0) Pdf generation static java build packed to gem with some additional Ruby methods allowing adding attachments and encrypting document.

Usage

Instalation

gem install itext-jruby

Example

require 'itext-jruby'

@source_pdf   = File.expand_path('test/assets/sample.pdf')
@sample_image = File.expand_path('test/assets/pug.jpg')
@output_pdf   = File.expand_path('output.pdf')
@cert_file    = File.expand_path('test/assets/cert/ia.p12')

@pdf_document = Itext.new(path: @source_pdf)
@pdf_document.add_attachment @sample_image
@pdf_document.enable_signing!(private_key_path: @cert_file)
@pdf_document.save(@output_pdf)

Find more examples in test directory.

Changelog

  • 0.0.6 - First stable version allowing adding attachments to PdfFile

  • 0.0.7 - Add option to sign documents usign pkcs12 certificates

  • 0.0.8 - Minor fixes

  • 0.0.9 - Load jars only if required

  • 0.1.1 - Minor fixes

  • 0.1.2 - Minor fixes

Known issues

If you have time and knowledge how to solve following issues please submit a pull request.

Read more

Contributing to itext-jruby

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet.

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it.

  • Fork the project.

  • Start a feature/bugfix branch.

  • Commit and push until you are happy with your contribution.

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2013 Ernest Bursa. See LICENSE.txt for further details.