pd4ml 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e64864df0fb4496d031d723120f675781e9212886577f4dc499acc80f31c4516
4
+ data.tar.gz: 29610ecaa6be3bd219b85d457049060edfca8432c10b5c398ff255a375abc675
5
+ SHA512:
6
+ metadata.gz: 7e4ba762f395543307059f5c4b1842e6bc33f167f2a8b03d5d41127a6e95c63bb7963375c1880963c370ba8b98a882d951cca1da1a3bcbdfaf0465e754968906
7
+ data.tar.gz: 1f235d8f8b872d6bba0ed332ac8d765a84fd3c17c73b9102260b3d037258c1007f2c6c7d17896cf2eb20a6d675a86dc61eca928da824aae811b1933d6496a671
data/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # pd4ml — PD4ML for Ruby
2
+
3
+ HTML and CSS to **PDF**, **PDF/A**, **PDF/UA**, **ZUGFeRD/Factur-X**, **DOCX**, **RTF** and
4
+ **images** from Ruby, with the complete public [PD4ML](https://pd4ml.com) API. The v42 layout
5
+ engine is the default.
6
+
7
+ ```ruby
8
+ require 'pd4ml'
9
+
10
+ pd = Pd4ml::PD4ML.new
11
+ pd.set_page_size(Pd4ml::PageSize::A4)
12
+ pd.set_page_footer('<div style="text-align:right">page $[page] of $[total]</div>', 24, '1+')
13
+ pd.read_html_string('<h1>Hello, PDF</h1><p>Generated with <b>PD4ML</b>.</p>')
14
+ pd.write_pdf('hello.pdf') # or pdf = pd.write_pdf (a binary String), or an IO
15
+ ```
16
+
17
+ ## Installation
18
+
19
+ With Bundler, in the `Gemfile`:
20
+
21
+ ```ruby
22
+ gem 'pd4ml', git: 'https://github.com/zxfr/pd4ml-ruby.git'
23
+ ```
24
+
25
+ or download the gem from <https://github.com/zxfr/pd4ml-ruby/releases>:
26
+
27
+ ```
28
+ gem install pd4ml-1.0.0.gem
29
+ pd4ml install # optional: otherwise the first use downloads PD4ML
30
+ ```
31
+
32
+ Requirements:
33
+
34
+ - Ruby 3.1 or later.
35
+ - Java 8 or later, found through `PD4ML_JAVA`, `JAVA_HOME` or the `PATH`.
36
+
37
+ PD4ML itself is downloaded from <https://pd4ml.com/maven2>: the most recent 4.x release, plus the
38
+ Bouncy Castle jars it needs for encryption and signing. Every file is checked against its SHA-1
39
+ checksum. The download happens with `pd4ml install`, or on first use (`PD4ML_AUTO_INSTALL=0`
40
+ turns that off). Builds are stored per user (`%LOCALAPPDATA%\pd4ml-ruby`, `~/.cache/pd4ml-ruby`,
41
+ or `PD4ML_HOME`).
42
+
43
+ To use a PD4ML jar of your own, set `PD4ML_CLASSPATH`, set `PD4ML_CLASSPATH_FILE`, or call
44
+ `Pd4ml.configure(classpath: [...])`.
45
+
46
+ ## How it works
47
+
48
+ PD4ML is a Java library. The gem starts it once per process in a small bridge process and calls
49
+ it over a pipe. Every class and method is available:
50
+
51
+ - by its Java name (`setPageSize`) or Ruby-style (`set_page_size`, `use_ttf`, `demo_mode?`);
52
+ - constants as Ruby constants (`Pd4ml::PageSize::A4`, `Pd4ml::Constants::AllowPrint`);
53
+ - any other Java class through `Pd4ml::Java.type`.
54
+
55
+ The gem adds Ruby I/O on top: paths, URLs, binary Strings and IO objects in and out, and blocks
56
+ for progress listeners. Several processes can share one bridge server: run `pd4ml serve` and set
57
+ `PD4ML_BRIDGE=tcp://127.0.0.1:8723`.
58
+
59
+ ## Command line
60
+
61
+ ```
62
+ pd4ml install [VERSION] [--snapshots] download PD4ML (or update it)
63
+ pd4ml list versions in the repository
64
+ pd4ml version the PD4ML version in use
65
+ pd4ml convert in.html out.pdf [--page-size A4 --landscape --spec pdf/a-2b ...]
66
+ pd4ml serve [--port 8723] a shared bridge server
67
+ ```
68
+
69
+ ## Documentation
70
+
71
+ - [User guide](docs/guide.md): installation, the bridge, use cases, tips, troubleshooting
72
+ - [API reference](docs/api.md): every PD4ML class and method with its Ruby name
73
+ - [PD4ML documentation](https://pd4ml.com/docs/)
74
+
75
+ ## Development
76
+
77
+ Run the tests with `rake test`. Set `PD4ML_NETWORK_TESTS=1` to include the first-use download
78
+ test. The tests use `./pd4ml.classpath` if it exists (for example, for a PD4ML development
79
+ build), else the installed build.
80
+
81
+ | Command | |
82
+ |---|---|
83
+ | `rake bridge` | rebuilds `lib/pd4ml/pd4ml-bridge.jar` from `java/src` (needs a JDK) |
84
+ | `rake api` | regenerates `docs/api.md` with `javap` |
85
+ | `gem build pd4ml.gemspec` | builds the gem |
86
+ | `ruby tools/dist.rb` | the redistribution package: branch `dist` (pushed as github.com/zxfr/pd4ml-ruby `main`) and the gem |
87
+
88
+ ## License
89
+
90
+ The gem is provided by PD4ML. PD4ML is commercial software: without a license it runs in
91
+ evaluation mode and watermarks its output. See [licensing](https://pd4ml.com/docs/#3.-licensing).
data/docs/api.md ADDED
@@ -0,0 +1,546 @@
1
+ # PD4ML API reference (Ruby)
2
+
3
+ _Generated by `tools/gen_api.rb` from the PD4ML Java classes - do not edit._
4
+
5
+ Every public PD4ML class is a Ruby class in the `Pd4ml` module. Methods can be called by their Java name (`setPageSize`) or Ruby-style (`set_page_size`; `isDemoMode` as `demo_mode?`); both are listed below. Constants and static fields are Ruby constants or class methods (`Pd4ml::PageSize::A4`, `Pd4ml::LayoutEngine.v42`), public instance fields are read with `obj[:name]`. Java types appear as Ruby types: binary Strings for `byte[]` and `InputStream`, a path or URL String for `URL`/`File`, `JavaObject` for any other Java object. Descriptions of each method are in the [PD4ML manual](https://pd4ml.com/docs/pd4ml-manual.html).
6
+
7
+ ## Pd4ml::PD4ML
8
+
9
+ `com.pd4ml.PD4ML` — `Pd4ml::PD4ML` adds Ruby I/O methods: see the guide
10
+
11
+ | Field | Type | |
12
+ |---|---|---|
13
+ | `Pd4ml::PD4ML.disableBatik` | true/false | static |
14
+ | `Pd4ml::PD4ML.disableMathML` | true/false | static |
15
+
16
+ ```ruby
17
+ apply_license(license: String) -> true/false # applyLicense
18
+ demo_mode?() -> true/false # isDemoMode
19
+ pro?() -> true/false # isPro
20
+ Pd4ml::PD4ML.get_version() -> String # getVersion
21
+ Pd4ml::PD4ML.get_version_build_date() -> JavaObject # getVersionBuildDate
22
+ merge(pdf: PdfDocument, from_page: Integer, to_page: Integer, append: true/false) -> nil # merge
23
+ terminate() -> nil # terminate
24
+ set_log_level(level: Integer) -> nil # setLogLevel
25
+ set_error_policy(policy: ErrorPolicy) -> nil # setErrorPolicy
26
+ use_ttf(path_to_font_dirs: String) -> nil # useTTF
27
+ use_ttf(path_to_font_dirs: String, generate_font_mapping_file_if_missing: true/false) -> nil # useTTF
28
+ use_ttf(path_to_font_dirs: String, font_file_name_filter: String) -> nil # useTTF
29
+ embed_ttfs(embed: true/false, all_glyphs: true/false) -> nil # embedTTFs
30
+ generate_forms(enable: true/false, use_ttf_font: String) -> nil # generateForms
31
+ generate_forms(enable: true/false, use_ttf_font: String, form_font_char_range: String) -> nil # generateForms
32
+ generate_forms?() -> true/false # isGenerateForms
33
+ get_form_font() -> String # getFormFont
34
+ get_form_font_char_range() -> String # getFormFontCharRange
35
+ generate_multicolumn(columns: Integer, span: Integer, millimeters: true/false) -> nil # generateMulticolumn
36
+ use_http_request(http_request: Object, http_response: Object) -> nil # useHttpRequest
37
+ add_custom_resource_provider(custom_provider_class_name: String) -> nil # addCustomResourceProvider
38
+ add_custom_tag_handler(custom_tag_name: String, implementation: CustomTag) -> nil # addCustomTagHandler
39
+ generate_bookmarks_from_headings(enable: true/false) -> nil # generateBookmarksFromHeadings
40
+ generate_bookmarks_from_anchors(enable: true/false) -> nil # generateBookmarksFromAnchors
41
+ generate_bookmarks_from_headings() -> true/false # generateBookmarksFromHeadings
42
+ generate_bookmarks_from_anchors() -> true/false # generateBookmarksFromAnchors
43
+ set_session_id(session_id: String) -> nil # setSessionID
44
+ override_document_encoding(encoding: String) -> nil # overrideDocumentEncoding
45
+ enable_hyperlinks(enable: true/false) -> nil # enableHyperlinks
46
+ hyperlinks_disabled?() -> true/false # isHyperlinksDisabled
47
+ generate_tooltips?() -> true/false # isGenerateTooltips
48
+ set_page_header(html_code: String, height_px: Integer) -> nil # setPageHeader
49
+ set_page_header(html_code: String, height_px: Integer, scope: String) -> nil # setPageHeader
50
+ set_page_footer(html_code: String, height_px: Integer) -> nil # setPageFooter
51
+ set_page_footer(html_code: String, height_px: Integer, scope: String) -> nil # setPageFooter
52
+ set_watermark(html_code: String, left: Float, top: Float, opacity: Float, angle: Float, scale: Float, screen: true/false, print: true/false, scope: String) -> nil # setWatermark
53
+ set_page_background(html_code: String) -> nil # setPageBackground
54
+ set_page_background(html_code: String, scope: String) -> nil # setPageBackground
55
+ set_permissions(password: String, permissions: Integer) -> nil # setPermissions
56
+ set_permissions(password: String, permissions: Integer, encryption_method: Integer) -> nil # setPermissions
57
+ set_cookie(name: String, value: String) -> nil # setCookie
58
+ set_http_options(proxy: String, basic_authentication: String) -> nil # setHttpOptions
59
+ add_document_action_handler(action_type: String, java_script: String) -> nil # addDocumentActionHandler
60
+ get_action_handlers() -> Hash # getActionHandlers
61
+ set_page_size(d: PageSize, scope: String) -> nil # setPageSize
62
+ set_page_size(d: PageSize) -> nil # setPageSize
63
+ get_page_size(page_num: Integer) -> PageSize # getPageSize
64
+ set_page_margins(margins: PageMargins) -> nil # setPageMargins
65
+ set_page_margins(margins: PageMargins, scope: String) -> nil # setPageMargins
66
+ get_page_margins(page_num: Integer, image_generation: true/false) -> PageMargins # getPageMargins
67
+ set_html_width(width: Integer) -> nil # setHtmlWidth
68
+ adjust_html_width(adjust: true/false) -> nil # adjustHtmlWidth
69
+ fit_page_vertically(align: Integer) -> nil # fitPageVertically
70
+ get_fit_page_vertically() -> Integer # getFitPageVertically
71
+ set_author_name(name: String) -> nil # setAuthorName
72
+ set_document_title(title: String) -> nil # setDocumentTitle
73
+ set_initial_page_number(initial_page_number: Integer) -> nil # setInitialPageNumber
74
+ add_style(stylesheet: String / JavaObject, override_document_styles: true/false) -> nil # addStyle
75
+ add_style(stylesheet: String, override_document_styles: true/false) -> nil # addStyle
76
+ inject_html(html_snippet: String, prepend_body_content: true/false) -> nil # injectHtml
77
+ keep_trailing_blank_pages?() -> true/false # isKeepTrailingBlankPages
78
+ test_termination() -> nil # testTermination
79
+ get_height(width: Integer) -> Integer # getHeight
80
+ get_document_title() -> String # getDocumentTitle
81
+ set_rendering_hints(hints: Hash) -> nil # setRenderingHints
82
+ dump(mode: Integer) -> String # dump
83
+ protect_physical_unit_dimensions(keep_physical_unit_dimensions: true/false) -> nil # protectPhysicalUnitDimensions
84
+ Pd4ml::PD4ML.translate_to_pt(mm: Float) -> Float # translateToPt
85
+ Pd4ml::PD4ML.predict_scale(page_margins: PageMargins, page_size: PageSize, user_space: Integer) -> Float # predictScale
86
+ Pd4ml::PD4ML.predict_page_height(page_margins: PageMargins, page_size: PageSize, user_space: Integer) -> Integer # predictPageHeight
87
+ set_dynamic_data(map: Hash) -> nil # setDynamicData
88
+ set_param(key: String, value: String) -> nil # setParam
89
+ get_last_render_info(key: String) -> Object # getLastRenderInfo
90
+ output_range(description: String) -> nil # outputRange
91
+ add_metadata(key: String, value: String, hide: true/false) -> nil # addMetadata
92
+ apply_kerning(enable: true/false) -> nil # applyKerning
93
+ enable_ligatures(enable: true/false) -> nil # enableLigatures
94
+ get_cache() -> Object # getCache
95
+ set_cache(font_cache: Object) -> nil # setCache
96
+ async_resource_loader(thread_pool_size: Integer) -> nil # asyncResourceLoader
97
+ ```
98
+
99
+ ## Pd4ml::Constants
100
+
101
+ `com.pd4ml.Constants`
102
+
103
+ | Field | Type | |
104
+ |---|---|---|
105
+ | `Pd4ml::Constants::TRANSLATE_FACTOR` | Float | static read-only |
106
+ | `Pd4ml::Constants::DefaultPermissions` | Integer | static read-only |
107
+ | `Pd4ml::Constants::AllowDegradedPrint` | Integer | static read-only |
108
+ | `Pd4ml::Constants::AllowModify` | Integer | static read-only |
109
+ | `Pd4ml::Constants::AllowCopy` | Integer | static read-only |
110
+ | `Pd4ml::Constants::AllowAnnotate` | Integer | static read-only |
111
+ | `Pd4ml::Constants::AllowFillingForms` | Integer | static read-only |
112
+ | `Pd4ml::Constants::AllowContentExtraction` | Integer | static read-only |
113
+ | `Pd4ml::Constants::AllowAssembly` | Integer | static read-only |
114
+ | `Pd4ml::Constants::AllowPrint` | Integer | static read-only |
115
+ | `Pd4ml::Constants::PD4ML_MAX_CACHE_ENTRIES` | String | static read-only |
116
+ | `Pd4ml::Constants::PD4ML_MAX_CACHE_SIZE` | String | static read-only |
117
+ | `Pd4ml::Constants::PD4ML_MAX_CACHE_VOLUME` | String | static read-only |
118
+ | `Pd4ml::Constants::PD4ML_IDS_AS_DESTINATIONS` | String | static read-only |
119
+ | `Pd4ml::Constants::PD4ML_EXTRA_RESOURCE_LOADERS` | String | static read-only |
120
+ | `Pd4ml::Constants::PD4ML_DOCUMENT_VIEW_MODE` | String | static read-only |
121
+ | `Pd4ml::Constants::PD4ML_DOCUMENT_DATE` | String | static read-only |
122
+ | `Pd4ml::Constants::PD4ML_WORD_EDITABLE` | String | static read-only |
123
+ | `Pd4ml::Constants::PD4ML_DOCUMENT_XMP_DATE` | String | static read-only |
124
+ | `Pd4ml::Constants::PD4ML_FAKE_BROWSER` | String | static read-only |
125
+ | `Pd4ml::Constants::PD4ML_CACHE_ENABLE` | String | static read-only |
126
+ | `Pd4ml::Constants::PD4ML_SESSIONID_APPEND` | String | static read-only |
127
+ | `Pd4ml::Constants::PD4ML_SOCKET_TIMEOUT` | String | static read-only |
128
+ | `Pd4ml::Constants::PD4ML_PRINT_DIALOG_POPUP` | String | static read-only |
129
+ | `Pd4ml::Constants::PD4ML_MEDIA_TYPE_PRINT` | String | static read-only |
130
+ | `Pd4ml::Constants::PD4ML_CSS_IMPORT_DIRECTIVE` | String | static read-only |
131
+ | `Pd4ml::Constants::PD4ML_SESSIONID_VARNAME` | String | static read-only |
132
+ | `Pd4ml::Constants::PD4ML_INITIAL_PAGE_NUMBER` | String | static read-only |
133
+ | `Pd4ml::Constants::PD4ML_HTML_IN_DYNAMIC_DATA` | String | static read-only |
134
+ | `Pd4ml::Constants::PD4ML_ALLOWED_RESOURCE_LOCATION` | String | static read-only |
135
+ | `Pd4ml::Constants::PD4ML_DISABLE_EXTERNAL_ATTACHMENTS` | String | static read-only |
136
+ | `Pd4ml::Constants::PD4ML_GENERATE_TOOLTIPS` | String | static read-only |
137
+ | `Pd4ml::Constants::PD4ML_CACHE_IMAGES_IN_TMP_DIR` | String | static read-only |
138
+ | `Pd4ml::Constants::PD4ML_HTTP_REQUEST_DISPATCHER` | String | static read-only |
139
+ | `Pd4ml::Constants::PD4ML_PDFA_STATUS` | String | static read-only |
140
+ | `Pd4ml::Constants::PD4ML_DOCUMENT_HEIGHT_PX` | String | static read-only |
141
+ | `Pd4ml::Constants::PD4ML_RIGHT_EDGE_PX` | String | static read-only |
142
+ | `Pd4ml::Constants::PD4ML_TOTAL_PAGES` | String | static read-only |
143
+ | `Pd4ml::Constants::PD4ML_INFO_AUTHOR` | String | static read-only |
144
+ | `Pd4ml::Constants::PD4ML_INFO_TITLE` | String | static read-only |
145
+ | `Pd4ml::Constants::PD4ML_FORCE_RTL` | String | static read-only |
146
+ | `Pd4ml::Constants::PD4ML_BACKGROUND_AS_PATTERNS` | String | static read-only |
147
+ | `Pd4ml::Constants::PD4ML_CONFIG_FILE` | String | static read-only |
148
+ | `Pd4ml::Constants::PD4ML_CONFIG_HANDLER_CLASS` | String | static read-only |
149
+ | `Pd4ml::Constants::PD4ML_IMAGE_REPOSITORY` | String | static read-only |
150
+ | `Pd4ml::Constants::PD4ML_FIX20130116` | String | static read-only |
151
+ | `Pd4ml::Constants::PD4ML_STYLESHEETS_TO_OMIT` | String | static read-only |
152
+ | `Pd4ml::Constants::PD4ML_ENABLE_HTTP_ERRORS` | String | static read-only |
153
+ | `Pd4ml::Constants::PD4ML_OMIT_DEFAULT_STYLE` | String | static read-only |
154
+ | `Pd4ml::Constants::PD4ML_DUMP_DEFAULT_STYLE` | String | static read-only |
155
+ | `Pd4ml::Constants::PD4ML_HEADER_HEIGHT_LIMIT` | String | static read-only |
156
+ | `Pd4ml::Constants::PD4ML_KEEP_TRAILING_BLANK_PAGES` | String | static read-only |
157
+ | `Pd4ml::Constants::PD4ML_DISABLE_WOFF` | String | static read-only |
158
+ | `Pd4ml::Constants::PD4ML_DISABLE_WOFF2` | String | static read-only |
159
+ | `Pd4ml::Constants::PD4ML_PDF_BROTLI` | String | static read-only |
160
+ | `Pd4ml::Constants::PDF` | String | static read-only |
161
+ | `Pd4ml::Constants::PDFA` | String | static read-only |
162
+ | `Pd4ml::Constants::PDFUA` | String | static read-only |
163
+ | `Pd4ml::Constants::DOCX` | String | static read-only |
164
+ | `Pd4ml::Constants::RTF` | String | static read-only |
165
+ | `Pd4ml::Constants::RTF_WMF` | String | static read-only |
166
+ | `Pd4ml::Constants::PNG8` | String | static read-only |
167
+ | `Pd4ml::Constants::PNG24` | String | static read-only |
168
+ | `Pd4ml::Constants::TIFF` | String | static read-only |
169
+ | `Pd4ml::Constants::TIFF_COMPRESSED` | String | static read-only |
170
+ | `Pd4ml::Constants::MULTIPAGE_TIFF` | String | static read-only |
171
+ | `Pd4ml::Constants::MULTIPAGE_TIFF_COMPRESSED` | String | static read-only |
172
+ | `Pd4ml::Constants::LEFT_ALIGN` | Integer | static read-only |
173
+ | `Pd4ml::Constants::CENTER_ALIGN` | Integer | static read-only |
174
+ | `Pd4ml::Constants::RIGHT_ALIGN` | Integer | static read-only |
175
+ | `Pd4ml::Constants::RC4_40BIT` | Integer | static read-only |
176
+ | `Pd4ml::Constants::RC4_128BIT` | Integer | static read-only |
177
+ | `Pd4ml::Constants::AES_128BIT` | Integer | static read-only |
178
+ | `Pd4ml::Constants::AES_256BIT` | Integer | static read-only |
179
+ | `Pd4ml::Constants::ISO8859_1` | String | static read-only |
180
+ | `Pd4ml::Constants::WINDOWS_1252` | String | static read-only |
181
+ | `Pd4ml::Constants::UTF8` | String | static read-only |
182
+
183
+ ```ruby
184
+ Pd4ml::Constants.new()
185
+ ```
186
+
187
+ ## Pd4ml::LayoutEngine
188
+
189
+ `com.pd4ml.Constants.LayoutEngine`
190
+
191
+ | Field | Type | |
192
+ |---|---|---|
193
+ | `Pd4ml::LayoutEngine.v40` | LayoutEngine | static read-only |
194
+ | `Pd4ml::LayoutEngine.v42` | LayoutEngine | static read-only |
195
+
196
+ ```ruby
197
+ Pd4ml::LayoutEngine.values() -> Array<LayoutEngine> # values
198
+ Pd4ml::LayoutEngine.value_of(name: String) -> LayoutEngine # valueOf
199
+ ```
200
+
201
+ ## Pd4ml::ErrorPolicy
202
+
203
+ `com.pd4ml.Constants.ErrorPolicy`
204
+
205
+ | Field | Type | |
206
+ |---|---|---|
207
+ | `Pd4ml::ErrorPolicy::NONE` | ErrorPolicy | static read-only |
208
+ | `Pd4ml::ErrorPolicy::RELAXED` | ErrorPolicy | static read-only |
209
+ | `Pd4ml::ErrorPolicy::NORMAL` | ErrorPolicy | static read-only |
210
+ | `Pd4ml::ErrorPolicy::PEDANTIC` | ErrorPolicy | static read-only |
211
+ | `Pd4ml::ErrorPolicy::STRICT` | ErrorPolicy | static read-only |
212
+
213
+ ```ruby
214
+ Pd4ml::ErrorPolicy.values() -> Array<ErrorPolicy> # values
215
+ Pd4ml::ErrorPolicy.value_of(name: String) -> ErrorPolicy # valueOf
216
+ ```
217
+
218
+ ## Pd4ml::PageSize
219
+
220
+ `com.pd4ml.PageSize`
221
+
222
+ | Field | Type | |
223
+ |---|---|---|
224
+ | `Pd4ml::PageSize::B5` | PageSize | static read-only |
225
+ | `Pd4ml::PageSize::B4` | PageSize | static read-only |
226
+ | `Pd4ml::PageSize::JIS_B5` | PageSize | static read-only |
227
+ | `Pd4ml::PageSize::JIS_B4` | PageSize | static read-only |
228
+ | `Pd4ml::PageSize::A10` | PageSize | static read-only |
229
+ | `Pd4ml::PageSize::A9` | PageSize | static read-only |
230
+ | `Pd4ml::PageSize::A8` | PageSize | static read-only |
231
+ | `Pd4ml::PageSize::A7` | PageSize | static read-only |
232
+ | `Pd4ml::PageSize::A6` | PageSize | static read-only |
233
+ | `Pd4ml::PageSize::A5` | PageSize | static read-only |
234
+ | `Pd4ml::PageSize::A4` | PageSize | static read-only |
235
+ | `Pd4ml::PageSize::A3` | PageSize | static read-only |
236
+ | `Pd4ml::PageSize::A2` | PageSize | static read-only |
237
+ | `Pd4ml::PageSize::A1` | PageSize | static read-only |
238
+ | `Pd4ml::PageSize::A0` | PageSize | static read-only |
239
+ | `Pd4ml::PageSize::ISOB5` | PageSize | static read-only |
240
+ | `Pd4ml::PageSize::ISOB4` | PageSize | static read-only |
241
+ | `Pd4ml::PageSize::ISOB3` | PageSize | static read-only |
242
+ | `Pd4ml::PageSize::ISOB2` | PageSize | static read-only |
243
+ | `Pd4ml::PageSize::ISOB1` | PageSize | static read-only |
244
+ | `Pd4ml::PageSize::ISOB0` | PageSize | static read-only |
245
+ | `Pd4ml::PageSize::HALFLETTER` | PageSize | static read-only |
246
+ | `Pd4ml::PageSize::LETTER` | PageSize | static read-only |
247
+ | `Pd4ml::PageSize::TABLOID` | PageSize | static read-only |
248
+ | `Pd4ml::PageSize::LEDGER` | PageSize | static read-only |
249
+ | `Pd4ml::PageSize::NOTE` | PageSize | static read-only |
250
+ | `Pd4ml::PageSize::LEGAL` | PageSize | static read-only |
251
+ | `Pd4ml::PageSize::ArchA` | PageSize | static read-only |
252
+ | `Pd4ml::PageSize::ArchB` | PageSize | static read-only |
253
+ | `Pd4ml::PageSize::ArchC` | PageSize | static read-only |
254
+ | `Pd4ml::PageSize::ArchD` | PageSize | static read-only |
255
+ | `Pd4ml::PageSize::ArchE` | PageSize | static read-only |
256
+ | `Pd4ml::PageSize::ArchE1` | PageSize | static read-only |
257
+ | `obj[:width]` | Float | |
258
+ | `obj[:height]` | Float | |
259
+ | `obj[:rotated]` | true/false | |
260
+
261
+ ```ruby
262
+ Pd4ml::PageSize.new(width: Float, height: Float, units: Units)
263
+ Pd4ml::PageSize.new(width: Float, height: Float)
264
+ rotate() -> PageSize # rotate
265
+ mm_width() -> Float # mmWidth
266
+ mm_height() -> Float # mmHeight
267
+ Pd4ml::PageSize.get_instance(name: String) -> PageSize # getInstance
268
+ ```
269
+
270
+ ## Pd4ml::PageMargins
271
+
272
+ `com.pd4ml.PageMargins`
273
+
274
+ | Field | Type | |
275
+ |---|---|---|
276
+ | `Pd4ml::PageMargins::DEFAULT_PAGE_MARGINS` | PageMargins | static read-only |
277
+ | `obj[:left]` | Float | |
278
+ | `obj[:top]` | Float | |
279
+ | `obj[:right]` | Float | |
280
+ | `obj[:bottom]` | Float | |
281
+
282
+ ```ruby
283
+ Pd4ml::PageMargins.new(left: Float, top: Float, right: Float, bottom: Float)
284
+ Pd4ml::PageMargins.new(left: Float, top: Float, right: Float, bottom: Float, units: Units)
285
+ flip_horizontal() -> PageMargins # flipHorizontal
286
+ flip_vertical() -> PageMargins # flipVertical
287
+ rotate() -> PageMargins # rotate
288
+ ```
289
+
290
+ ## Pd4ml::Dimensions
291
+
292
+ `com.pd4ml.Dimensions` (interface)
293
+
294
+ | Field | Type | |
295
+ |---|---|---|
296
+ | `Pd4ml::Dimensions::MM_PER_INCH` | Float | static read-only |
297
+ | `Pd4ml::Dimensions::POINTS_PER_MM` | Float | static read-only |
298
+ | `Pd4ml::Dimensions::POINTS_PER_INCH` | Float | static read-only |
299
+ | `Pd4ml::Dimensions::PIXELS_PER_POINT` | Float | static read-only |
300
+
301
+ ## Pd4ml::Units
302
+
303
+ `com.pd4ml.Dimensions.Units`
304
+
305
+ | Field | Type | |
306
+ |---|---|---|
307
+ | `Pd4ml::Units::MM` | Units | static read-only |
308
+ | `Pd4ml::Units::PT` | Units | static read-only |
309
+ | `Pd4ml::Units::PX` | Units | static read-only |
310
+
311
+ ```ruby
312
+ Pd4ml::Units.values() -> Array<Units> # values
313
+ Pd4ml::Units.value_of(name: String) -> Units # valueOf
314
+ ```
315
+
316
+ ## Pd4ml::PdfSpec
317
+
318
+ `com.pd4ml.PdfSpec`
319
+
320
+ | Field | Type | |
321
+ |---|---|---|
322
+ | `Pd4ml::PdfSpec::PDF_1_0` | PdfSpec | static read-only |
323
+ | `Pd4ml::PdfSpec::PDF_1_1` | PdfSpec | static read-only |
324
+ | `Pd4ml::PdfSpec::PDF_1_2` | PdfSpec | static read-only |
325
+ | `Pd4ml::PdfSpec::PDF_1_3` | PdfSpec | static read-only |
326
+ | `Pd4ml::PdfSpec::PDF_1_4` | PdfSpec | static read-only |
327
+ | `Pd4ml::PdfSpec::PDF_1_5` | PdfSpec | static read-only |
328
+ | `Pd4ml::PdfSpec::PDF_1_6` | PdfSpec | static read-only |
329
+ | `Pd4ml::PdfSpec::PDF_1_7` | PdfSpec | static read-only |
330
+ | `Pd4ml::PdfSpec::PDF_1_7_1` | PdfSpec | static read-only |
331
+ | `Pd4ml::PdfSpec::PDF_1_7_2` | PdfSpec | static read-only |
332
+ | `Pd4ml::PdfSpec::PDF_1_7_3` | PdfSpec | static read-only |
333
+ | `Pd4ml::PdfSpec::PDF_1_7_4` | PdfSpec | static read-only |
334
+ | `Pd4ml::PdfSpec::PDF_1_7_5` | PdfSpec | static read-only |
335
+ | `Pd4ml::PdfSpec::PDF_1_7_6` | PdfSpec | static read-only |
336
+ | `Pd4ml::PdfSpec::PDF_1_7_7` | PdfSpec | static read-only |
337
+ | `Pd4ml::PdfSpec::PDF_1_7_8` | PdfSpec | static read-only |
338
+ | `Pd4ml::PdfSpec::PDF_1_7_9` | PdfSpec | static read-only |
339
+ | `Pd4ml::PdfSpec::PDF_1_7_10` | PdfSpec | static read-only |
340
+ | `Pd4ml::PdfSpec::PDF_1_7_11` | PdfSpec | static read-only |
341
+ | `Pd4ml::PdfSpec::PDF_2_0` | PdfSpec | static read-only |
342
+ | `Pd4ml::PdfSpec::PDFA_1A` | PdfSpec | static read-only |
343
+ | `Pd4ml::PdfSpec::PDFA_1B` | PdfSpec | static read-only |
344
+ | `Pd4ml::PdfSpec::PDFA_2A` | PdfSpec | static read-only |
345
+ | `Pd4ml::PdfSpec::PDFA_2B` | PdfSpec | static read-only |
346
+ | `Pd4ml::PdfSpec::PDFA_2U` | PdfSpec | static read-only |
347
+ | `Pd4ml::PdfSpec::PDFA_3A` | PdfSpec | static read-only |
348
+ | `Pd4ml::PdfSpec::PDFA_3B` | PdfSpec | static read-only |
349
+ | `Pd4ml::PdfSpec::PDFA_3U` | PdfSpec | static read-only |
350
+ | `Pd4ml::PdfSpec::PDFA_4` | PdfSpec | static read-only |
351
+ | `Pd4ml::PdfSpec::PDFA_4E` | PdfSpec | static read-only |
352
+ | `Pd4ml::PdfSpec::PDFUA_1` | PdfSpec | static read-only |
353
+ | `Pd4ml::PdfSpec::PDFUA_2` | PdfSpec | static read-only |
354
+ | `Pd4ml::PdfSpec::ZUGFeRD` | PdfSpec | static read-only |
355
+ | `Pd4ml::PdfSpec::ZUGFeRD_a` | PdfSpec | static read-only |
356
+ | `Pd4ml::PdfSpec::FacturX` | PdfSpec | static read-only |
357
+ | `Pd4ml::PdfSpec::FacturX_a` | PdfSpec | static read-only |
358
+ | `obj[:name]` | String | |
359
+ | `obj[:id]` | Integer | |
360
+ | `obj[:xid]` | Integer | |
361
+
362
+ ```ruby
363
+ Pd4ml::PdfSpec.new(spec: PdfSpec)
364
+ combine(spec: PdfSpec) -> PdfSpec # combine
365
+ with_minimum_version(version: PdfSpec) -> PdfSpec # withMinimumVersion
366
+ pdfa?() -> true/false # isPdfa
367
+ pdfa1?() -> true/false # isPdfa1
368
+ pdfa1a?() -> true/false # isPdfa1a
369
+ pdfa1b?() -> true/false # isPdfa1b
370
+ pdfa2?() -> true/false # isPdfa2
371
+ pdfa3?() -> true/false # isPdfa3
372
+ pdfa12?() -> true/false # isPdfa12
373
+ pdfa12a?() -> true/false # isPdfa12a
374
+ pdfa2u?() -> true/false # isPdfa2u
375
+ pdfa123?() -> true/false # isPdfa123
376
+ pdfa123a?() -> true/false # isPdfa123a
377
+ pdfa23?() -> true/false # isPdfa23
378
+ pdfa23a?() -> true/false # isPdfa23a
379
+ pdfa23b?() -> true/false # isPdfa23b
380
+ pdfa23u?() -> true/false # isPdfa23u
381
+ pdfa123b?() -> true/false # isPdfa123b
382
+ pdfa4e?() -> true/false # isPdfa4e
383
+ pdfa4f?() -> true/false # isPdfa4f
384
+ pdfa4?() -> true/false # isPdfa4
385
+ pdfa1234?() -> true/false # isPdfa1234
386
+ pdfa234?() -> true/false # isPdfa234
387
+ pdfua?() -> true/false # isPdfua
388
+ pdfua1?() -> true/false # isPdfua1
389
+ pdfua2?() -> true/false # isPdfua2
390
+ allows_transparency() -> true/false # allowsTransparency
391
+ allows_attachments() -> true/false # allowsAttachments
392
+ allows_doc_level_attachments() -> true/false # allowsDocLevelAttachments
393
+ allows_encryption() -> true/false # allowsEncryption
394
+ allows_pdf_forms() -> true/false # allowsPdfForms
395
+ requires_tagging() -> true/false # requiresTagging
396
+ requires_colorspace() -> true/false # requiresColorspace
397
+ requires_metadata() -> true/false # requiresMetadata
398
+ requires_output_internet() -> true/false # requiresOutputInternet
399
+ allows_external_hyperlinking() -> true/false # allowsExternalHyperlinking
400
+ requires_reliable_unicode_semantics() -> true/false # requiresReliableUnicodeSemantics
401
+ get_pdf_version_label() -> String # getPdfVersionLabel
402
+ get_pdf_ext_level() -> Integer # getPdfExtLevel
403
+ get_pdfa_version() -> Integer # getPdfaVersion
404
+ get_pdfua_version() -> Integer # getPdfuaVersion
405
+ Pd4ml::PdfSpec.are_compatible(pdf: PdfSpec, pdfa1: PdfSpec, pdfa2: PdfSpec) -> true/false # areCompatible
406
+ Pd4ml::PdfSpec.get_by_label(label: String) -> PdfSpec # getByLabel
407
+ Pd4ml::PdfSpec.get_instance(label: String) -> PdfSpec # getInstance
408
+ Pd4ml::PdfSpec.get_by_id(id: Integer) -> PdfSpec # getByID
409
+ Pd4ml::PdfSpec.list_keywords() -> String # listKeywords
410
+ ```
411
+
412
+ ## Pd4ml::PdfDocumentBase
413
+
414
+ `com.pd4ml.pdf.PdfDocumentBase`
415
+
416
+ ```ruby
417
+ write(out: JavaObject) -> nil # write
418
+ write(out: JavaObject, password: String, permissions: Integer) -> nil # write
419
+ append(to_merge: PdfDocumentBase) -> nil # append
420
+ overlay(another_doc: PdfDocumentBase, opacity: Integer) -> nil # overlay
421
+ overlay(another_doc: PdfDocumentBase, src_scope: String, dest_scope: String, opacity: Integer) -> nil # overlay
422
+ underlay(another_doc: PdfDocumentBase, opacity: Integer) -> nil # underlay
423
+ underlay(another_doc: PdfDocumentBase, src_scope: String, dest_scope: String, opacity: Integer) -> nil # underlay
424
+ get_number_of_pages() -> Integer # getNumberOfPages
425
+ get_permissions() -> Integer # getPermissions
426
+ get_title() -> String # getTitle
427
+ set_title(title: String) -> nil # setTitle
428
+ get_author() -> String # getAuthor
429
+ set_author(author: String) -> nil # setAuthor
430
+ get_pdf_format_version() -> String # getPdfFormatVersion
431
+ get_metadata() -> String # getMetadata
432
+ get_creation_date() -> String # getCreationDate
433
+ dump_outlines() -> String # dumpOutlines
434
+ get_keywords() -> String # getKeywords
435
+ set_keywords(keywords: String) -> nil # setKeywords
436
+ get_creator() -> String # getCreator
437
+ set_creator(creator: String) -> nil # setCreator
438
+ get_producer() -> String # getProducer
439
+ get_subject() -> String # getSubject
440
+ set_subject(subject: String) -> nil # setSubject
441
+ set_mod_date() -> nil # setModDate
442
+ get_mod_date() -> String # getModDate
443
+ get_page_size(page_index: Integer) -> PageSize # getPageSize
444
+ get_page_box(page_index: Integer, box_name: String) -> Array<Float> # getPageBox
445
+ read() -> nil # read
446
+ get_page_content(page_index: Integer) -> String # getPageContent
447
+ delete_page(page_number: Integer) -> Integer # deletePage
448
+ Pd4ml::PdfDocumentBase.compute_scope(scope: String, page_num: Integer) -> Array<true/false> # computeScope
449
+ ```
450
+
451
+ ## Pd4ml::PdfDocument
452
+
453
+ `com.pd4ml.PdfDocument`
454
+
455
+ ```ruby
456
+ Pd4ml::PdfDocument.new(bytes: String (binary), password: String)
457
+ Pd4ml::PdfDocument.new(stream: String (binary) / IO, password: String)
458
+ Pd4ml::PdfDocument.new(url: String / JavaObject, password: String)
459
+ Pd4ml::PdfDocument.new(writer: JavaObject)
460
+ Pd4ml::PdfDocument.merge_pdfs(pdf1: String (binary) / IO, pdf2: String (binary) / IO, result: JavaObject) -> nil # mergePDFs
461
+ ```
462
+
463
+ ## Pd4ml::ProgressListener
464
+
465
+ `com.pd4ml.ProgressListener` (interface)
466
+
467
+ | Field | Type | |
468
+ |---|---|---|
469
+ | `Pd4ml::ProgressListener::CONVERSION_BEGIN` | Integer | static read-only |
470
+ | `Pd4ml::ProgressListener::MAIN_DOC_READ` | Integer | static read-only |
471
+ | `Pd4ml::ProgressListener::HTML_PARSED` | Integer | static read-only |
472
+ | `Pd4ml::ProgressListener::RENDERER_TREE_BUILT` | Integer | static read-only |
473
+ | `Pd4ml::ProgressListener::HTML_LAYOUT_IN_PROGRESS` | Integer | static read-only |
474
+ | `Pd4ml::ProgressListener::HTML_LAYOUT_DONE` | Integer | static read-only |
475
+ | `Pd4ml::ProgressListener::PAGEBREAKS_ALIGNED` | Integer | static read-only |
476
+ | `Pd4ml::ProgressListener::TOC_GENERATED` | Integer | static read-only |
477
+ | `Pd4ml::ProgressListener::DOC_RENDER_IN_PROGRESS` | Integer | static read-only |
478
+ | `Pd4ml::ProgressListener::DOC_WRITE_BEGIN` | Integer | static read-only |
479
+ | `Pd4ml::ProgressListener::CONVERSION_END` | Integer | static read-only |
480
+ | `Pd4ml::ProgressListener::RTF_PRE_RENDER_DONE` | Integer | static read-only |
481
+ | `Pd4ml::ProgressListener::DOCX_PRE_RENDER_DONE` | Integer | static read-only |
482
+
483
+ ```ruby
484
+ progress_update(arg0: Integer, arg1: Integer, arg2: String, arg3: Integer) -> nil # progressUpdate
485
+ ```
486
+
487
+ ## Pd4ml::ResourceProvider
488
+
489
+ `com.pd4ml.ResourceProvider`
490
+
491
+ | Field | Type | |
492
+ |---|---|---|
493
+ | `obj[:mime]` | String | |
494
+ | `obj[:redirected]` | String / JavaObject | |
495
+
496
+ ```ruby
497
+ get_resource_as_stream(arg0: String, arg1: JavaObject) -> JavaObject # getResourceAsStream
498
+ can_load(arg0: String, arg1: JavaObject) -> true/false # canLoad
499
+ dont_cache() -> true/false # dontCache
500
+ local_file() -> String / JavaObject # localFile
501
+ close_resource_stream() -> nil # closeResourceStream
502
+ get_resource_as_bytes(resource: String, cache: JavaObject) -> String (binary) # getResourceAsBytes
503
+ get_mime() -> String # getMime
504
+ get_encoding() -> String # getEncoding
505
+ directory?() -> true/false # isDirectory
506
+ ```
507
+
508
+ ## Pd4ml::CustomTag
509
+
510
+ `com.pd4ml.CustomTag`
511
+
512
+ ```ruby
513
+ Pd4ml::CustomTag.new()
514
+ Pd4ml::CustomTag.new(code: String, font_cache: JavaObject, prime: CustomTag)
515
+ get_instance(code: String, font_cache: JavaObject) -> CustomTag # getInstance
516
+ set_element(element: JavaObject) -> nil # setElement
517
+ get_inner_code() -> String # getInnerCode
518
+ set_inner_code(code: String) -> nil # setInnerCode
519
+ get_width(base: Integer) -> Integer # getWidth
520
+ get_height(base: Integer) -> Integer # getHeight
521
+ set_width(width: Integer) -> nil # setWidth
522
+ set_height(height: Integer) -> nil # setHeight
523
+ paint(x: Float, y: Float, width: Float, height: Float, container_width: Float, container_height: Float, g: JavaObject) -> nil # paint
524
+ paint(x: Float, y: Float, g: JavaObject) -> nil # paint
525
+ empty_tag?() -> true/false # isEmptyTag
526
+ ```
527
+
528
+ ## Pd4ml::StatusMessage
529
+
530
+ `com.pd4ml.StatusMessage`
531
+
532
+ | Field | Type | |
533
+ |---|---|---|
534
+ | `Pd4ml::StatusMessage::WARNING` | Integer | static read-only |
535
+ | `Pd4ml::StatusMessage::ERROR` | Integer | static read-only |
536
+
537
+ ```ruby
538
+ Pd4ml::StatusMessage.new(type: Integer, id: Integer, message: String)
539
+ Pd4ml::StatusMessage.get_message(id: Integer, details: String) -> StatusMessage # getMessage
540
+ Pd4ml::StatusMessage.add_unique_message(status_messages: JavaObject, message: StatusMessage) -> true/false # addUniqueMessage
541
+ get_details() -> String # getDetails
542
+ set_details(details: String) -> nil # setDetails
543
+ error?() -> true/false # isError
544
+ warning?() -> true/false # isWarning
545
+ get_message() -> String # getMessage
546
+ ```