hexapdf 0.37.1 → 0.38.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +40 -0
- data/LICENSE +1 -1
- data/README.md +17 -13
- data/data/hexapdf/sRGB2014.icc +0 -0
- data/data/hexapdf/sRGB2014.icc.LICENSE +7 -0
- data/examples/030-pdfa.rb +89 -0
- data/lib/hexapdf/cli/batch.rb +1 -1
- data/lib/hexapdf/cli/command.rb +1 -1
- data/lib/hexapdf/cli/files.rb +1 -1
- data/lib/hexapdf/cli/fonts.rb +1 -1
- data/lib/hexapdf/cli/form.rb +1 -1
- data/lib/hexapdf/cli/image2pdf.rb +1 -1
- data/lib/hexapdf/cli/images.rb +1 -1
- data/lib/hexapdf/cli/info.rb +1 -1
- data/lib/hexapdf/cli/inspect.rb +1 -1
- data/lib/hexapdf/cli/merge.rb +1 -1
- data/lib/hexapdf/cli/modify.rb +1 -1
- data/lib/hexapdf/cli/optimize.rb +1 -1
- data/lib/hexapdf/cli/split.rb +1 -1
- data/lib/hexapdf/cli/watermark.rb +1 -1
- data/lib/hexapdf/cli.rb +1 -1
- data/lib/hexapdf/composer.rb +1 -1
- data/lib/hexapdf/configuration.rb +14 -4
- data/lib/hexapdf/content/canvas.rb +2 -2
- data/lib/hexapdf/content/canvas_composer.rb +1 -1
- data/lib/hexapdf/content/color_space.rb +1 -1
- data/lib/hexapdf/content/graphic_object/arc.rb +1 -1
- data/lib/hexapdf/content/graphic_object/endpoint_arc.rb +1 -1
- data/lib/hexapdf/content/graphic_object/geom2d.rb +1 -1
- data/lib/hexapdf/content/graphic_object/solid_arc.rb +1 -1
- data/lib/hexapdf/content/graphic_object.rb +1 -1
- data/lib/hexapdf/content/graphics_state.rb +1 -1
- data/lib/hexapdf/content/operator.rb +1 -1
- data/lib/hexapdf/content/parser.rb +1 -1
- data/lib/hexapdf/content/processor.rb +4 -4
- data/lib/hexapdf/content/transformation_matrix.rb +3 -3
- data/lib/hexapdf/content.rb +1 -1
- data/lib/hexapdf/data_dir.rb +1 -1
- data/lib/hexapdf/dictionary.rb +1 -1
- data/lib/hexapdf/dictionary_fields.rb +1 -1
- data/lib/hexapdf/digital_signature/cms_handler.rb +1 -2
- data/lib/hexapdf/digital_signature/handler.rb +1 -1
- data/lib/hexapdf/digital_signature/pkcs1_handler.rb +1 -1
- data/lib/hexapdf/digital_signature/signature.rb +2 -2
- data/lib/hexapdf/digital_signature/signatures.rb +1 -1
- data/lib/hexapdf/digital_signature/signing/default_handler.rb +1 -1
- data/lib/hexapdf/digital_signature/signing/signed_data_creator.rb +1 -1
- data/lib/hexapdf/digital_signature/signing/timestamp_handler.rb +1 -1
- data/lib/hexapdf/digital_signature/signing.rb +1 -1
- data/lib/hexapdf/digital_signature/verification_result.rb +1 -1
- data/lib/hexapdf/digital_signature.rb +1 -1
- data/lib/hexapdf/document/destinations.rb +1 -1
- data/lib/hexapdf/document/files.rb +1 -1
- data/lib/hexapdf/document/fonts.rb +1 -1
- data/lib/hexapdf/document/images.rb +1 -1
- data/lib/hexapdf/document/layout.rb +9 -5
- data/lib/hexapdf/document/metadata.rb +64 -26
- data/lib/hexapdf/document/pages.rb +1 -1
- data/lib/hexapdf/document.rb +1 -1
- data/lib/hexapdf/encryption/aes.rb +1 -1
- data/lib/hexapdf/encryption/arc4.rb +1 -1
- data/lib/hexapdf/encryption/fast_aes.rb +1 -1
- data/lib/hexapdf/encryption/fast_arc4.rb +1 -1
- data/lib/hexapdf/encryption/identity.rb +1 -1
- data/lib/hexapdf/encryption/ruby_aes.rb +1 -1
- data/lib/hexapdf/encryption/ruby_arc4.rb +1 -1
- data/lib/hexapdf/encryption/security_handler.rb +1 -1
- data/lib/hexapdf/encryption/standard_security_handler.rb +1 -1
- data/lib/hexapdf/encryption.rb +1 -1
- data/lib/hexapdf/error.rb +1 -1
- data/lib/hexapdf/filter/ascii85_decode.rb +1 -1
- data/lib/hexapdf/filter/ascii_hex_decode.rb +1 -1
- data/lib/hexapdf/filter/crypt.rb +1 -1
- data/lib/hexapdf/filter/encryption.rb +1 -1
- data/lib/hexapdf/filter/flate_decode.rb +1 -1
- data/lib/hexapdf/filter/lzw_decode.rb +1 -1
- data/lib/hexapdf/filter/pass_through.rb +1 -1
- data/lib/hexapdf/filter/predictor.rb +1 -1
- data/lib/hexapdf/filter/run_length_decode.rb +1 -1
- data/lib/hexapdf/filter.rb +1 -1
- data/lib/hexapdf/font/cmap/parser.rb +1 -1
- data/lib/hexapdf/font/cmap/writer.rb +1 -1
- data/lib/hexapdf/font/cmap.rb +1 -1
- data/lib/hexapdf/font/encoding/base.rb +1 -1
- data/lib/hexapdf/font/encoding/difference_encoding.rb +1 -1
- data/lib/hexapdf/font/encoding/glyph_list.rb +2 -2
- data/lib/hexapdf/font/encoding/mac_expert_encoding.rb +1 -1
- data/lib/hexapdf/font/encoding/mac_roman_encoding.rb +1 -1
- data/lib/hexapdf/font/encoding/standard_encoding.rb +1 -1
- data/lib/hexapdf/font/encoding/symbol_encoding.rb +1 -1
- data/lib/hexapdf/font/encoding/win_ansi_encoding.rb +1 -1
- data/lib/hexapdf/font/encoding/zapf_dingbats_encoding.rb +1 -1
- data/lib/hexapdf/font/encoding.rb +1 -1
- data/lib/hexapdf/font/invalid_glyph.rb +1 -1
- data/lib/hexapdf/font/true_type/builder.rb +2 -2
- data/lib/hexapdf/font/true_type/font.rb +1 -1
- data/lib/hexapdf/font/true_type/optimizer.rb +1 -1
- data/lib/hexapdf/font/true_type/subsetter.rb +1 -1
- data/lib/hexapdf/font/true_type/table/cmap.rb +1 -1
- data/lib/hexapdf/font/true_type/table/cmap_subtable.rb +1 -1
- data/lib/hexapdf/font/true_type/table/directory.rb +1 -1
- data/lib/hexapdf/font/true_type/table/glyf.rb +1 -1
- data/lib/hexapdf/font/true_type/table/head.rb +1 -1
- data/lib/hexapdf/font/true_type/table/hhea.rb +1 -1
- data/lib/hexapdf/font/true_type/table/hmtx.rb +1 -1
- data/lib/hexapdf/font/true_type/table/kern.rb +1 -1
- data/lib/hexapdf/font/true_type/table/loca.rb +1 -1
- data/lib/hexapdf/font/true_type/table/maxp.rb +1 -1
- data/lib/hexapdf/font/true_type/table/name.rb +1 -1
- data/lib/hexapdf/font/true_type/table/os2.rb +1 -1
- data/lib/hexapdf/font/true_type/table/post.rb +1 -1
- data/lib/hexapdf/font/true_type/table.rb +1 -1
- data/lib/hexapdf/font/true_type.rb +1 -1
- data/lib/hexapdf/font/true_type_wrapper.rb +1 -1
- data/lib/hexapdf/font/type1/afm_parser.rb +1 -1
- data/lib/hexapdf/font/type1/character_metrics.rb +1 -1
- data/lib/hexapdf/font/type1/font.rb +2 -2
- data/lib/hexapdf/font/type1/font_metrics.rb +1 -1
- data/lib/hexapdf/font/type1/pfb_parser.rb +1 -1
- data/lib/hexapdf/font/type1.rb +1 -1
- data/lib/hexapdf/font/type1_wrapper.rb +2 -2
- data/lib/hexapdf/font_loader/from_configuration.rb +1 -1
- data/lib/hexapdf/font_loader/from_file.rb +1 -1
- data/lib/hexapdf/font_loader/standard14.rb +1 -1
- data/lib/hexapdf/font_loader.rb +1 -1
- data/lib/hexapdf/image_loader/jpeg.rb +1 -1
- data/lib/hexapdf/image_loader/pdf.rb +1 -1
- data/lib/hexapdf/image_loader/png.rb +1 -1
- data/lib/hexapdf/image_loader.rb +1 -1
- data/lib/hexapdf/importer.rb +1 -1
- data/lib/hexapdf/layout/box.rb +4 -4
- data/lib/hexapdf/layout/box_fitter.rb +1 -1
- data/lib/hexapdf/layout/column_box.rb +1 -1
- data/lib/hexapdf/layout/container_box.rb +4 -4
- data/lib/hexapdf/layout/frame.rb +1 -1
- data/lib/hexapdf/layout/image_box.rb +1 -1
- data/lib/hexapdf/layout/inline_box.rb +1 -1
- data/lib/hexapdf/layout/line.rb +1 -1
- data/lib/hexapdf/layout/list_box.rb +18 -17
- data/lib/hexapdf/layout/numeric_refinements.rb +1 -1
- data/lib/hexapdf/layout/page_style.rb +1 -1
- data/lib/hexapdf/layout/style.rb +1 -1
- data/lib/hexapdf/layout/table_box.rb +4 -4
- data/lib/hexapdf/layout/text_box.rb +1 -1
- data/lib/hexapdf/layout/text_fragment.rb +1 -1
- data/lib/hexapdf/layout/text_layouter.rb +1 -1
- data/lib/hexapdf/layout/text_shaper.rb +1 -1
- data/lib/hexapdf/layout/width_from_polygon.rb +1 -1
- data/lib/hexapdf/layout.rb +1 -1
- data/lib/hexapdf/name_tree_node.rb +1 -1
- data/lib/hexapdf/number_tree_node.rb +1 -1
- data/lib/hexapdf/object.rb +3 -3
- data/lib/hexapdf/parser.rb +1 -1
- data/lib/hexapdf/pdf_array.rb +1 -1
- data/lib/hexapdf/rectangle.rb +1 -1
- data/lib/hexapdf/reference.rb +1 -1
- data/lib/hexapdf/revision.rb +1 -1
- data/lib/hexapdf/revisions.rb +1 -1
- data/lib/hexapdf/serializer.rb +1 -1
- data/lib/hexapdf/stream.rb +1 -1
- data/lib/hexapdf/task/dereference.rb +1 -1
- data/lib/hexapdf/task/optimize.rb +1 -1
- data/lib/hexapdf/task/pdfa.rb +87 -0
- data/lib/hexapdf/task.rb +2 -1
- data/lib/hexapdf/test_utils.rb +1 -1
- data/lib/hexapdf/tokenizer.rb +1 -1
- data/lib/hexapdf/type/acro_form/appearance_generator.rb +5 -5
- data/lib/hexapdf/type/acro_form/button_field.rb +1 -1
- data/lib/hexapdf/type/acro_form/choice_field.rb +12 -2
- data/lib/hexapdf/type/acro_form/field.rb +1 -1
- data/lib/hexapdf/type/acro_form/form.rb +2 -1
- data/lib/hexapdf/type/acro_form/signature_field.rb +1 -1
- data/lib/hexapdf/type/acro_form/text_field.rb +1 -1
- data/lib/hexapdf/type/acro_form/variable_text_field.rb +8 -5
- data/lib/hexapdf/type/acro_form.rb +1 -1
- data/lib/hexapdf/type/action.rb +1 -1
- data/lib/hexapdf/type/actions/go_to.rb +1 -1
- data/lib/hexapdf/type/actions/go_to_r.rb +1 -1
- data/lib/hexapdf/type/actions/launch.rb +1 -1
- data/lib/hexapdf/type/actions/set_ocg_state.rb +1 -1
- data/lib/hexapdf/type/actions/uri.rb +1 -1
- data/lib/hexapdf/type/actions.rb +1 -1
- data/lib/hexapdf/type/annotation.rb +2 -2
- data/lib/hexapdf/type/annotations/link.rb +1 -1
- data/lib/hexapdf/type/annotations/markup_annotation.rb +1 -1
- data/lib/hexapdf/type/annotations/text.rb +1 -1
- data/lib/hexapdf/type/annotations/widget.rb +1 -1
- data/lib/hexapdf/type/annotations.rb +1 -1
- data/lib/hexapdf/type/catalog.rb +1 -1
- data/lib/hexapdf/type/cid_font.rb +1 -1
- data/lib/hexapdf/type/embedded_file.rb +1 -1
- data/lib/hexapdf/type/file_specification.rb +1 -1
- data/lib/hexapdf/type/font.rb +1 -1
- data/lib/hexapdf/type/font_descriptor.rb +1 -1
- data/lib/hexapdf/type/font_simple.rb +1 -1
- data/lib/hexapdf/type/font_true_type.rb +1 -1
- data/lib/hexapdf/type/font_type0.rb +2 -2
- data/lib/hexapdf/type/font_type1.rb +1 -1
- data/lib/hexapdf/type/font_type3.rb +1 -1
- data/lib/hexapdf/type/form.rb +16 -16
- data/lib/hexapdf/type/graphics_state_parameter.rb +1 -1
- data/lib/hexapdf/type/icon_fit.rb +1 -1
- data/lib/hexapdf/type/image.rb +1 -1
- data/lib/hexapdf/type/info.rb +1 -1
- data/lib/hexapdf/type/mark_information.rb +1 -1
- data/lib/hexapdf/type/metadata.rb +1 -1
- data/lib/hexapdf/type/names.rb +1 -1
- data/lib/hexapdf/type/object_stream.rb +1 -1
- data/lib/hexapdf/type/optional_content_configuration.rb +5 -5
- data/lib/hexapdf/type/optional_content_group.rb +17 -1
- data/lib/hexapdf/type/optional_content_membership.rb +1 -1
- data/lib/hexapdf/type/optional_content_properties.rb +3 -4
- data/lib/hexapdf/type/outline.rb +1 -1
- data/lib/hexapdf/type/outline_item.rb +1 -1
- data/lib/hexapdf/type/output_intent.rb +85 -0
- data/lib/hexapdf/type/page.rb +30 -15
- data/lib/hexapdf/type/page_label.rb +1 -1
- data/lib/hexapdf/type/page_tree_node.rb +1 -1
- data/lib/hexapdf/type/resources.rb +1 -1
- data/lib/hexapdf/type/trailer.rb +1 -1
- data/lib/hexapdf/type/viewer_preferences.rb +1 -1
- data/lib/hexapdf/type/xref_stream.rb +1 -1
- data/lib/hexapdf/type.rb +2 -1
- data/lib/hexapdf/utils/bit_field.rb +1 -1
- data/lib/hexapdf/utils/bit_stream.rb +1 -1
- data/lib/hexapdf/utils/graphics_helpers.rb +1 -1
- data/lib/hexapdf/utils/lru_cache.rb +1 -1
- data/lib/hexapdf/utils/math_helpers.rb +1 -1
- data/lib/hexapdf/utils/object_hash.rb +1 -1
- data/lib/hexapdf/utils/pdf_doc_encoding.rb +1 -1
- data/lib/hexapdf/utils/sorted_tree_node.rb +1 -1
- data/lib/hexapdf/utils.rb +3 -3
- data/lib/hexapdf/version.rb +2 -2
- data/lib/hexapdf/writer.rb +1 -1
- data/lib/hexapdf/xref_section.rb +1 -1
- data/lib/hexapdf.rb +1 -1
- data/test/hexapdf/content/test_canvas.rb +1 -1
- data/test/hexapdf/digital_signature/common.rb +1 -1
- data/test/hexapdf/document/test_layout.rb +15 -2
- data/test/hexapdf/document/test_metadata.rb +85 -30
- data/test/hexapdf/encryption/test_standard_security_handler.rb +9 -9
- data/test/hexapdf/font/true_type/table/test_cmap_subtable.rb +2 -2
- data/test/hexapdf/font/true_type/table/test_name.rb +5 -5
- data/test/hexapdf/layout/test_box.rb +2 -2
- data/test/hexapdf/layout/test_column_box.rb +5 -5
- data/test/hexapdf/layout/test_frame.rb +4 -5
- data/test/hexapdf/layout/test_list_box.rb +20 -0
- data/test/hexapdf/layout/test_text_fragment.rb +1 -1
- data/test/hexapdf/layout/test_text_shaper.rb +2 -2
- data/test/hexapdf/task/test_pdfa.rb +41 -0
- data/test/hexapdf/test_composer.rb +1 -1
- data/test/hexapdf/test_utils.rb +1 -1
- data/test/hexapdf/test_writer.rb +2 -2
- data/test/hexapdf/type/acro_form/test_choice_field.rb +7 -0
- data/test/hexapdf/type/acro_form/test_form.rb +6 -0
- data/test/hexapdf/type/acro_form/test_variable_text_field.rb +12 -0
- data/test/hexapdf/type/test_annotation.rb +1 -1
- data/test/hexapdf/type/test_optional_content_group.rb +2 -2
- data/test/hexapdf/type/test_optional_content_properties.rb +2 -2
- data/test/hexapdf/type/test_page.rb +67 -38
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b6df8bc8bdf189f60287c3dc0a0eccb1e1bca2a8b4310c1d5c2bb5d6661bae11
|
4
|
+
data.tar.gz: a28fc9d3319f596774bda74476fbc77fe40ba8e29a2dcd1e588c18f0928e8538
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11a382eceaa702705fe15484314e8d8b21c26ce2bf50d082be5e4ae27749251562474bfe1f4d410e53008120b37b6f43b42b1f9ecaca0ce123a672a6868a0515
|
7
|
+
data.tar.gz: ef98043f0d6460bbfd4819ba34fd2fab4d9e7426b04d0005f1f65ae88d813ff92db6f9cb89cb3e88997c8b68dea7e7631ceb873f5091a6c1b8bd6aa72075ab32
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,43 @@
|
|
1
|
+
## 0.38.0 - 2024-03-10
|
2
|
+
|
3
|
+
### Added
|
4
|
+
|
5
|
+
* [HexaPDF::Task::PDFA] for creating PDF/A conforming PDF files
|
6
|
+
* [HexaPDF::Type::OutputIntent] for defining output intents
|
7
|
+
* [HexaPDF::Document::Metadata#delete] for deleting metadata properties
|
8
|
+
* PDF/A metadata properties definitions
|
9
|
+
* Added a /Name entry to the default optional content configuration dictionary
|
10
|
+
(needed by PDF/A)
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
|
14
|
+
* Default language for XMP metadata from English to 'x-default'
|
15
|
+
* [HexaPDF::Layout::ListBox] to use the style's font for drawing markers and to
|
16
|
+
fall back to Times and ZapfDingbats if necessary
|
17
|
+
* [HexaPDF::Document::Layout#table_box] to merge the `:cell` keys that define
|
18
|
+
the cell style instead of using the last one
|
19
|
+
* [HexaPDF::Document::Layout] style retrieval to fall back to using the font of
|
20
|
+
the `:base` style and only if that doesn't exist to 'Times'
|
21
|
+
* XMP metadata stream contents to satisfy more PDF/A validators
|
22
|
+
|
23
|
+
|
24
|
+
## 0.37.2 - 2024-02-27
|
25
|
+
|
26
|
+
### Fixed
|
27
|
+
|
28
|
+
* Type of /TransformParams field in signature reference dictionary
|
29
|
+
* [HexaPDF::Type::Page#box] to intersect the requested box with the media box
|
30
|
+
* Validation of [HexaPDF::Type::Annotation] to resolve PDF reference before
|
31
|
+
access
|
32
|
+
* [HexaPDF::Type::Page#flatten_annotations] to work in case of duplicate
|
33
|
+
annotations
|
34
|
+
* [HexaPDF::Type::AcroForm::Form#each_field] to gracefully handle null values
|
35
|
+
* [HexaPDF::Type::AcroForm::AppearanceGenerator] to take an appearance string
|
36
|
+
set on a widget instead of a field into account
|
37
|
+
* [HexaPDF::Type::AcroForm::ChoiceField] to take PDFs where the /Opt key is set
|
38
|
+
on the widgets into account
|
39
|
+
|
40
|
+
|
1
41
|
## 0.37.1 - 2024-02-05
|
2
42
|
|
3
43
|
### Fixed
|
data/LICENSE
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
2
|
-
Copyright (C) 2014-
|
2
|
+
Copyright (C) 2014-2024 Thomas Leitner
|
3
3
|
|
4
4
|
HexaPDF is free software: you can redistribute it and/or modify it
|
5
5
|
under the terms of the GNU Affero General Public License version 3 as
|
data/README.md
CHANGED
@@ -47,19 +47,19 @@ section](#License) for details.
|
|
47
47
|
* [`hexapdf` binary][hp] for most common PDF manipulation tasks
|
48
48
|
|
49
49
|
|
50
|
-
[canvas API]: https://hexapdf.gettalong.org/documentation/
|
51
|
-
[document composition engine]: https://hexapdf.gettalong.org/documentation/
|
50
|
+
[canvas API]: https://hexapdf.gettalong.org/documentation/api/HexaPDF/Content/Canvas.html
|
51
|
+
[document composition engine]: https://hexapdf.gettalong.org/documentation/document-creation/document-layout.html
|
52
52
|
[flowing text]: https://hexapdf.gettalong.org/examples/frame_text_flow.html
|
53
|
-
[styles]: https://hexapdf.gettalong.org/documentation/
|
54
|
-
[(un)ordered lists]: https://hexapdf.gettalong.org/documentation/
|
55
|
-
[multi-column layout]: https://hexapdf.gettalong.org/documentation/
|
56
|
-
[PDF forms]: https://hexapdf.gettalong.org/documentation/
|
57
|
-
[Document outline]: https://hexapdf.gettalong.org/documentation/
|
58
|
-
[attaching files]: https://hexapdf.gettalong.org/documentation/
|
59
|
-
[Encryption]: https://hexapdf.gettalong.org/documentation/
|
60
|
-
[Digital Signatures]: https://hexapdf.gettalong.org/documentation/
|
53
|
+
[styles]: https://hexapdf.gettalong.org/documentation/api/HexaPDF/Layout/Style/index.html
|
54
|
+
[(un)ordered lists]: https://hexapdf.gettalong.org/documentation/api/HexaPDF/Layout/ListBox.html
|
55
|
+
[multi-column layout]: https://hexapdf.gettalong.org/documentation/api/HexaPDF/Layout/ColumnBox.html
|
56
|
+
[PDF forms]: https://hexapdf.gettalong.org/documentation/interactive-forms/index.html
|
57
|
+
[Document outline]: https://hexapdf.gettalong.org/documentation/outline/index.html
|
58
|
+
[attaching files]: https://hexapdf.gettalong.org/documentation/api/HexaPDF/Document/Files.html
|
59
|
+
[Encryption]: https://hexapdf.gettalong.org/documentation/encryption/index.html
|
60
|
+
[Digital Signatures]: https://hexapdf.gettalong.org/documentation/digital-signatures/index.html
|
61
61
|
[File size optimization]: https://hexapdf.gettalong.org/documentation/benchmarks/optimization.html
|
62
|
-
[hp]: https://hexapdf.gettalong.org/documentation/
|
62
|
+
[hp]: https://hexapdf.gettalong.org/documentation/hexapdf.1.html
|
63
63
|
|
64
64
|
|
65
65
|
## Usage
|
@@ -126,7 +126,7 @@ featureful API when it comes to creating content, for individual pages as well a
|
|
126
126
|
If you want to migrate from Prawn to HexaPDF, there is the [migration guide] with detailed
|
127
127
|
information and examples, comparing the Prawn API to HexaPDF's equivalents.
|
128
128
|
|
129
|
-
[migration guide]: https://hexapdf.gettalong.org/documentation/
|
129
|
+
[migration guide]: https://hexapdf.gettalong.org/documentation/document-creation/migrating-from-prawn.html
|
130
130
|
|
131
131
|
Why use HexaPDF?
|
132
132
|
|
@@ -145,9 +145,10 @@ Why use HexaPDF?
|
|
145
145
|
manipulating PDFs. This tool is intended to be a replacement for tools like `pdftk` and the
|
146
146
|
various Poppler-based tools like `pdfinfo`, `pdfimages`, ...
|
147
147
|
|
148
|
-
[Prawn]:
|
148
|
+
[Prawn]: https://prawnpdf.org
|
149
149
|
[page canvas API]: https://hexapdf.gettalong.org/api/HexaPDF/Content/Canvas.html
|
150
150
|
|
151
|
+
|
151
152
|
## Development
|
152
153
|
|
153
154
|
Clone the repository and then run `rake dev:setup`. This will install the needed Rubygem
|
@@ -178,6 +179,9 @@ Some included files have a different license:
|
|
178
179
|
* The AES test vector files in `test/data/aes-test-vectors` have been created using the test vector
|
179
180
|
file available from <http://csrc.nist.gov/groups/STM/cavp/block-ciphers.html#test-vectors>.
|
180
181
|
|
182
|
+
* The license of the file `data/hexapdf/sRGB2014.icc` is available in the
|
183
|
+
`data/hexapdf/sRGB2014.icc.LICENSE` file.
|
184
|
+
|
181
185
|
|
182
186
|
## Contributing
|
183
187
|
|
Binary file
|
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2015 International Color Consortium
|
2
|
+
|
3
|
+
This profile is made available by the International Color Consortium,
|
4
|
+
and may be copied, distributed, embedded, made, used, and sold without
|
5
|
+
restriction. Altered versions of this profile shall have the original
|
6
|
+
identification and copyright information removed and shall not be
|
7
|
+
misrepresented as the original profile.
|
@@ -0,0 +1,89 @@
|
|
1
|
+
# # PDF/A Compliance
|
2
|
+
#
|
3
|
+
# This example shows how to create a PDF file that is PDF/A compliant.
|
4
|
+
#
|
5
|
+
# In this case we are creating a simple invoice, with multiple line
|
6
|
+
# items that break across the page boundary.
|
7
|
+
#
|
8
|
+
# Usage:
|
9
|
+
# : `ruby pdfa.rb`
|
10
|
+
#
|
11
|
+
require 'hexapdf'
|
12
|
+
|
13
|
+
HexaPDF::Composer.create('pdfa.pdf') do |composer|
|
14
|
+
composer.document.task(:pdfa)
|
15
|
+
composer.document.config['font.map'] = {
|
16
|
+
'Lato' => {
|
17
|
+
none: '/usr/share/fonts/truetype/lato/Lato-Regular.ttf',
|
18
|
+
bold: '/usr/share/fonts/truetype/lato/Lato-Bold.ttf',
|
19
|
+
italic: '/usr/share/fonts/truetype/lato/Lato-Italic.ttf',
|
20
|
+
bold_italic: '/usr/share/fonts/truetype/lato/Lato-BoldItalic.ttf',
|
21
|
+
},
|
22
|
+
}
|
23
|
+
|
24
|
+
company = {
|
25
|
+
name: 'Sample Corp Limited',
|
26
|
+
address: ["Example Avenue 1", "12345 Runway"],
|
27
|
+
}
|
28
|
+
|
29
|
+
# Define all styles
|
30
|
+
composer.style(:base, font: 'Lato', font_size: 10, line_spacing: 1.3)
|
31
|
+
composer.style(:top, font_size: 8)
|
32
|
+
composer.style(:top_box, padding: [100, 0, 0], margin: [0, 0, 10], border: {width: [0, 0, 1]})
|
33
|
+
composer.style(:header, font: ['Lato', variant: :bold], font_size: 20, margin: [50, 0, 20])
|
34
|
+
composer.style(:line_items, border: {width: 1, color: "eee"}, margin: [20, 0])
|
35
|
+
composer.style(:line_item_cell, font_size: 8)
|
36
|
+
composer.style(:footer, border: {width: [1, 0, 0], color: "darkgrey"},
|
37
|
+
padding: [5, 0, 0], valign: :bottom)
|
38
|
+
composer.style(:footer_heading, font: ['Lato', variant: :bold],
|
39
|
+
font_size: 8, padding: [0, 0, 8])
|
40
|
+
composer.style(:footer_text, font_size: 8, fill_color: "darkgrey")
|
41
|
+
|
42
|
+
# Top part
|
43
|
+
composer.box(:container, style: :top_box) do |container|
|
44
|
+
container.formatted_text([{text: company[:name], font: ['Lato', variant: :bold]},
|
45
|
+
" - " + company[:address].join(' - ')], style: :top)
|
46
|
+
end
|
47
|
+
composer.text("Mega Client\nSmall Lane 5\n67890 Noonestown", mask_mode: :box)
|
48
|
+
cells = [["Invoice number:", "2024/01"],
|
49
|
+
["Invoice date", "2024-03-10"],
|
50
|
+
["Service date:", "2024-02-01"]]
|
51
|
+
composer.table(cells, column_widths: [150, 80], style: {align: :right}) do |args|
|
52
|
+
args[] = {cell: {border: {width: 0}, padding: 2}, text_align: :right}
|
53
|
+
args[0..-1, 0] = {font: ['Lato', variant: :bold]}
|
54
|
+
end
|
55
|
+
|
56
|
+
# Middle part
|
57
|
+
composer.text("Invoice - 2024/01", style: :header)
|
58
|
+
composer.text("Thank you for your order. Following are the items you purchased:")
|
59
|
+
|
60
|
+
cells = [["Description", "Price", "Amount", "Total"]]
|
61
|
+
max = 40
|
62
|
+
1.upto(max) do |index|
|
63
|
+
cells << ["Sample Item E.g. #{index}", "€ 250,00", index, "€ #{250 * index},00"]
|
64
|
+
end
|
65
|
+
cells << [nil, nil, nil, "€ #{250 * max * (max + 1) / 2},00"]
|
66
|
+
composer.table(cells, column_widths: [250, 80], style: :line_items) do |args|
|
67
|
+
args[] = {cell: {border: {width: 0}, padding: 8}, style: :line_item_cell}
|
68
|
+
args[0] = {cell: {background_color: "eee"}, font: ["Lato", variant: :bold]}
|
69
|
+
args[-1] = {cell: {background_color: "eee", border: {width: [2, 0, 0]}},
|
70
|
+
font: ["Lato", variant: :bold]}
|
71
|
+
args[0..-1, 1..-1] = {text_align: :right}
|
72
|
+
end
|
73
|
+
|
74
|
+
composer.text("Please transfer the total amount via SEPA transfer to the bank " \
|
75
|
+
"account below immediately after receiving the invoice - thank you.")
|
76
|
+
|
77
|
+
# Bottom part
|
78
|
+
l = composer.document.layout
|
79
|
+
cells = [
|
80
|
+
[l.text(company[:name], style: :footer_heading),
|
81
|
+
l.text(company[:address].join("\n"), style: :footer_text)],
|
82
|
+
[l.text('Contact', style: :footer_heading),
|
83
|
+
l.text("owner@samplecorp.com\nOwner: Me, Myself, And I", style: :footer_text)],
|
84
|
+
[l.text('Bank Account', style: :footer_heading),
|
85
|
+
l.text("Sample Corp Bank\nIBAN: SC01 2345 6789 0123 4567\nBIC: SACOZZB123",
|
86
|
+
style: :footer_text)],
|
87
|
+
]
|
88
|
+
composer.table([cells], cell_style: {border: {width: 0}}, style: :footer)
|
89
|
+
end
|
data/lib/hexapdf/cli/batch.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/command.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/files.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/fonts.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/form.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/images.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/info.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/inspect.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/merge.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/modify.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/optimize.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli/split.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/cli.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/composer.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -568,6 +568,7 @@ module HexaPDF
|
|
568
568
|
'task.map' => {
|
569
569
|
optimize: 'HexaPDF::Task::Optimize',
|
570
570
|
dereference: 'HexaPDF::Task::Dereference',
|
571
|
+
pdfa: 'HexaPDF::Task::PDFA',
|
571
572
|
})
|
572
573
|
|
573
574
|
# The global configuration object, providing the following options:
|
@@ -653,8 +654,7 @@ module HexaPDF
|
|
653
654
|
Action: 'HexaPDF::Type::Action',
|
654
655
|
XXLaunchActionWinParameters: 'HexaPDF::Type::Actions::Launch::WinParameters',
|
655
656
|
Annot: 'HexaPDF::Type::Annotation',
|
656
|
-
XXAppearanceCharacteristics:
|
657
|
-
'HexaPDF::Type::Annotations::Widget::AppearanceCharacteristics',
|
657
|
+
XXAppearanceCharacteristics: 'HexaPDF::Type::Annotations::Widget::AppearanceCharacteristics',
|
658
658
|
XXIconFit: 'HexaPDF::Type::IconFit',
|
659
659
|
XXAcroForm: 'HexaPDF::Type::AcroForm::Form',
|
660
660
|
XXAcroFormField: 'HexaPDF::Type::AcroForm::Field',
|
@@ -689,6 +689,8 @@ module HexaPDF
|
|
689
689
|
XXCIDSystemInfo: 'HexaPDF::Type::CIDFont::CIDSystemInfo',
|
690
690
|
Group: 'HexaPDF::Type::Form::Group',
|
691
691
|
Metadata: 'HexaPDF::Type::Metadata',
|
692
|
+
OutputIntent: 'HexaPDF::Type::OutputIntent',
|
693
|
+
XXDestOutputProfileRef: 'HexaPDF::Type::OutputIntent::DestOutputProfileRef',
|
692
694
|
},
|
693
695
|
'object.subtype_map' => {
|
694
696
|
nil => {
|
@@ -707,7 +709,10 @@ module HexaPDF
|
|
707
709
|
Text: 'HexaPDF::Type::Annotations::Text',
|
708
710
|
Link: 'HexaPDF::Type::Annotations::Link',
|
709
711
|
Widget: 'HexaPDF::Type::Annotations::Widget',
|
710
|
-
XML: 'HexaPDF::Type::Metadata'
|
712
|
+
XML: 'HexaPDF::Type::Metadata',
|
713
|
+
GTS_PDFX: 'HexaPDF::Type::OutputIntent',
|
714
|
+
GTS_PDFA1: 'HexaPDF::Type::OutputIntent',
|
715
|
+
ISO_PDFE1: 'HexaPDF::Type::OutputIntent',
|
711
716
|
},
|
712
717
|
XObject: {
|
713
718
|
Image: 'HexaPDF::Type::Image',
|
@@ -739,6 +744,11 @@ module HexaPDF
|
|
739
744
|
Ch: 'HexaPDF::Type::AcroForm::ChoiceField',
|
740
745
|
Sig: 'HexaPDF::Type::AcroForm::SignatureField',
|
741
746
|
},
|
747
|
+
OutputIntent: {
|
748
|
+
GTS_PDFX: 'HexaPDF::Type::OutputIntent',
|
749
|
+
GTS_PDFA1: 'HexaPDF::Type::OutputIntent',
|
750
|
+
ISO_PDFE1: 'HexaPDF::Type::OutputIntent',
|
751
|
+
},
|
742
752
|
})
|
743
753
|
|
744
754
|
end
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -2571,7 +2571,7 @@ module HexaPDF
|
|
2571
2571
|
# See #optional_content for details.
|
2572
2572
|
#
|
2573
2573
|
# See: PDF2.0 s8.11
|
2574
|
-
alias
|
2574
|
+
alias end_optional_content end_marked_content_sequence
|
2575
2575
|
|
2576
2576
|
# :call-seq:
|
2577
2577
|
# canvas.composer(margin: 0) {|composer| block } -> composer
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -424,9 +424,9 @@ module HexaPDF
|
|
424
424
|
scaled_word_space = (font.word_spacing_applicable? ? graphics_state.scaled_word_spacing : 0)
|
425
425
|
scaled_font_size = graphics_state.scaled_font_size
|
426
426
|
|
427
|
-
below_baseline = font.bounding_box[1] * scaled_font_size /
|
427
|
+
below_baseline = font.bounding_box[1] * scaled_font_size /
|
428
428
|
graphics_state.scaled_horizontal_scaling + graphics_state.text_rise
|
429
|
-
above_baseline = font.bounding_box[3] * scaled_font_size /
|
429
|
+
above_baseline = font.bounding_box[3] * scaled_font_size /
|
430
430
|
graphics_state.scaled_horizontal_scaling + graphics_state.text_rise
|
431
431
|
|
432
432
|
text = CompositeBox.new
|
@@ -436,7 +436,7 @@ module HexaPDF
|
|
436
436
|
else
|
437
437
|
font.decode(item).each do |code_point|
|
438
438
|
char = font.to_utf8(code_point)
|
439
|
-
width = font.width(code_point) * scaled_font_size + scaled_char_space +
|
439
|
+
width = font.width(code_point) * scaled_font_size + scaled_char_space +
|
440
440
|
(code_point == 32 ? scaled_word_space : 0)
|
441
441
|
matrix = graphics_state.ctm.dup.premultiply(*graphics_state.tm)
|
442
442
|
fragment = GlyphBox.new(code_point, char,
|
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
@@ -160,8 +160,8 @@ module HexaPDF
|
|
160
160
|
|
161
161
|
# Returns +true+ if the other object is a transformation matrix with the same values.
|
162
162
|
def ==(other)
|
163
|
-
|
164
|
-
@d == other.d && @e == other.e && @f == other.f
|
163
|
+
other.kind_of?(self.class) && @a == other.a && @b == other.b && @c == other.c &&
|
164
|
+
@d == other.d && @e == other.e && @f == other.f
|
165
165
|
end
|
166
166
|
|
167
167
|
# Creates an array [a, b, c, d, e, f] from the transformation matrix.
|
data/lib/hexapdf/content.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|
data/lib/hexapdf/data_dir.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# This file is part of HexaPDF.
|
5
5
|
#
|
6
6
|
# HexaPDF - A Versatile PDF Creation and Manipulation Library For Ruby
|
7
|
-
# Copyright (C) 2014-
|
7
|
+
# Copyright (C) 2014-2024 Thomas Leitner
|
8
8
|
#
|
9
9
|
# HexaPDF is free software: you can redistribute it and/or modify it
|
10
10
|
# under the terms of the GNU Affero General Public License version 3 as
|