hexapdf 0.17.1 → 0.17.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1024 -0
- data/LICENSE +29 -0
- data/README.md +129 -0
- data/Rakefile +109 -0
- data/agpl-3.0.txt +661 -0
- data/examples/001-hello_world.rb +16 -0
- data/examples/002-graphics.rb +275 -0
- data/examples/003-arcs.rb +50 -0
- data/examples/004-optimizing.rb +23 -0
- data/examples/005-merging.rb +27 -0
- data/examples/006-standard_pdf_fonts.rb +73 -0
- data/examples/007-truetype.rb +42 -0
- data/examples/008-show_char_bboxes.rb +55 -0
- data/examples/009-text_layouter_alignment.rb +47 -0
- data/examples/010-text_layouter_inline_boxes.rb +64 -0
- data/examples/011-text_layouter_line_wrapping.rb +57 -0
- data/examples/012-text_layouter_styling.rb +122 -0
- data/examples/013-text_layouter_shapes.rb +176 -0
- data/examples/014-text_in_polygon.rb +60 -0
- data/examples/015-boxes.rb +76 -0
- data/examples/016-frame_automatic_box_placement.rb +90 -0
- data/examples/017-frame_text_flow.rb +60 -0
- data/examples/018-composer.rb +44 -0
- data/examples/019-acro_form.rb +88 -0
- data/examples/emoji-smile.png +0 -0
- data/examples/emoji-wink.png +0 -0
- data/examples/machupicchu.jpg +0 -0
- data/lib/hexapdf/content/graphic_object/endpoint_arc.rb +66 -0
- data/lib/hexapdf/content/graphic_object/geom2d.rb +13 -0
- data/lib/hexapdf/version.rb +1 -1
- data/test/data/aes-test-vectors/CBCGFSbox-128-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCGFSbox-128-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCGFSbox-192-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCGFSbox-192-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCGFSbox-256-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCGFSbox-256-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCKeySbox-128-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCKeySbox-128-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCKeySbox-192-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCKeySbox-192-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCKeySbox-256-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCKeySbox-256-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarKey-128-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarKey-128-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarKey-192-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarKey-192-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarKey-256-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarKey-256-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarTxt-128-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarTxt-128-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarTxt-192-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarTxt-192-encrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarTxt-256-decrypt.data.gz +0 -0
- data/test/data/aes-test-vectors/CBCVarTxt-256-encrypt.data.gz +0 -0
- data/test/data/fonts/Ubuntu-Title.ttf +0 -0
- data/test/data/images/cmyk.jpg +0 -0
- data/test/data/images/fillbytes.jpg +0 -0
- data/test/data/images/gray.jpg +0 -0
- data/test/data/images/greyscale-1bit.png +0 -0
- data/test/data/images/greyscale-2bit.png +0 -0
- data/test/data/images/greyscale-4bit.png +0 -0
- data/test/data/images/greyscale-8bit.png +0 -0
- data/test/data/images/greyscale-alpha-8bit.png +0 -0
- data/test/data/images/greyscale-trns-8bit.png +0 -0
- data/test/data/images/greyscale-with-gamma1.0.png +0 -0
- data/test/data/images/greyscale-with-gamma1.5.png +0 -0
- data/test/data/images/indexed-1bit.png +0 -0
- data/test/data/images/indexed-2bit.png +0 -0
- data/test/data/images/indexed-4bit.png +0 -0
- data/test/data/images/indexed-8bit.png +0 -0
- data/test/data/images/indexed-alpha-4bit.png +0 -0
- data/test/data/images/indexed-alpha-8bit.png +0 -0
- data/test/data/images/rgb.jpg +0 -0
- data/test/data/images/truecolour-8bit.png +0 -0
- data/test/data/images/truecolour-alpha-8bit.png +0 -0
- data/test/data/images/truecolour-gama-chrm-8bit.png +0 -0
- data/test/data/images/truecolour-srgb-8bit.png +0 -0
- data/test/data/images/ycck.jpg +0 -0
- data/test/data/minimal.pdf +44 -0
- data/test/data/standard-security-handler/README +9 -0
- data/test/data/standard-security-handler/bothpwd-aes-128bit-V4.pdf +44 -0
- data/test/data/standard-security-handler/bothpwd-aes-256bit-V5.pdf +0 -0
- data/test/data/standard-security-handler/bothpwd-arc4-128bit-V2.pdf +43 -0
- data/test/data/standard-security-handler/bothpwd-arc4-128bit-V4.pdf +43 -0
- data/test/data/standard-security-handler/bothpwd-arc4-40bit-V1.pdf +0 -0
- data/test/data/standard-security-handler/nopwd-aes-128bit-V4.pdf +43 -0
- data/test/data/standard-security-handler/nopwd-aes-256bit-V5.pdf +0 -0
- data/test/data/standard-security-handler/nopwd-arc4-128bit-V2.pdf +43 -0
- data/test/data/standard-security-handler/nopwd-arc4-128bit-V4.pdf +43 -0
- data/test/data/standard-security-handler/nopwd-arc4-40bit-V1.pdf +43 -0
- data/test/data/standard-security-handler/ownerpwd-aes-128bit-V4.pdf +0 -0
- data/test/data/standard-security-handler/ownerpwd-aes-256bit-V5.pdf +43 -0
- data/test/data/standard-security-handler/ownerpwd-arc4-128bit-V2.pdf +43 -0
- data/test/data/standard-security-handler/ownerpwd-arc4-128bit-V4.pdf +43 -0
- data/test/data/standard-security-handler/ownerpwd-arc4-40bit-V1.pdf +43 -0
- data/test/data/standard-security-handler/userpwd-aes-128bit-V4.pdf +43 -0
- data/test/data/standard-security-handler/userpwd-aes-256bit-V5.pdf +43 -0
- data/test/data/standard-security-handler/userpwd-arc4-128bit-V2.pdf +0 -0
- data/test/data/standard-security-handler/userpwd-arc4-128bit-V4.pdf +0 -0
- data/test/data/standard-security-handler/userpwd-arc4-40bit-V1.pdf +43 -0
- data/test/hexapdf/common_tokenizer_tests.rb +236 -0
- data/test/hexapdf/content/common.rb +39 -0
- data/test/hexapdf/content/graphic_object/test_arc.rb +102 -0
- data/test/hexapdf/content/graphic_object/test_endpoint_arc.rb +90 -0
- data/test/hexapdf/content/graphic_object/test_geom2d.rb +79 -0
- data/test/hexapdf/content/graphic_object/test_solid_arc.rb +86 -0
- data/test/hexapdf/content/test_canvas.rb +1279 -0
- data/test/hexapdf/content/test_color_space.rb +176 -0
- data/test/hexapdf/content/test_graphics_state.rb +151 -0
- data/test/hexapdf/content/test_operator.rb +619 -0
- data/test/hexapdf/content/test_parser.rb +99 -0
- data/test/hexapdf/content/test_processor.rb +163 -0
- data/test/hexapdf/content/test_transformation_matrix.rb +64 -0
- data/test/hexapdf/document/test_files.rb +72 -0
- data/test/hexapdf/document/test_fonts.rb +60 -0
- data/test/hexapdf/document/test_images.rb +72 -0
- data/test/hexapdf/document/test_pages.rb +130 -0
- data/test/hexapdf/encryption/common.rb +87 -0
- data/test/hexapdf/encryption/test_aes.rb +129 -0
- data/test/hexapdf/encryption/test_arc4.rb +39 -0
- data/test/hexapdf/encryption/test_fast_aes.rb +17 -0
- data/test/hexapdf/encryption/test_fast_arc4.rb +12 -0
- data/test/hexapdf/encryption/test_identity.rb +21 -0
- data/test/hexapdf/encryption/test_ruby_aes.rb +23 -0
- data/test/hexapdf/encryption/test_ruby_arc4.rb +20 -0
- data/test/hexapdf/encryption/test_security_handler.rb +380 -0
- data/test/hexapdf/encryption/test_standard_security_handler.rb +322 -0
- data/test/hexapdf/filter/common.rb +53 -0
- data/test/hexapdf/filter/test_ascii85_decode.rb +59 -0
- data/test/hexapdf/filter/test_ascii_hex_decode.rb +38 -0
- data/test/hexapdf/filter/test_crypt.rb +21 -0
- data/test/hexapdf/filter/test_encryption.rb +24 -0
- data/test/hexapdf/filter/test_flate_decode.rb +44 -0
- data/test/hexapdf/filter/test_lzw_decode.rb +52 -0
- data/test/hexapdf/filter/test_predictor.rb +219 -0
- data/test/hexapdf/filter/test_run_length_decode.rb +32 -0
- data/test/hexapdf/font/cmap/test_parser.rb +102 -0
- data/test/hexapdf/font/cmap/test_writer.rb +66 -0
- data/test/hexapdf/font/encoding/test_base.rb +45 -0
- data/test/hexapdf/font/encoding/test_difference_encoding.rb +29 -0
- data/test/hexapdf/font/encoding/test_glyph_list.rb +59 -0
- data/test/hexapdf/font/encoding/test_zapf_dingbats_encoding.rb +16 -0
- data/test/hexapdf/font/test_cmap.rb +104 -0
- data/test/hexapdf/font/test_encoding.rb +27 -0
- data/test/hexapdf/font/test_invalid_glyph.rb +34 -0
- data/test/hexapdf/font/test_true_type_wrapper.rb +186 -0
- data/test/hexapdf/font/test_type1_wrapper.rb +107 -0
- data/test/hexapdf/font/true_type/common.rb +17 -0
- data/test/hexapdf/font/true_type/table/common.rb +27 -0
- data/test/hexapdf/font/true_type/table/test_cmap.rb +47 -0
- data/test/hexapdf/font/true_type/table/test_cmap_subtable.rb +141 -0
- data/test/hexapdf/font/true_type/table/test_directory.rb +30 -0
- data/test/hexapdf/font/true_type/table/test_glyf.rb +58 -0
- data/test/hexapdf/font/true_type/table/test_head.rb +56 -0
- data/test/hexapdf/font/true_type/table/test_hhea.rb +26 -0
- data/test/hexapdf/font/true_type/table/test_hmtx.rb +30 -0
- data/test/hexapdf/font/true_type/table/test_kern.rb +61 -0
- data/test/hexapdf/font/true_type/table/test_loca.rb +33 -0
- data/test/hexapdf/font/true_type/table/test_maxp.rb +50 -0
- data/test/hexapdf/font/true_type/table/test_name.rb +76 -0
- data/test/hexapdf/font/true_type/table/test_os2.rb +55 -0
- data/test/hexapdf/font/true_type/table/test_post.rb +78 -0
- data/test/hexapdf/font/true_type/test_builder.rb +42 -0
- data/test/hexapdf/font/true_type/test_font.rb +116 -0
- data/test/hexapdf/font/true_type/test_optimizer.rb +26 -0
- data/test/hexapdf/font/true_type/test_subsetter.rb +73 -0
- data/test/hexapdf/font/true_type/test_table.rb +48 -0
- data/test/hexapdf/font/type1/common.rb +6 -0
- data/test/hexapdf/font/type1/test_afm_parser.rb +65 -0
- data/test/hexapdf/font/type1/test_font.rb +104 -0
- data/test/hexapdf/font/type1/test_font_metrics.rb +22 -0
- data/test/hexapdf/font/type1/test_pfb_parser.rb +37 -0
- data/test/hexapdf/font_loader/test_from_configuration.rb +43 -0
- data/test/hexapdf/font_loader/test_from_file.rb +36 -0
- data/test/hexapdf/font_loader/test_standard14.rb +33 -0
- data/test/hexapdf/image_loader/test_jpeg.rb +93 -0
- data/test/hexapdf/image_loader/test_pdf.rb +47 -0
- data/test/hexapdf/image_loader/test_png.rb +259 -0
- data/test/hexapdf/layout/test_box.rb +154 -0
- data/test/hexapdf/layout/test_frame.rb +350 -0
- data/test/hexapdf/layout/test_image_box.rb +73 -0
- data/test/hexapdf/layout/test_inline_box.rb +71 -0
- data/test/hexapdf/layout/test_line.rb +206 -0
- data/test/hexapdf/layout/test_style.rb +790 -0
- data/test/hexapdf/layout/test_text_box.rb +140 -0
- data/test/hexapdf/layout/test_text_fragment.rb +375 -0
- data/test/hexapdf/layout/test_text_layouter.rb +758 -0
- data/test/hexapdf/layout/test_text_shaper.rb +62 -0
- data/test/hexapdf/layout/test_width_from_polygon.rb +109 -0
- data/test/hexapdf/task/test_dereference.rb +51 -0
- data/test/hexapdf/task/test_optimize.rb +162 -0
- data/test/hexapdf/test_composer.rb +258 -0
- data/test/hexapdf/test_configuration.rb +93 -0
- data/test/hexapdf/test_data_dir.rb +32 -0
- data/test/hexapdf/test_dictionary.rb +340 -0
- data/test/hexapdf/test_dictionary_fields.rb +269 -0
- data/test/hexapdf/test_document.rb +641 -0
- data/test/hexapdf/test_filter.rb +100 -0
- data/test/hexapdf/test_importer.rb +106 -0
- data/test/hexapdf/test_object.rb +258 -0
- data/test/hexapdf/test_parser.rb +645 -0
- data/test/hexapdf/test_pdf_array.rb +169 -0
- data/test/hexapdf/test_rectangle.rb +73 -0
- data/test/hexapdf/test_reference.rb +50 -0
- data/test/hexapdf/test_revision.rb +188 -0
- data/test/hexapdf/test_revisions.rb +196 -0
- data/test/hexapdf/test_serializer.rb +195 -0
- data/test/hexapdf/test_stream.rb +274 -0
- data/test/hexapdf/test_tokenizer.rb +80 -0
- data/test/hexapdf/test_type.rb +18 -0
- data/test/hexapdf/test_writer.rb +140 -0
- data/test/hexapdf/test_xref_section.rb +61 -0
- data/test/hexapdf/type/acro_form/test_appearance_generator.rb +795 -0
- data/test/hexapdf/type/acro_form/test_button_field.rb +308 -0
- data/test/hexapdf/type/acro_form/test_choice_field.rb +220 -0
- data/test/hexapdf/type/acro_form/test_field.rb +259 -0
- data/test/hexapdf/type/acro_form/test_form.rb +357 -0
- data/test/hexapdf/type/acro_form/test_signature_field.rb +38 -0
- data/test/hexapdf/type/acro_form/test_text_field.rb +201 -0
- data/test/hexapdf/type/acro_form/test_variable_text_field.rb +88 -0
- data/test/hexapdf/type/actions/test_launch.rb +24 -0
- data/test/hexapdf/type/actions/test_uri.rb +23 -0
- data/test/hexapdf/type/annotations/test_markup_annotation.rb +22 -0
- data/test/hexapdf/type/annotations/test_text.rb +34 -0
- data/test/hexapdf/type/annotations/test_widget.rb +225 -0
- data/test/hexapdf/type/test_annotation.rb +97 -0
- data/test/hexapdf/type/test_catalog.rb +48 -0
- data/test/hexapdf/type/test_cid_font.rb +61 -0
- data/test/hexapdf/type/test_file_specification.rb +141 -0
- data/test/hexapdf/type/test_font.rb +67 -0
- data/test/hexapdf/type/test_font_descriptor.rb +61 -0
- data/test/hexapdf/type/test_font_simple.rb +176 -0
- data/test/hexapdf/type/test_font_true_type.rb +31 -0
- data/test/hexapdf/type/test_font_type0.rb +120 -0
- data/test/hexapdf/type/test_font_type1.rb +142 -0
- data/test/hexapdf/type/test_font_type3.rb +26 -0
- data/test/hexapdf/type/test_form.rb +120 -0
- data/test/hexapdf/type/test_image.rb +261 -0
- data/test/hexapdf/type/test_info.rb +9 -0
- data/test/hexapdf/type/test_object_stream.rb +117 -0
- data/test/hexapdf/type/test_page.rb +598 -0
- data/test/hexapdf/type/test_page_tree_node.rb +315 -0
- data/test/hexapdf/type/test_resources.rb +209 -0
- data/test/hexapdf/type/test_trailer.rb +116 -0
- data/test/hexapdf/type/test_xref_stream.rb +143 -0
- data/test/hexapdf/utils/test_bit_field.rb +63 -0
- data/test/hexapdf/utils/test_bit_stream.rb +69 -0
- data/test/hexapdf/utils/test_graphics_helpers.rb +37 -0
- data/test/hexapdf/utils/test_lru_cache.rb +22 -0
- data/test/hexapdf/utils/test_object_hash.rb +120 -0
- data/test/hexapdf/utils/test_pdf_doc_encoding.rb +18 -0
- data/test/hexapdf/utils/test_sorted_tree_node.rb +239 -0
- data/test/test_helper.rb +58 -0
- metadata +263 -3
@@ -0,0 +1,239 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
require 'test_helper'
|
4
|
+
require 'hexapdf/document'
|
5
|
+
require 'hexapdf/name_tree_node'
|
6
|
+
require 'hexapdf/number_tree_node'
|
7
|
+
|
8
|
+
describe HexaPDF::Utils::SortedTreeNode do
|
9
|
+
before do
|
10
|
+
@doc = HexaPDF::Document.new
|
11
|
+
@root = @doc.add({}, type: HexaPDF::NameTreeNode)
|
12
|
+
end
|
13
|
+
|
14
|
+
def add_multilevel_entries
|
15
|
+
@kid11 = @doc.add({Limits: ['c', 'f'], Names: ['c', 1, 'f', 1]}, type: HexaPDF::NameTreeNode)
|
16
|
+
@kid12 = @doc.add({Limits: ['i', 'm'], Names: ['i', 1, 'm', 1]}, type: HexaPDF::NameTreeNode)
|
17
|
+
ref = HexaPDF::Reference.new(@kid11.oid, @kid11.gen)
|
18
|
+
@kid1 = @doc.add({Limits: ['c', 'm'], Kids: [ref, @kid12]}, type: HexaPDF::NameTreeNode)
|
19
|
+
@kid21 = @doc.add({Limits: ['o', 'q'], Names: ['o', 1, 'q', 1]}, type: HexaPDF::NameTreeNode)
|
20
|
+
@kid221 = @doc.add({Limits: ['s', 'u'], Names: ['s', 1, 'u', 1]}, type: HexaPDF::NameTreeNode)
|
21
|
+
@kid22 = @doc.add({Limits: ['s', 'u'], Kids: [@kid221]}, type: HexaPDF::NameTreeNode)
|
22
|
+
@kid2 = @doc.add({Limits: ['o', 'u'], Kids: [@kid21, @kid22]}, type: HexaPDF::NameTreeNode)
|
23
|
+
@root[:Kids] = [@kid1, @kid2]
|
24
|
+
end
|
25
|
+
|
26
|
+
it "must always be indirect" do
|
27
|
+
assert(@root.must_be_indirect?)
|
28
|
+
end
|
29
|
+
|
30
|
+
describe "add" do
|
31
|
+
it "works with the root node alone" do
|
32
|
+
@root.add_entry('c', 1)
|
33
|
+
@root.add_entry('a', 2)
|
34
|
+
@root.add_entry('e', 3)
|
35
|
+
assert_equal(['a', 2, 'c', 1, 'e', 3], @root[:Names].value)
|
36
|
+
refute(@root[:Limits])
|
37
|
+
end
|
38
|
+
|
39
|
+
it "replaces an existing entry if overwrite is true" do
|
40
|
+
assert(@root.add_entry('a', 2))
|
41
|
+
assert(@root.add_entry('a', 5))
|
42
|
+
assert_equal(['a', 5], @root[:Names].value)
|
43
|
+
end
|
44
|
+
|
45
|
+
it "doesn't replace an existing entry if overwrite is false" do
|
46
|
+
assert(@root.add_entry('a', 2))
|
47
|
+
refute(@root.add_entry('a', 5, overwrite: false))
|
48
|
+
assert_equal(['a', 2], @root[:Names].value)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "works with one level of intermediate nodes" do
|
52
|
+
kid1 = HexaPDF::NameTreeNode.new({Limits: ['m', 'm'], Names: ['m', 1]}, document: @doc)
|
53
|
+
kid2 = HexaPDF::NameTreeNode.new({Limits: ['t', 't'], Names: ['t', 1]}, document: @doc)
|
54
|
+
@root[:Kids] = [kid1, kid2]
|
55
|
+
@root.add_entry('c', 1)
|
56
|
+
@root.add_entry('d', 1)
|
57
|
+
@root.add_entry('p', 1)
|
58
|
+
@root.add_entry('r', 1)
|
59
|
+
@root.add_entry('u', 1)
|
60
|
+
assert_equal(['c', 'm'], kid1[:Limits].value)
|
61
|
+
assert_equal(['c', 1, 'd', 1, 'm', 1], kid1[:Names].value)
|
62
|
+
assert_equal(['p', 'u'], kid2[:Limits].value)
|
63
|
+
assert_equal(['p', 1, 'r', 1, 't', 1, 'u', 1], kid2[:Names].value)
|
64
|
+
end
|
65
|
+
|
66
|
+
it "works with multiple levels of intermediate nodes" do
|
67
|
+
add_multilevel_entries
|
68
|
+
@root.add_entry('a', 1)
|
69
|
+
@root.add_entry('e', 1)
|
70
|
+
@root.add_entry('g', 1)
|
71
|
+
@root.add_entry('j', 1)
|
72
|
+
@root.add_entry('n', 1)
|
73
|
+
@root.add_entry('p', 1)
|
74
|
+
@root.add_entry('r', 1)
|
75
|
+
@root.add_entry('v', 1)
|
76
|
+
assert_equal(['a', 'm'], @kid1[:Limits].value)
|
77
|
+
assert_equal(['a', 'f'], @kid11[:Limits].value)
|
78
|
+
assert_equal(['a', 1, 'c', 1, 'e', 1, 'f', 1], @kid11[:Names].value)
|
79
|
+
assert_equal(['g', 'm'], @kid12[:Limits].value)
|
80
|
+
assert_equal(['g', 1, 'i', 1, 'j', 1, 'm', 1], @kid12[:Names].value)
|
81
|
+
assert_equal(['n', 'v'], @kid2[:Limits].value)
|
82
|
+
assert_equal(['n', 'q'], @kid21[:Limits].value)
|
83
|
+
assert_equal(['n', 1, 'o', 1, 'p', 1, 'q', 1], @kid21[:Names].value)
|
84
|
+
assert_equal(['r', 'v'], @kid22[:Limits].value)
|
85
|
+
assert_equal(['r', 'v'], @kid221[:Limits].value)
|
86
|
+
assert_equal(['r', 1, 's', 1, 'u', 1, 'v', 1], @kid221[:Names].value)
|
87
|
+
end
|
88
|
+
|
89
|
+
it "splits nodes if needed" do
|
90
|
+
@doc.config['sorted_tree.max_leaf_node_size'] = 4
|
91
|
+
%w[a c e m k i g d b l j f h].each {|key| @root.add_entry(key, 1) }
|
92
|
+
refute(@root.value.key?(:Limits))
|
93
|
+
refute(@root.value.key?(:Names))
|
94
|
+
assert_equal(6, @root[:Kids].size)
|
95
|
+
assert_equal(['a', 1, 'b', 1], @root[:Kids][0][:Names].value)
|
96
|
+
assert_equal(['a', 'b'], @root[:Kids][0][:Limits].value)
|
97
|
+
assert_equal(['c', 1, 'd', 1], @root[:Kids][1][:Names].value)
|
98
|
+
assert_equal(['c', 'd'], @root[:Kids][1][:Limits].value)
|
99
|
+
assert_equal(['e', 1, 'f', 1], @root[:Kids][2][:Names].value)
|
100
|
+
assert_equal(['e', 'f'], @root[:Kids][2][:Limits].value)
|
101
|
+
assert_equal(['g', 1, 'h', 1, 'i', 1], @root[:Kids][3][:Names].value)
|
102
|
+
assert_equal(['g', 'i'], @root[:Kids][3][:Limits].value)
|
103
|
+
assert_equal(['j', 1, 'k', 1], @root[:Kids][4][:Names].value)
|
104
|
+
assert_equal(['j', 'k'], @root[:Kids][4][:Limits].value)
|
105
|
+
assert_equal(['l', 1, 'm', 1], @root[:Kids][5][:Names].value)
|
106
|
+
assert_equal(['l', 'm'], @root[:Kids][5][:Limits].value)
|
107
|
+
end
|
108
|
+
|
109
|
+
it "fails if not called on the root node" do
|
110
|
+
@root[:Limits] = ['a', 'c']
|
111
|
+
assert_raises(HexaPDF::Error) { @root.add_entry('b', 1) }
|
112
|
+
end
|
113
|
+
|
114
|
+
it "fails if the key is not a string" do
|
115
|
+
assert_raises(ArgumentError) { @root.add_entry(5, 1) }
|
116
|
+
end
|
117
|
+
end
|
118
|
+
|
119
|
+
describe "find" do
|
120
|
+
it "finds the correct entry" do
|
121
|
+
add_multilevel_entries
|
122
|
+
assert_equal(1, @root.find_entry('i'))
|
123
|
+
assert_equal(1, @root.find_entry('q'))
|
124
|
+
end
|
125
|
+
|
126
|
+
it "automatically dereferences the entry's value" do
|
127
|
+
add_multilevel_entries
|
128
|
+
obj = @doc.add(1)
|
129
|
+
@kid11[:Names][1] = HexaPDF::Reference.new(obj.oid, obj.gen)
|
130
|
+
assert_equal(1, @root.find_entry('c'))
|
131
|
+
end
|
132
|
+
|
133
|
+
it "returns nil for non-existing entries" do
|
134
|
+
add_multilevel_entries
|
135
|
+
assert_nil(@root.find_entry('non'))
|
136
|
+
end
|
137
|
+
|
138
|
+
it "works when no entry exists" do
|
139
|
+
assert_nil(@root.find_entry('non'))
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
describe "delete" do
|
144
|
+
it "works with only the root node" do
|
145
|
+
%w[a b c d e f g].each {|name| @root.add_entry(name, 1) }
|
146
|
+
%w[g b a unknown e d c].each {|name| @root.delete_entry(name) }
|
147
|
+
refute(@root.key?(:Kids))
|
148
|
+
refute(@root.key?(:Limits))
|
149
|
+
assert_equal(['f', 1], @root[:Names].value)
|
150
|
+
assert_equal(1, @root.delete_entry('f'))
|
151
|
+
end
|
152
|
+
|
153
|
+
it "works with multiple levels of intermediate nodes" do
|
154
|
+
add_multilevel_entries
|
155
|
+
%w[c f i m unknown o q s u].each {|name| @root.delete_entry(name) }
|
156
|
+
refute(@root.value.key?(:Names))
|
157
|
+
refute(@root.value.key?(:Limits))
|
158
|
+
assert(@root[:Kids].empty?)
|
159
|
+
end
|
160
|
+
|
161
|
+
it "works on an uninitalized tree" do
|
162
|
+
assert_nil(@root.delete_entry('non'))
|
163
|
+
end
|
164
|
+
|
165
|
+
it "fails if not called on the root node" do
|
166
|
+
@root[:Limits] = ['a', 'c']
|
167
|
+
assert_raises(HexaPDF::Error) { @root.delete_entry('b') }
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
describe "each" do
|
172
|
+
it "enumerates in the key-value pairs in sorted order" do
|
173
|
+
add_multilevel_entries
|
174
|
+
assert_equal(['c', 1, 'f', 1, 'i', 1, 'm', 1, 'o', 1, 'q', 1, 's', 1, 'u', 1],
|
175
|
+
@root.each_entry.to_a.flatten)
|
176
|
+
end
|
177
|
+
|
178
|
+
it "automatically dereferences the yielded values" do
|
179
|
+
add_multilevel_entries
|
180
|
+
obj = @doc.add(1)
|
181
|
+
@kid11[:Names][1] = HexaPDF::Reference.new(obj.oid, obj.gen)
|
182
|
+
assert_equal(['c', 1, 'f', 1], @kid11.each_entry.to_a.flatten)
|
183
|
+
end
|
184
|
+
|
185
|
+
it "works on an uninitalized tree" do
|
186
|
+
assert_equal([], @root.each_entry.to_a)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
describe "perform_validation" do
|
191
|
+
before do
|
192
|
+
add_multilevel_entries
|
193
|
+
end
|
194
|
+
|
195
|
+
it "checks that all kid objects are indirect objects" do
|
196
|
+
@root[:Kids][0] = ref = HexaPDF::Reference.new(@kid1.oid, @kid1.gen)
|
197
|
+
assert(@root.validate)
|
198
|
+
|
199
|
+
@root[:Kids][0] = ref
|
200
|
+
@kid1.oid = 0
|
201
|
+
assert(@root.validate do |message, c|
|
202
|
+
assert_match(/must be indirect objects/, message)
|
203
|
+
assert(c)
|
204
|
+
end)
|
205
|
+
assert(@kid1.indirect?)
|
206
|
+
end
|
207
|
+
|
208
|
+
it "checks that leaf node containers have an even number of entries" do
|
209
|
+
@kid11[:Names].delete_at(0)
|
210
|
+
refute(@kid11.validate do |message, c|
|
211
|
+
assert_match(/odd number/, message)
|
212
|
+
refute(c)
|
213
|
+
end)
|
214
|
+
end
|
215
|
+
|
216
|
+
it "checks that the keys are of the correct type" do
|
217
|
+
@kid11[:Names][2] = 5
|
218
|
+
refute(@kid11.validate do |message, c|
|
219
|
+
assert_match(/must be a String object/, message)
|
220
|
+
refute(c)
|
221
|
+
end)
|
222
|
+
end
|
223
|
+
|
224
|
+
it "checks that the keys are correctly sorted" do
|
225
|
+
@kid11[:Names][2] = 'a'
|
226
|
+
refute(@kid11.validate do |message, c|
|
227
|
+
assert_match(/not correctly sorted/, message)
|
228
|
+
refute(c)
|
229
|
+
end)
|
230
|
+
end
|
231
|
+
end
|
232
|
+
|
233
|
+
it "works equally well with a NumberTreeNode" do
|
234
|
+
root = HexaPDF::NumberTreeNode.new({}, document: @doc)
|
235
|
+
root.add_entry(2, 1)
|
236
|
+
root.add_entry(1, 2)
|
237
|
+
assert_equal([1, 2, 2, 1], root[:Nums].value)
|
238
|
+
end
|
239
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'simplecov'
|
5
|
+
SimpleCov.start do
|
6
|
+
add_filter '/test/'
|
7
|
+
end
|
8
|
+
rescue LoadError
|
9
|
+
end
|
10
|
+
|
11
|
+
gem 'minitest'
|
12
|
+
require 'minitest/autorun'
|
13
|
+
require 'fiber'
|
14
|
+
require 'zlib'
|
15
|
+
|
16
|
+
TEST_DATA_DIR = File.join(__dir__, 'data')
|
17
|
+
MINIMAL_PDF = File.read(File.join(TEST_DATA_DIR, 'minimal.pdf')).freeze
|
18
|
+
|
19
|
+
Minitest::Test.make_my_diffs_pretty!
|
20
|
+
|
21
|
+
module TestHelper
|
22
|
+
|
23
|
+
# Asserts that the method +name+ of +object+ gets invoked with the +expected_values+ when
|
24
|
+
# executing the block. +expected_values+ should contain arrays of arguments, one array for each
|
25
|
+
# invocation of the method.
|
26
|
+
def assert_method_invoked(object, name, *expected_values, check_block: false)
|
27
|
+
args = []
|
28
|
+
block = []
|
29
|
+
object.define_singleton_method(name) {|*la, &lb| args << la; block << lb }
|
30
|
+
yield
|
31
|
+
assert_equal(expected_values, args, "Incorrect arguments for #{object.class}##{name}")
|
32
|
+
block.each do |block_arg|
|
33
|
+
assert_kind_of(Proc, block_arg, "Missing block for #{object.class}##{name}") if check_block
|
34
|
+
end
|
35
|
+
ensure
|
36
|
+
object.singleton_class.send(:remove_method, name)
|
37
|
+
end
|
38
|
+
|
39
|
+
module_function
|
40
|
+
|
41
|
+
def feeder(string, len = string.length)
|
42
|
+
Fiber.new do
|
43
|
+
until string.empty?
|
44
|
+
Fiber.yield(string.slice!(0, len).force_encoding('BINARY'))
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def collector(source)
|
50
|
+
str = ''.force_encoding('BINARY')
|
51
|
+
while source.alive? && (data = source.resume)
|
52
|
+
str << data
|
53
|
+
end
|
54
|
+
str
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
Minitest::Spec.include(TestHelper)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hexapdf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thomas Leitner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cmdparse
|
@@ -86,13 +86,28 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: '1.0'
|
89
|
-
description:
|
89
|
+
description: |
|
90
|
+
HexaPDF is a pure Ruby library with an accompanying application for working with PDF
|
91
|
+
files.
|
92
|
+
|
93
|
+
In short, it allows creating new PDF files, manipulating existing PDF files, merging multiple
|
94
|
+
PDF files into one, extracting meta information, text, images and files from PDF files, securing
|
95
|
+
PDF files by encrypting them and optimizing PDF files for smaller file size or other
|
96
|
+
criteria.
|
97
|
+
|
98
|
+
HexaPDF was designed with ease of use and performance in mind. It uses lazy loading and lazy
|
99
|
+
computing when possible and tries to produce small PDF files by default.
|
90
100
|
email: t_leitner@gmx.at
|
91
101
|
executables:
|
92
102
|
- hexapdf
|
93
103
|
extensions: []
|
94
104
|
extra_rdoc_files: []
|
95
105
|
files:
|
106
|
+
- CHANGELOG.md
|
107
|
+
- LICENSE
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
110
|
+
- agpl-3.0.txt
|
96
111
|
- bin/hexapdf
|
97
112
|
- data/hexapdf/afm/Courier-Bold.afm
|
98
113
|
- data/hexapdf/afm/Courier-BoldOblique.afm
|
@@ -178,6 +193,28 @@ files:
|
|
178
193
|
- data/hexapdf/cmap/V
|
179
194
|
- data/hexapdf/encoding/glyphlist.txt
|
180
195
|
- data/hexapdf/encoding/zapfdingbats.txt
|
196
|
+
- examples/001-hello_world.rb
|
197
|
+
- examples/002-graphics.rb
|
198
|
+
- examples/003-arcs.rb
|
199
|
+
- examples/004-optimizing.rb
|
200
|
+
- examples/005-merging.rb
|
201
|
+
- examples/006-standard_pdf_fonts.rb
|
202
|
+
- examples/007-truetype.rb
|
203
|
+
- examples/008-show_char_bboxes.rb
|
204
|
+
- examples/009-text_layouter_alignment.rb
|
205
|
+
- examples/010-text_layouter_inline_boxes.rb
|
206
|
+
- examples/011-text_layouter_line_wrapping.rb
|
207
|
+
- examples/012-text_layouter_styling.rb
|
208
|
+
- examples/013-text_layouter_shapes.rb
|
209
|
+
- examples/014-text_in_polygon.rb
|
210
|
+
- examples/015-boxes.rb
|
211
|
+
- examples/016-frame_automatic_box_placement.rb
|
212
|
+
- examples/017-frame_text_flow.rb
|
213
|
+
- examples/018-composer.rb
|
214
|
+
- examples/019-acro_form.rb
|
215
|
+
- examples/emoji-smile.png
|
216
|
+
- examples/emoji-wink.png
|
217
|
+
- examples/machupicchu.jpg
|
181
218
|
- lib/hexapdf.rb
|
182
219
|
- lib/hexapdf/cli.rb
|
183
220
|
- lib/hexapdf/cli/batch.rb
|
@@ -373,6 +410,229 @@ files:
|
|
373
410
|
- lib/hexapdf/version.rb
|
374
411
|
- lib/hexapdf/writer.rb
|
375
412
|
- lib/hexapdf/xref_section.rb
|
413
|
+
- test/data/aes-test-vectors/CBCGFSbox-128-decrypt.data.gz
|
414
|
+
- test/data/aes-test-vectors/CBCGFSbox-128-encrypt.data.gz
|
415
|
+
- test/data/aes-test-vectors/CBCGFSbox-192-decrypt.data.gz
|
416
|
+
- test/data/aes-test-vectors/CBCGFSbox-192-encrypt.data.gz
|
417
|
+
- test/data/aes-test-vectors/CBCGFSbox-256-decrypt.data.gz
|
418
|
+
- test/data/aes-test-vectors/CBCGFSbox-256-encrypt.data.gz
|
419
|
+
- test/data/aes-test-vectors/CBCKeySbox-128-decrypt.data.gz
|
420
|
+
- test/data/aes-test-vectors/CBCKeySbox-128-encrypt.data.gz
|
421
|
+
- test/data/aes-test-vectors/CBCKeySbox-192-decrypt.data.gz
|
422
|
+
- test/data/aes-test-vectors/CBCKeySbox-192-encrypt.data.gz
|
423
|
+
- test/data/aes-test-vectors/CBCKeySbox-256-decrypt.data.gz
|
424
|
+
- test/data/aes-test-vectors/CBCKeySbox-256-encrypt.data.gz
|
425
|
+
- test/data/aes-test-vectors/CBCVarKey-128-decrypt.data.gz
|
426
|
+
- test/data/aes-test-vectors/CBCVarKey-128-encrypt.data.gz
|
427
|
+
- test/data/aes-test-vectors/CBCVarKey-192-decrypt.data.gz
|
428
|
+
- test/data/aes-test-vectors/CBCVarKey-192-encrypt.data.gz
|
429
|
+
- test/data/aes-test-vectors/CBCVarKey-256-decrypt.data.gz
|
430
|
+
- test/data/aes-test-vectors/CBCVarKey-256-encrypt.data.gz
|
431
|
+
- test/data/aes-test-vectors/CBCVarTxt-128-decrypt.data.gz
|
432
|
+
- test/data/aes-test-vectors/CBCVarTxt-128-encrypt.data.gz
|
433
|
+
- test/data/aes-test-vectors/CBCVarTxt-192-decrypt.data.gz
|
434
|
+
- test/data/aes-test-vectors/CBCVarTxt-192-encrypt.data.gz
|
435
|
+
- test/data/aes-test-vectors/CBCVarTxt-256-decrypt.data.gz
|
436
|
+
- test/data/aes-test-vectors/CBCVarTxt-256-encrypt.data.gz
|
437
|
+
- test/data/fonts/Ubuntu-Title.ttf
|
438
|
+
- test/data/images/cmyk.jpg
|
439
|
+
- test/data/images/fillbytes.jpg
|
440
|
+
- test/data/images/gray.jpg
|
441
|
+
- test/data/images/greyscale-1bit.png
|
442
|
+
- test/data/images/greyscale-2bit.png
|
443
|
+
- test/data/images/greyscale-4bit.png
|
444
|
+
- test/data/images/greyscale-8bit.png
|
445
|
+
- test/data/images/greyscale-alpha-8bit.png
|
446
|
+
- test/data/images/greyscale-trns-8bit.png
|
447
|
+
- test/data/images/greyscale-with-gamma1.0.png
|
448
|
+
- test/data/images/greyscale-with-gamma1.5.png
|
449
|
+
- test/data/images/indexed-1bit.png
|
450
|
+
- test/data/images/indexed-2bit.png
|
451
|
+
- test/data/images/indexed-4bit.png
|
452
|
+
- test/data/images/indexed-8bit.png
|
453
|
+
- test/data/images/indexed-alpha-4bit.png
|
454
|
+
- test/data/images/indexed-alpha-8bit.png
|
455
|
+
- test/data/images/rgb.jpg
|
456
|
+
- test/data/images/truecolour-8bit.png
|
457
|
+
- test/data/images/truecolour-alpha-8bit.png
|
458
|
+
- test/data/images/truecolour-gama-chrm-8bit.png
|
459
|
+
- test/data/images/truecolour-srgb-8bit.png
|
460
|
+
- test/data/images/ycck.jpg
|
461
|
+
- test/data/minimal.pdf
|
462
|
+
- test/data/standard-security-handler/README
|
463
|
+
- test/data/standard-security-handler/bothpwd-aes-128bit-V4.pdf
|
464
|
+
- test/data/standard-security-handler/bothpwd-aes-256bit-V5.pdf
|
465
|
+
- test/data/standard-security-handler/bothpwd-arc4-128bit-V2.pdf
|
466
|
+
- test/data/standard-security-handler/bothpwd-arc4-128bit-V4.pdf
|
467
|
+
- test/data/standard-security-handler/bothpwd-arc4-40bit-V1.pdf
|
468
|
+
- test/data/standard-security-handler/nopwd-aes-128bit-V4.pdf
|
469
|
+
- test/data/standard-security-handler/nopwd-aes-256bit-V5.pdf
|
470
|
+
- test/data/standard-security-handler/nopwd-arc4-128bit-V2.pdf
|
471
|
+
- test/data/standard-security-handler/nopwd-arc4-128bit-V4.pdf
|
472
|
+
- test/data/standard-security-handler/nopwd-arc4-40bit-V1.pdf
|
473
|
+
- test/data/standard-security-handler/ownerpwd-aes-128bit-V4.pdf
|
474
|
+
- test/data/standard-security-handler/ownerpwd-aes-256bit-V5.pdf
|
475
|
+
- test/data/standard-security-handler/ownerpwd-arc4-128bit-V2.pdf
|
476
|
+
- test/data/standard-security-handler/ownerpwd-arc4-128bit-V4.pdf
|
477
|
+
- test/data/standard-security-handler/ownerpwd-arc4-40bit-V1.pdf
|
478
|
+
- test/data/standard-security-handler/userpwd-aes-128bit-V4.pdf
|
479
|
+
- test/data/standard-security-handler/userpwd-aes-256bit-V5.pdf
|
480
|
+
- test/data/standard-security-handler/userpwd-arc4-128bit-V2.pdf
|
481
|
+
- test/data/standard-security-handler/userpwd-arc4-128bit-V4.pdf
|
482
|
+
- test/data/standard-security-handler/userpwd-arc4-40bit-V1.pdf
|
483
|
+
- test/hexapdf/common_tokenizer_tests.rb
|
484
|
+
- test/hexapdf/content/common.rb
|
485
|
+
- test/hexapdf/content/graphic_object/test_arc.rb
|
486
|
+
- test/hexapdf/content/graphic_object/test_endpoint_arc.rb
|
487
|
+
- test/hexapdf/content/graphic_object/test_geom2d.rb
|
488
|
+
- test/hexapdf/content/graphic_object/test_solid_arc.rb
|
489
|
+
- test/hexapdf/content/test_canvas.rb
|
490
|
+
- test/hexapdf/content/test_color_space.rb
|
491
|
+
- test/hexapdf/content/test_graphics_state.rb
|
492
|
+
- test/hexapdf/content/test_operator.rb
|
493
|
+
- test/hexapdf/content/test_parser.rb
|
494
|
+
- test/hexapdf/content/test_processor.rb
|
495
|
+
- test/hexapdf/content/test_transformation_matrix.rb
|
496
|
+
- test/hexapdf/document/test_files.rb
|
497
|
+
- test/hexapdf/document/test_fonts.rb
|
498
|
+
- test/hexapdf/document/test_images.rb
|
499
|
+
- test/hexapdf/document/test_pages.rb
|
500
|
+
- test/hexapdf/encryption/common.rb
|
501
|
+
- test/hexapdf/encryption/test_aes.rb
|
502
|
+
- test/hexapdf/encryption/test_arc4.rb
|
503
|
+
- test/hexapdf/encryption/test_fast_aes.rb
|
504
|
+
- test/hexapdf/encryption/test_fast_arc4.rb
|
505
|
+
- test/hexapdf/encryption/test_identity.rb
|
506
|
+
- test/hexapdf/encryption/test_ruby_aes.rb
|
507
|
+
- test/hexapdf/encryption/test_ruby_arc4.rb
|
508
|
+
- test/hexapdf/encryption/test_security_handler.rb
|
509
|
+
- test/hexapdf/encryption/test_standard_security_handler.rb
|
510
|
+
- test/hexapdf/filter/common.rb
|
511
|
+
- test/hexapdf/filter/test_ascii85_decode.rb
|
512
|
+
- test/hexapdf/filter/test_ascii_hex_decode.rb
|
513
|
+
- test/hexapdf/filter/test_crypt.rb
|
514
|
+
- test/hexapdf/filter/test_encryption.rb
|
515
|
+
- test/hexapdf/filter/test_flate_decode.rb
|
516
|
+
- test/hexapdf/filter/test_lzw_decode.rb
|
517
|
+
- test/hexapdf/filter/test_predictor.rb
|
518
|
+
- test/hexapdf/filter/test_run_length_decode.rb
|
519
|
+
- test/hexapdf/font/cmap/test_parser.rb
|
520
|
+
- test/hexapdf/font/cmap/test_writer.rb
|
521
|
+
- test/hexapdf/font/encoding/test_base.rb
|
522
|
+
- test/hexapdf/font/encoding/test_difference_encoding.rb
|
523
|
+
- test/hexapdf/font/encoding/test_glyph_list.rb
|
524
|
+
- test/hexapdf/font/encoding/test_zapf_dingbats_encoding.rb
|
525
|
+
- test/hexapdf/font/test_cmap.rb
|
526
|
+
- test/hexapdf/font/test_encoding.rb
|
527
|
+
- test/hexapdf/font/test_invalid_glyph.rb
|
528
|
+
- test/hexapdf/font/test_true_type_wrapper.rb
|
529
|
+
- test/hexapdf/font/test_type1_wrapper.rb
|
530
|
+
- test/hexapdf/font/true_type/common.rb
|
531
|
+
- test/hexapdf/font/true_type/table/common.rb
|
532
|
+
- test/hexapdf/font/true_type/table/test_cmap.rb
|
533
|
+
- test/hexapdf/font/true_type/table/test_cmap_subtable.rb
|
534
|
+
- test/hexapdf/font/true_type/table/test_directory.rb
|
535
|
+
- test/hexapdf/font/true_type/table/test_glyf.rb
|
536
|
+
- test/hexapdf/font/true_type/table/test_head.rb
|
537
|
+
- test/hexapdf/font/true_type/table/test_hhea.rb
|
538
|
+
- test/hexapdf/font/true_type/table/test_hmtx.rb
|
539
|
+
- test/hexapdf/font/true_type/table/test_kern.rb
|
540
|
+
- test/hexapdf/font/true_type/table/test_loca.rb
|
541
|
+
- test/hexapdf/font/true_type/table/test_maxp.rb
|
542
|
+
- test/hexapdf/font/true_type/table/test_name.rb
|
543
|
+
- test/hexapdf/font/true_type/table/test_os2.rb
|
544
|
+
- test/hexapdf/font/true_type/table/test_post.rb
|
545
|
+
- test/hexapdf/font/true_type/test_builder.rb
|
546
|
+
- test/hexapdf/font/true_type/test_font.rb
|
547
|
+
- test/hexapdf/font/true_type/test_optimizer.rb
|
548
|
+
- test/hexapdf/font/true_type/test_subsetter.rb
|
549
|
+
- test/hexapdf/font/true_type/test_table.rb
|
550
|
+
- test/hexapdf/font/type1/common.rb
|
551
|
+
- test/hexapdf/font/type1/test_afm_parser.rb
|
552
|
+
- test/hexapdf/font/type1/test_font.rb
|
553
|
+
- test/hexapdf/font/type1/test_font_metrics.rb
|
554
|
+
- test/hexapdf/font/type1/test_pfb_parser.rb
|
555
|
+
- test/hexapdf/font_loader/test_from_configuration.rb
|
556
|
+
- test/hexapdf/font_loader/test_from_file.rb
|
557
|
+
- test/hexapdf/font_loader/test_standard14.rb
|
558
|
+
- test/hexapdf/image_loader/test_jpeg.rb
|
559
|
+
- test/hexapdf/image_loader/test_pdf.rb
|
560
|
+
- test/hexapdf/image_loader/test_png.rb
|
561
|
+
- test/hexapdf/layout/test_box.rb
|
562
|
+
- test/hexapdf/layout/test_frame.rb
|
563
|
+
- test/hexapdf/layout/test_image_box.rb
|
564
|
+
- test/hexapdf/layout/test_inline_box.rb
|
565
|
+
- test/hexapdf/layout/test_line.rb
|
566
|
+
- test/hexapdf/layout/test_style.rb
|
567
|
+
- test/hexapdf/layout/test_text_box.rb
|
568
|
+
- test/hexapdf/layout/test_text_fragment.rb
|
569
|
+
- test/hexapdf/layout/test_text_layouter.rb
|
570
|
+
- test/hexapdf/layout/test_text_shaper.rb
|
571
|
+
- test/hexapdf/layout/test_width_from_polygon.rb
|
572
|
+
- test/hexapdf/task/test_dereference.rb
|
573
|
+
- test/hexapdf/task/test_optimize.rb
|
574
|
+
- test/hexapdf/test_composer.rb
|
575
|
+
- test/hexapdf/test_configuration.rb
|
576
|
+
- test/hexapdf/test_data_dir.rb
|
577
|
+
- test/hexapdf/test_dictionary.rb
|
578
|
+
- test/hexapdf/test_dictionary_fields.rb
|
579
|
+
- test/hexapdf/test_document.rb
|
580
|
+
- test/hexapdf/test_filter.rb
|
581
|
+
- test/hexapdf/test_importer.rb
|
582
|
+
- test/hexapdf/test_object.rb
|
583
|
+
- test/hexapdf/test_parser.rb
|
584
|
+
- test/hexapdf/test_pdf_array.rb
|
585
|
+
- test/hexapdf/test_rectangle.rb
|
586
|
+
- test/hexapdf/test_reference.rb
|
587
|
+
- test/hexapdf/test_revision.rb
|
588
|
+
- test/hexapdf/test_revisions.rb
|
589
|
+
- test/hexapdf/test_serializer.rb
|
590
|
+
- test/hexapdf/test_stream.rb
|
591
|
+
- test/hexapdf/test_tokenizer.rb
|
592
|
+
- test/hexapdf/test_type.rb
|
593
|
+
- test/hexapdf/test_writer.rb
|
594
|
+
- test/hexapdf/test_xref_section.rb
|
595
|
+
- test/hexapdf/type/acro_form/test_appearance_generator.rb
|
596
|
+
- test/hexapdf/type/acro_form/test_button_field.rb
|
597
|
+
- test/hexapdf/type/acro_form/test_choice_field.rb
|
598
|
+
- test/hexapdf/type/acro_form/test_field.rb
|
599
|
+
- test/hexapdf/type/acro_form/test_form.rb
|
600
|
+
- test/hexapdf/type/acro_form/test_signature_field.rb
|
601
|
+
- test/hexapdf/type/acro_form/test_text_field.rb
|
602
|
+
- test/hexapdf/type/acro_form/test_variable_text_field.rb
|
603
|
+
- test/hexapdf/type/actions/test_launch.rb
|
604
|
+
- test/hexapdf/type/actions/test_uri.rb
|
605
|
+
- test/hexapdf/type/annotations/test_markup_annotation.rb
|
606
|
+
- test/hexapdf/type/annotations/test_text.rb
|
607
|
+
- test/hexapdf/type/annotations/test_widget.rb
|
608
|
+
- test/hexapdf/type/test_annotation.rb
|
609
|
+
- test/hexapdf/type/test_catalog.rb
|
610
|
+
- test/hexapdf/type/test_cid_font.rb
|
611
|
+
- test/hexapdf/type/test_file_specification.rb
|
612
|
+
- test/hexapdf/type/test_font.rb
|
613
|
+
- test/hexapdf/type/test_font_descriptor.rb
|
614
|
+
- test/hexapdf/type/test_font_simple.rb
|
615
|
+
- test/hexapdf/type/test_font_true_type.rb
|
616
|
+
- test/hexapdf/type/test_font_type0.rb
|
617
|
+
- test/hexapdf/type/test_font_type1.rb
|
618
|
+
- test/hexapdf/type/test_font_type3.rb
|
619
|
+
- test/hexapdf/type/test_form.rb
|
620
|
+
- test/hexapdf/type/test_image.rb
|
621
|
+
- test/hexapdf/type/test_info.rb
|
622
|
+
- test/hexapdf/type/test_object_stream.rb
|
623
|
+
- test/hexapdf/type/test_page.rb
|
624
|
+
- test/hexapdf/type/test_page_tree_node.rb
|
625
|
+
- test/hexapdf/type/test_resources.rb
|
626
|
+
- test/hexapdf/type/test_trailer.rb
|
627
|
+
- test/hexapdf/type/test_xref_stream.rb
|
628
|
+
- test/hexapdf/utils/test_bit_field.rb
|
629
|
+
- test/hexapdf/utils/test_bit_stream.rb
|
630
|
+
- test/hexapdf/utils/test_graphics_helpers.rb
|
631
|
+
- test/hexapdf/utils/test_lru_cache.rb
|
632
|
+
- test/hexapdf/utils/test_object_hash.rb
|
633
|
+
- test/hexapdf/utils/test_pdf_doc_encoding.rb
|
634
|
+
- test/hexapdf/utils/test_sorted_tree_node.rb
|
635
|
+
- test/test_helper.rb
|
376
636
|
homepage: https://hexapdf.gettalong.org
|
377
637
|
licenses:
|
378
638
|
- AGPL-3.0
|