pdfrb 0.6.0 → 0.7.10
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 +4 -4
- data/CHANGELOG.md +144 -0
- data/RELEASE.md +52 -33
- data/data/pdfrb/afm/Courier-Bold.afm +342 -342
- data/data/pdfrb/afm/Courier-BoldOblique.afm +342 -342
- data/data/pdfrb/afm/Courier-Oblique.afm +342 -342
- data/data/pdfrb/afm/Courier.afm +342 -342
- data/data/pdfrb/afm/Helvetica-Bold.afm +2827 -2827
- data/data/pdfrb/afm/Helvetica-BoldOblique.afm +2827 -2827
- data/data/pdfrb/afm/Helvetica-Oblique.afm +3051 -3051
- data/data/pdfrb/afm/Helvetica.afm +3051 -3051
- data/data/pdfrb/afm/Symbol.afm +213 -213
- data/data/pdfrb/afm/Times-Bold.afm +2588 -2588
- data/data/pdfrb/afm/Times-BoldItalic.afm +2384 -2384
- data/data/pdfrb/afm/Times-Italic.afm +2667 -2667
- data/data/pdfrb/afm/Times-Roman.afm +2419 -2419
- data/data/pdfrb/afm/ZapfDingbats.afm +225 -225
- data/data/pdfrb/layout/hyphenation_en.txt +408 -0
- data/lib/pdfrb/color/default_profile.rb +213 -0
- data/lib/pdfrb/color/icc_validator.rb +69 -0
- data/lib/pdfrb/color.rb +2 -0
- data/lib/pdfrb/conformance/ltv.rb +112 -0
- data/lib/pdfrb/conformance/pades.rb +198 -0
- data/lib/pdfrb/conformance/pdf_2_af.rb +185 -0
- data/lib/pdfrb/conformance/pdf_a.rb +123 -0
- data/lib/pdfrb/conformance/pdf_a4_deep.rb +94 -0
- data/lib/pdfrb/conformance/pdf_ua2_deep.rb +93 -0
- data/lib/pdfrb/conformance/pdf_ua_tagging_deep.rb +125 -0
- data/lib/pdfrb/conformance/pdf_vt.rb +128 -0
- data/lib/pdfrb/conformance/pdf_x.rb +66 -1
- data/lib/pdfrb/conformance/tagged_pdf.rb +182 -0
- data/lib/pdfrb/conformance.rb +8 -0
- data/lib/pdfrb/content/canvas.rb +137 -0
- data/lib/pdfrb/content/operators/inline_image.rb +53 -0
- data/lib/pdfrb/content/operators.rb +1 -0
- data/lib/pdfrb/content/parser.rb +82 -0
- data/lib/pdfrb/digital_signature/timestamp_client.rb +86 -0
- data/lib/pdfrb/digital_signature.rb +1 -0
- data/lib/pdfrb/document.rb +29 -0
- data/lib/pdfrb/encryption/public_key_security_handler.rb +146 -0
- data/lib/pdfrb/encryption/standard_security_handler.rb +98 -3
- data/lib/pdfrb/encryption/v5_writer.rb +108 -0
- data/lib/pdfrb/encryption.rb +3 -0
- data/lib/pdfrb/font_loader/type3.rb +65 -0
- data/lib/pdfrb/font_loader.rb +1 -0
- data/lib/pdfrb/image_loader/gif.rb +246 -0
- data/lib/pdfrb/image_loader/png.rb +76 -19
- data/lib/pdfrb/image_loader/tiff.rb +257 -0
- data/lib/pdfrb/image_loader.rb +2 -0
- data/lib/pdfrb/layout/font_fallback.rb +203 -0
- data/lib/pdfrb/layout/hyphenation.rb +120 -0
- data/lib/pdfrb/layout/justification_kashidas.rb +72 -0
- data/lib/pdfrb/layout/multi_cell_text_layout.rb +65 -0
- data/lib/pdfrb/layout/multi_page_table_box.rb +155 -0
- data/lib/pdfrb/layout/polygon_frame.rb +106 -0
- data/lib/pdfrb/layout/table_box.rb +154 -23
- data/lib/pdfrb/layout/text_shaper.rb +129 -0
- data/lib/pdfrb/layout.rb +7 -0
- data/lib/pdfrb/model/type/page_piece_info.rb +58 -0
- data/lib/pdfrb/model/type.rb +3 -0
- data/lib/pdfrb/source/linearization_reader.rb +76 -0
- data/lib/pdfrb/source/recovery.rb +65 -1
- data/lib/pdfrb/source/tokenizer.rb +21 -0
- data/lib/pdfrb/source.rb +1 -0
- data/lib/pdfrb/task/regenerate_appearances.rb +98 -0
- data/lib/pdfrb/task/thumbnail.rb +133 -0
- data/lib/pdfrb/task.rb +2 -0
- data/lib/pdfrb/version.rb +1 -1
- metadata +35 -3
|
@@ -6,9 +6,23 @@ module Pdfrb
|
|
|
6
6
|
# patterns and synthesise an XrefSection from the offsets found.
|
|
7
7
|
# Triggered when the xref table is missing or points to a wrong
|
|
8
8
|
# offset.
|
|
9
|
+
#
|
|
10
|
+
# Extended recovery capabilities:
|
|
11
|
+
# * Cross-reference table reconstruction (the original mode).
|
|
12
|
+
# * Trailer recovery: find /Root and /Encrypt by scanning for
|
|
13
|
+
# the keys directly when the trailer is corrupt.
|
|
14
|
+
# * Hybrid xref detection: read both xref table and xref stream
|
|
15
|
+
# when both are present.
|
|
16
|
+
# * Object-stream reconstruction: rebuild an XrefSection from a
|
|
17
|
+
# /Type /ObjStm stream when its header is intact but the
|
|
18
|
+
# xref stream is missing.
|
|
9
19
|
module Recovery
|
|
10
20
|
OBJ_PATTERN = /(\d+)\s+(\d+)\s+obj\b/.freeze
|
|
11
|
-
|
|
21
|
+
TRAILER_ROOT_PATTERN = %r{/Root\s+(\d+)\s+(\d+)\s+R}.freeze
|
|
22
|
+
TRAILER_ENCRYPT_PATTERN = %r{/Encrypt\s+(\d+)\s+(\d+)\s+R}.freeze
|
|
23
|
+
TRAILER_INFO_PATTERN = %r{/Info\s+(\d+)\s+(\d+)\s+R}.freeze
|
|
24
|
+
private_constant :OBJ_PATTERN, :TRAILER_ROOT_PATTERN,
|
|
25
|
+
:TRAILER_ENCRYPT_PATTERN, :TRAILER_INFO_PATTERN
|
|
12
26
|
|
|
13
27
|
module_function
|
|
14
28
|
|
|
@@ -30,6 +44,56 @@ module Pdfrb
|
|
|
30
44
|
end
|
|
31
45
|
section
|
|
32
46
|
end
|
|
47
|
+
|
|
48
|
+
# Scan the file for /Root, /Info, /Encrypt references when the
|
|
49
|
+
# trailer dict is unreadable. Returns a Hash with :Root, :Info,
|
|
50
|
+
# :Encrypt keys as References (or nil per key).
|
|
51
|
+
def recover_trailer_references(io)
|
|
52
|
+
io.seek(0, IO::SEEK_SET)
|
|
53
|
+
data = io.read.to_s
|
|
54
|
+
data.force_encoding(Encoding::BINARY)
|
|
55
|
+
|
|
56
|
+
root_match = data.match(TRAILER_ROOT_PATTERN)
|
|
57
|
+
info_match = data.match(TRAILER_INFO_PATTERN)
|
|
58
|
+
encrypt_match = data.match(TRAILER_ENCRYPT_PATTERN)
|
|
59
|
+
|
|
60
|
+
{
|
|
61
|
+
Root: root_match ? Pdfrb::Model::Reference.new(root_match[1].to_i, root_match[2].to_i) : nil,
|
|
62
|
+
Info: info_match ? Pdfrb::Model::Reference.new(info_match[1].to_i, info_match[2].to_i) : nil,
|
|
63
|
+
Encrypt: encrypt_match ? Pdfrb::Model::Reference.new(encrypt_match[1].to_i, encrypt_match[2].to_i) : nil,
|
|
64
|
+
}
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Detect hybrid xref: PDF 1.7+ allows both a classical xref
|
|
68
|
+
# table AND an xref stream in the same revision, referenced
|
|
69
|
+
# from the table via /XRefStm. Returns true if the file has
|
|
70
|
+
# both. Pure-Ruby: scans for `startxref` followed by both
|
|
71
|
+
# `xref` and a Type=XRef stream object.
|
|
72
|
+
def hybrid_xref?(io)
|
|
73
|
+
io.seek(0, IO::SEEK_SET)
|
|
74
|
+
data = io.read.to_s
|
|
75
|
+
data.force_encoding(Encoding::BINARY)
|
|
76
|
+
|
|
77
|
+
has_table = data.include?("\nxref\n")
|
|
78
|
+
has_stream = data.match?(/\/Type\s*\/XRef\b/)
|
|
79
|
+
has_table && has_stream
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Reconstruct an XrefSection from a /Type /ObjStm stream by
|
|
83
|
+
# reading its /N + /First + decompressed body. Used when the
|
|
84
|
+
# outer xref stream is corrupt but a known ObjStm is intact.
|
|
85
|
+
def rebuild_from_object_stream(objstm, document)
|
|
86
|
+
return nil unless objstm
|
|
87
|
+
|
|
88
|
+
pairs = ObjectStreamReader.read(objstm, document)
|
|
89
|
+
section = XrefSection.new
|
|
90
|
+
pairs.each_key do |oid|
|
|
91
|
+
# Mark as compressed in objstm 0 (placeholder; caller
|
|
92
|
+
# fills in the real objstm_oid).
|
|
93
|
+
section.add_compressed(oid, 0, 0, objstm.oid)
|
|
94
|
+
end
|
|
95
|
+
section
|
|
96
|
+
end
|
|
33
97
|
end
|
|
34
98
|
end
|
|
35
99
|
end
|
|
@@ -52,6 +52,27 @@ module Pdfrb
|
|
|
52
52
|
self
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
+
# Whether the underlying IO is at end of stream.
|
|
56
|
+
def eof?
|
|
57
|
+
@io.eof?
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Read one byte from the underlying IO. Returns nil at EOF.
|
|
61
|
+
def read_byte
|
|
62
|
+
b = @io.getbyte
|
|
63
|
+
@pos += 1 if b
|
|
64
|
+
b
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Skip whitespace bytes (NUL, HT, LF, FF, CR, SP).
|
|
68
|
+
def skip_whitespace
|
|
69
|
+
while (b = peek_byte)
|
|
70
|
+
break unless WHITESPACE_BYTES.include?(b)
|
|
71
|
+
|
|
72
|
+
advance_byte
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
55
76
|
private
|
|
56
77
|
|
|
57
78
|
def fill_lookahead(n)
|
data/lib/pdfrb/source.rb
CHANGED
|
@@ -20,5 +20,6 @@ module Pdfrb
|
|
|
20
20
|
autoload :ObjectStreamReader, "pdfrb/source/object_stream_reader"
|
|
21
21
|
autoload :Recovery, "pdfrb/source/recovery"
|
|
22
22
|
autoload :LinearizationDetection, "pdfrb/source/linearization_detection"
|
|
23
|
+
autoload :LinearizationReader, "pdfrb/source/linearization_reader"
|
|
23
24
|
end
|
|
24
25
|
end
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pdfrb
|
|
4
|
+
module Task
|
|
5
|
+
# Walks every widget annotation in the document and regenerates
|
|
6
|
+
# the /AP /N appearance stream via Appearance::Generator. Use
|
|
7
|
+
# after mutating field values directly (e.g. via Form#set_value)
|
|
8
|
+
# or to repair documents with /NeedAppearances set so viewers
|
|
9
|
+
# don't have to synthesise appearances on the fly.
|
|
10
|
+
#
|
|
11
|
+
# Per ISO 32000-2 §12.5.5, an annotation's /AP /N is the normal
|
|
12
|
+
# appearance; PDF/A requires it for every widget. This task
|
|
13
|
+
# also clears /NeedAppearances on /AcroForm since by definition
|
|
14
|
+
# all fields now have a computed appearance.
|
|
15
|
+
module RegenerateAppearances
|
|
16
|
+
module_function
|
|
17
|
+
|
|
18
|
+
# @param document [Pdfrb::Document]
|
|
19
|
+
# @param only: [Array<Symbol>, nil] limit to the given FT values
|
|
20
|
+
# (e.g. [:Tx, :Btn]). Default: all field types.
|
|
21
|
+
# @return [Integer] count of appearances regenerated.
|
|
22
|
+
def call(document, only: nil)
|
|
23
|
+
generator = Pdfrb::Appearance::Generator.new(document)
|
|
24
|
+
widgets = each_widget(document).to_a
|
|
25
|
+
count = 0
|
|
26
|
+
widgets.each do |widget|
|
|
27
|
+
next unless matching?(widget, only)
|
|
28
|
+
|
|
29
|
+
regenerated = regenerate(generator, widget)
|
|
30
|
+
count += 1 if regenerated
|
|
31
|
+
end
|
|
32
|
+
clear_need_appearances(document)
|
|
33
|
+
count
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def each_widget(document)
|
|
37
|
+
return enum_for(:each_widget, document) unless block_given?
|
|
38
|
+
|
|
39
|
+
document.each_indirect_object do |obj|
|
|
40
|
+
next unless obj.value.is_a?(::Hash)
|
|
41
|
+
|
|
42
|
+
subtype = obj.value[:Subtype]
|
|
43
|
+
yield obj if subtype == :Widget
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def matching?(widget, only)
|
|
48
|
+
return true if only.nil?
|
|
49
|
+
|
|
50
|
+
ft = widget.value[:FT]
|
|
51
|
+
ft && only.include?(ft.to_sym)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def regenerate(generator, widget)
|
|
55
|
+
ft = widget.value[:FT]&.to_sym
|
|
56
|
+
value = widget.value[:V]
|
|
57
|
+
case ft
|
|
58
|
+
when :Tx
|
|
59
|
+
generator.text_field(widget, value: value.to_s)
|
|
60
|
+
true
|
|
61
|
+
when :Btn
|
|
62
|
+
if value.is_a?(::Hash)
|
|
63
|
+
# Multi-state radio; regenerate each state's appearance.
|
|
64
|
+
value.each_key do |state|
|
|
65
|
+
generator.checkbox(widget, checked: state != :Off)
|
|
66
|
+
end
|
|
67
|
+
else
|
|
68
|
+
generator.checkbox(widget, checked: [:Yes, true].include?(value))
|
|
69
|
+
end
|
|
70
|
+
true
|
|
71
|
+
when :Ch
|
|
72
|
+
generator.combo(widget, value: value.to_s)
|
|
73
|
+
true
|
|
74
|
+
else
|
|
75
|
+
false
|
|
76
|
+
end
|
|
77
|
+
rescue StandardError
|
|
78
|
+
# Appearance generation is best-effort; if a single field
|
|
79
|
+
# raises, skip it rather than aborting the whole sweep.
|
|
80
|
+
false
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
def clear_need_appearances(document)
|
|
84
|
+
catalog = document.catalog
|
|
85
|
+
return unless catalog
|
|
86
|
+
|
|
87
|
+
acroform = catalog.value[:AcroForm]
|
|
88
|
+
return unless acroform
|
|
89
|
+
|
|
90
|
+
if acroform.is_a?(Pdfrb::Model::Cos::Dictionary)
|
|
91
|
+
acroform.value.delete(:NeedAppearances)
|
|
92
|
+
elsif acroform.is_a?(::Hash)
|
|
93
|
+
acroform.delete(:NeedAppearances)
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
end
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Pdfrb
|
|
4
|
+
module Task
|
|
5
|
+
# Generates a low-resolution thumbnail for each page (or a single
|
|
6
|
+
# page) and attaches it via the page-level /Thumb key. PDF
|
|
7
|
+
# viewers use /Thumb to render page previews quickly without
|
|
8
|
+
# parsing the full content stream.
|
|
9
|
+
#
|
|
10
|
+
# The thumbnail is a Form XObject rendered to a small image
|
|
11
|
+
# XObject. Pure-Ruby implementation: renders only the page's text
|
|
12
|
+
# (no image / form XObject content) at the target resolution
|
|
13
|
+
# using the standard 14 AFM metrics when available, otherwise a
|
|
14
|
+
# placeholder rectangle.
|
|
15
|
+
module Thumbnail
|
|
16
|
+
DEFAULT_DPI = 72
|
|
17
|
+
DEFAULT_MAX_WIDTH = 200
|
|
18
|
+
|
|
19
|
+
module_function
|
|
20
|
+
|
|
21
|
+
# Generate thumbnails for every page in +document+. Returns the
|
|
22
|
+
# count of thumbnails added. Idempotent: existing /Thumb
|
|
23
|
+
# entries are left alone unless +force:+ is true.
|
|
24
|
+
def call(document, dpi: DEFAULT_DPI, max_width: DEFAULT_MAX_WIDTH, force: false)
|
|
25
|
+
count = 0
|
|
26
|
+
document.pages.each do |page|
|
|
27
|
+
next if page.value[:Thumb] && !force
|
|
28
|
+
|
|
29
|
+
thumb = build_thumbnail(document, page, dpi: dpi, max_width: max_width)
|
|
30
|
+
next unless thumb
|
|
31
|
+
|
|
32
|
+
page.value[:Thumb] = Pdfrb::Model::Reference.new(thumb.oid, thumb.gen)
|
|
33
|
+
count += 1
|
|
34
|
+
end
|
|
35
|
+
count
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Build a single thumbnail image XObject for +page+ at the
|
|
39
|
+
# given DPI, capped at +max_width+ pixels. Returns the image
|
|
40
|
+
# XObject or nil if the page has no media box.
|
|
41
|
+
def build_thumbnail(document, page, dpi: DEFAULT_DPI, max_width: DEFAULT_MAX_WIDTH)
|
|
42
|
+
media_box = page.value[:MediaBox]
|
|
43
|
+
return nil unless media_box.is_a?(::Array) && media_box.length == 4
|
|
44
|
+
|
|
45
|
+
width, height = page_pixel_dimensions(media_box, dpi, max_width)
|
|
46
|
+
return nil unless width.positive? && height.positive?
|
|
47
|
+
|
|
48
|
+
# Single-component grayscale image — 1 byte per pixel.
|
|
49
|
+
# White background, black "text" rectangle placeholder. Real
|
|
50
|
+
# text rendering would require running the content processor
|
|
51
|
+
# against a rasteriser; that's a much larger feature.
|
|
52
|
+
pixel_data = render_placeholder(width, height, page)
|
|
53
|
+
compressed = require_zlib.deflate(pixel_data)
|
|
54
|
+
|
|
55
|
+
image = document.add(
|
|
56
|
+
{
|
|
57
|
+
Type: :XObject, Subtype: :Image,
|
|
58
|
+
Width: width, Height: height,
|
|
59
|
+
ColorSpace: :DeviceGray,
|
|
60
|
+
BitsPerComponent: 8,
|
|
61
|
+
Filter: :FlateDecode,
|
|
62
|
+
Length: compressed.bytesize
|
|
63
|
+
},
|
|
64
|
+
type: Pdfrb::Model::Cos::Stream
|
|
65
|
+
)
|
|
66
|
+
image.stream = compressed
|
|
67
|
+
image
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Compute thumbnail pixel dimensions, capped at +max_width+.
|
|
71
|
+
def page_pixel_dimensions(media_box, dpi, max_width)
|
|
72
|
+
_x0, _y0, x1, y1 = media_box
|
|
73
|
+
pt_w = x1.to_f
|
|
74
|
+
pt_h = y1.to_f
|
|
75
|
+
return [0, 0] if pt_w.zero? || pt_h.zero?
|
|
76
|
+
|
|
77
|
+
scale = (dpi / 72.0) * (max_width.to_f / pt_w)
|
|
78
|
+
scale = 1.0 if scale > 1.0
|
|
79
|
+
[(pt_w * scale).round, (pt_h * scale).round]
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Render a 1-bpp-style grayscale placeholder: white background,
|
|
83
|
+
# a black border, and a few black "text line" rectangles
|
|
84
|
+
# representing where text content might appear. Pure visual
|
|
85
|
+
# cue, not a real render.
|
|
86
|
+
def render_placeholder(width, height, _page)
|
|
87
|
+
bytes = Array.new(width * height, 255) # white
|
|
88
|
+
|
|
89
|
+
draw_rect(bytes, width, height, 0, 0, width, height, 0) # border (black)
|
|
90
|
+
# Determine text area: roughly 80% of page width, centred
|
|
91
|
+
margin = (width * 0.1).round
|
|
92
|
+
text_top = (height * 0.85).round
|
|
93
|
+
line_height = (height * 0.02).round
|
|
94
|
+
line_height = 1 if line_height.zero?
|
|
95
|
+
line_count = [(height * 0.6 / line_height).floor, 3].max
|
|
96
|
+
line_count.times do |i|
|
|
97
|
+
y = text_top - (i * line_height * 2)
|
|
98
|
+
draw_horizontal_line(bytes, width, height, margin, y,
|
|
99
|
+
width - margin, 0)
|
|
100
|
+
end
|
|
101
|
+
bytes.pack("C*").b
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
def draw_rect(bytes, width, height, x0, y0, x1, y1, value)
|
|
105
|
+
x0.upto([x1 - 1, width - 1].min) do |x|
|
|
106
|
+
set_pixel(bytes, width, height, x, y0, value)
|
|
107
|
+
set_pixel(bytes, width, height, x, y1 - 1, value)
|
|
108
|
+
end
|
|
109
|
+
y0.upto([y1 - 1, height - 1].min) do |y|
|
|
110
|
+
set_pixel(bytes, width, height, x0, y, value)
|
|
111
|
+
set_pixel(bytes, width, height, x1 - 1, y, value)
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
def draw_horizontal_line(bytes, width, height, x0, y, x1, value)
|
|
116
|
+
x0.upto([x1 - 1, width - 1].min) do |x|
|
|
117
|
+
set_pixel(bytes, width, height, x, y, value)
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def set_pixel(bytes, width, height, x, y, value)
|
|
122
|
+
return if x.negative? || y.negative? || x >= width || y >= height
|
|
123
|
+
|
|
124
|
+
bytes[(y * width) + x] = value
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
def require_zlib
|
|
128
|
+
require "zlib"
|
|
129
|
+
::Zlib
|
|
130
|
+
end
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
end
|
data/lib/pdfrb/task.rb
CHANGED
|
@@ -9,5 +9,7 @@ module Pdfrb
|
|
|
9
9
|
autoload :GenerateCorpus, "pdfrb/task/generate_corpus"
|
|
10
10
|
autoload :Benchmark, "pdfrb/task/benchmark"
|
|
11
11
|
autoload :MemoryProfile, "pdfrb/task/memory_profile"
|
|
12
|
+
autoload :RegenerateAppearances, "pdfrb/task/regenerate_appearances"
|
|
13
|
+
autoload :Thumbnail, "pdfrb/task/thumbnail"
|
|
12
14
|
end
|
|
13
15
|
end
|
data/lib/pdfrb/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pdfrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-08-11 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: thor
|
|
@@ -698,6 +699,7 @@ files:
|
|
|
698
699
|
- data/pdfrb/arlington/latest/_UniversalArray.tsv
|
|
699
700
|
- data/pdfrb/arlington/latest/_UniversalDictionary.tsv
|
|
700
701
|
- data/pdfrb/glyphlist.txt
|
|
702
|
+
- data/pdfrb/layout/hyphenation_en.txt
|
|
701
703
|
- data/pdfrb/zapfdingbats.txt
|
|
702
704
|
- exe/pdfrb
|
|
703
705
|
- lib/pdfrb.rb
|
|
@@ -745,18 +747,28 @@ files:
|
|
|
745
747
|
- lib/pdfrb/cli/watermark.rb
|
|
746
748
|
- lib/pdfrb/color.rb
|
|
747
749
|
- lib/pdfrb/color/color_space.rb
|
|
750
|
+
- lib/pdfrb/color/default_profile.rb
|
|
748
751
|
- lib/pdfrb/color/icc_profile.rb
|
|
752
|
+
- lib/pdfrb/color/icc_validator.rb
|
|
749
753
|
- lib/pdfrb/compare.rb
|
|
750
754
|
- lib/pdfrb/compare/comparator.rb
|
|
751
755
|
- lib/pdfrb/compare/report.rb
|
|
752
756
|
- lib/pdfrb/composer.rb
|
|
753
757
|
- lib/pdfrb/configuration.rb
|
|
754
758
|
- lib/pdfrb/conformance.rb
|
|
759
|
+
- lib/pdfrb/conformance/ltv.rb
|
|
760
|
+
- lib/pdfrb/conformance/pades.rb
|
|
761
|
+
- lib/pdfrb/conformance/pdf_2_af.rb
|
|
755
762
|
- lib/pdfrb/conformance/pdf_a.rb
|
|
763
|
+
- lib/pdfrb/conformance/pdf_a4_deep.rb
|
|
756
764
|
- lib/pdfrb/conformance/pdf_ua.rb
|
|
765
|
+
- lib/pdfrb/conformance/pdf_ua2_deep.rb
|
|
766
|
+
- lib/pdfrb/conformance/pdf_ua_tagging_deep.rb
|
|
767
|
+
- lib/pdfrb/conformance/pdf_vt.rb
|
|
757
768
|
- lib/pdfrb/conformance/pdf_x.rb
|
|
758
769
|
- lib/pdfrb/conformance/rule.rb
|
|
759
770
|
- lib/pdfrb/conformance/structure_elements.rb
|
|
771
|
+
- lib/pdfrb/conformance/tagged_pdf.rb
|
|
760
772
|
- lib/pdfrb/conformance/verapdf_bridge.rb
|
|
761
773
|
- lib/pdfrb/content.rb
|
|
762
774
|
- lib/pdfrb/content/canvas.rb
|
|
@@ -774,6 +786,7 @@ files:
|
|
|
774
786
|
- lib/pdfrb/content/operators/color.rb
|
|
775
787
|
- lib/pdfrb/content/operators/general.rb
|
|
776
788
|
- lib/pdfrb/content/operators/graphics_state_params.rb
|
|
789
|
+
- lib/pdfrb/content/operators/inline_image.rb
|
|
777
790
|
- lib/pdfrb/content/operators/marked_content.rb
|
|
778
791
|
- lib/pdfrb/content/operators/painting.rb
|
|
779
792
|
- lib/pdfrb/content/operators/path.rb
|
|
@@ -794,6 +807,7 @@ files:
|
|
|
794
807
|
- lib/pdfrb/digital_signature/cms_handler.rb
|
|
795
808
|
- lib/pdfrb/digital_signature/handler.rb
|
|
796
809
|
- lib/pdfrb/digital_signature/signing.rb
|
|
810
|
+
- lib/pdfrb/digital_signature/timestamp_client.rb
|
|
797
811
|
- lib/pdfrb/digital_signature/timestamp_handler.rb
|
|
798
812
|
- lib/pdfrb/digital_signature/verification.rb
|
|
799
813
|
- lib/pdfrb/digital_signature/verification_result.rb
|
|
@@ -824,9 +838,11 @@ files:
|
|
|
824
838
|
- lib/pdfrb/encryption/aes.rb
|
|
825
839
|
- lib/pdfrb/encryption/identity.rb
|
|
826
840
|
- lib/pdfrb/encryption/password_verification.rb
|
|
841
|
+
- lib/pdfrb/encryption/public_key_security_handler.rb
|
|
827
842
|
- lib/pdfrb/encryption/rc4.rb
|
|
828
843
|
- lib/pdfrb/encryption/security_handler.rb
|
|
829
844
|
- lib/pdfrb/encryption/standard_security_handler.rb
|
|
845
|
+
- lib/pdfrb/encryption/v5_writer.rb
|
|
830
846
|
- lib/pdfrb/error.rb
|
|
831
847
|
- lib/pdfrb/filter.rb
|
|
832
848
|
- lib/pdfrb/filter/ascii_85_decode.rb
|
|
@@ -879,15 +895,18 @@ files:
|
|
|
879
895
|
- lib/pdfrb/font_loader/standard14.rb
|
|
880
896
|
- lib/pdfrb/font_loader/true_type.rb
|
|
881
897
|
- lib/pdfrb/font_loader/type1.rb
|
|
898
|
+
- lib/pdfrb/font_loader/type3.rb
|
|
882
899
|
- lib/pdfrb/font_loader/variant_from_name.rb
|
|
883
900
|
- lib/pdfrb/font_resolver.rb
|
|
884
901
|
- lib/pdfrb/image.rb
|
|
885
902
|
- lib/pdfrb/image/audit.rb
|
|
886
903
|
- lib/pdfrb/image/downsampler.rb
|
|
887
904
|
- lib/pdfrb/image_loader.rb
|
|
905
|
+
- lib/pdfrb/image_loader/gif.rb
|
|
888
906
|
- lib/pdfrb/image_loader/jpeg.rb
|
|
889
907
|
- lib/pdfrb/image_loader/pdf.rb
|
|
890
908
|
- lib/pdfrb/image_loader/png.rb
|
|
909
|
+
- lib/pdfrb/image_loader/tiff.rb
|
|
891
910
|
- lib/pdfrb/importer.rb
|
|
892
911
|
- lib/pdfrb/layout.rb
|
|
893
912
|
- lib/pdfrb/layout/bidi.rb
|
|
@@ -895,18 +914,25 @@ files:
|
|
|
895
914
|
- lib/pdfrb/layout/box_fitter.rb
|
|
896
915
|
- lib/pdfrb/layout/column_box.rb
|
|
897
916
|
- lib/pdfrb/layout/container_box.rb
|
|
917
|
+
- lib/pdfrb/layout/font_fallback.rb
|
|
898
918
|
- lib/pdfrb/layout/frame.rb
|
|
919
|
+
- lib/pdfrb/layout/hyphenation.rb
|
|
899
920
|
- lib/pdfrb/layout/image_box.rb
|
|
900
921
|
- lib/pdfrb/layout/inline_box.rb
|
|
922
|
+
- lib/pdfrb/layout/justification_kashidas.rb
|
|
901
923
|
- lib/pdfrb/layout/line.rb
|
|
902
924
|
- lib/pdfrb/layout/list_box.rb
|
|
925
|
+
- lib/pdfrb/layout/multi_cell_text_layout.rb
|
|
926
|
+
- lib/pdfrb/layout/multi_page_table_box.rb
|
|
903
927
|
- lib/pdfrb/layout/numeric_refinements.rb
|
|
904
928
|
- lib/pdfrb/layout/page_style.rb
|
|
929
|
+
- lib/pdfrb/layout/polygon_frame.rb
|
|
905
930
|
- lib/pdfrb/layout/style.rb
|
|
906
931
|
- lib/pdfrb/layout/table_box.rb
|
|
907
932
|
- lib/pdfrb/layout/text_box.rb
|
|
908
933
|
- lib/pdfrb/layout/text_fragment.rb
|
|
909
934
|
- lib/pdfrb/layout/text_layouter.rb
|
|
935
|
+
- lib/pdfrb/layout/text_shaper.rb
|
|
910
936
|
- lib/pdfrb/linearization.rb
|
|
911
937
|
- lib/pdfrb/linearization/hint_stream.rb
|
|
912
938
|
- lib/pdfrb/linearization/writer.rb
|
|
@@ -1057,6 +1083,7 @@ files:
|
|
|
1057
1083
|
- lib/pdfrb/model/type/output_intent.rb
|
|
1058
1084
|
- lib/pdfrb/model/type/page.rb
|
|
1059
1085
|
- lib/pdfrb/model/type/page_label.rb
|
|
1086
|
+
- lib/pdfrb/model/type/page_piece_info.rb
|
|
1060
1087
|
- lib/pdfrb/model/type/page_tree_node.rb
|
|
1061
1088
|
- lib/pdfrb/model/type/page_tree_node_root.rb
|
|
1062
1089
|
- lib/pdfrb/model/type/pattern.rb
|
|
@@ -1142,6 +1169,7 @@ files:
|
|
|
1142
1169
|
- lib/pdfrb/source/header_reader.rb
|
|
1143
1170
|
- lib/pdfrb/source/helpers.rb
|
|
1144
1171
|
- lib/pdfrb/source/linearization_detection.rb
|
|
1172
|
+
- lib/pdfrb/source/linearization_reader.rb
|
|
1145
1173
|
- lib/pdfrb/source/object_reader.rb
|
|
1146
1174
|
- lib/pdfrb/source/object_stream_reader.rb
|
|
1147
1175
|
- lib/pdfrb/source/parser.rb
|
|
@@ -1160,6 +1188,8 @@ files:
|
|
|
1160
1188
|
- lib/pdfrb/task/memory_profile.rb
|
|
1161
1189
|
- lib/pdfrb/task/merge.rb
|
|
1162
1190
|
- lib/pdfrb/task/optimize.rb
|
|
1191
|
+
- lib/pdfrb/task/regenerate_appearances.rb
|
|
1192
|
+
- lib/pdfrb/task/thumbnail.rb
|
|
1163
1193
|
- lib/pdfrb/test_utils.rb
|
|
1164
1194
|
- lib/pdfrb/validator.rb
|
|
1165
1195
|
- lib/pdfrb/version.rb
|
|
@@ -1181,6 +1211,7 @@ metadata:
|
|
|
1181
1211
|
changelog_uri: https://github.com/claricle/pdfrb/blob/main/CHANGELOG.md
|
|
1182
1212
|
bug_tracker_uri: https://github.com/claricle/pdfrb/issues
|
|
1183
1213
|
rubygems_mfa_required: 'true'
|
|
1214
|
+
post_install_message:
|
|
1184
1215
|
rdoc_options: []
|
|
1185
1216
|
require_paths:
|
|
1186
1217
|
- lib
|
|
@@ -1195,7 +1226,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1195
1226
|
- !ruby/object:Gem::Version
|
|
1196
1227
|
version: '0'
|
|
1197
1228
|
requirements: []
|
|
1198
|
-
rubygems_version:
|
|
1229
|
+
rubygems_version: 3.5.22
|
|
1230
|
+
signing_key:
|
|
1199
1231
|
specification_version: 4
|
|
1200
1232
|
summary: Pure-Ruby PDF parser, Arlington-model-driven domain model, and serializer
|
|
1201
1233
|
test_files: []
|