-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add close method. Suppress RJB warnings. Improve error handling.
- Loading branch information
Showing
8 changed files
with
181 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
require_relative 'fillable-pdf/itext' | ||
require_relative 'kernel' | ||
|
||
class Field | ||
PDF_NAME = Rjb.import('com.itextpdf.kernel.pdf.PdfName') | ||
# PdfName has a constant "A" and a constant "a". Unfortunately, RJB does not differentiate | ||
# between these constants and tries to create the same constant ("A") for both, which causes | ||
# an annoying warning "already initialized constant Rjb::Com_itextpdf_kernel_pdf_PdfName::A". | ||
# As long as RJB has not fixed this issue, this warning will remain suppressed. | ||
suppress_warnings { PDF_NAME = Rjb.import('com.itextpdf.kernel.pdf.PdfName') } | ||
|
||
BUTTON = PDF_NAME.Btn.toString | ||
CHOICE = PDF_NAME.Ch.toString | ||
SIGNATURE = PDF_NAME.Sig.toString | ||
TEXT = PDF_NAME.Tx.toString | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
class FillablePDF | ||
VERSION = '0.7.2' | ||
VERSION = '0.8.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Kernel | ||
def suppress_warnings | ||
original_verbosity = $VERBOSE | ||
$VERBOSE = nil | ||
result = yield | ||
$VERBOSE = original_verbosity | ||
result | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters