diff --git a/borb/io/read/reference/xref_transformer.py b/borb/io/read/reference/xref_transformer.py index fa81acfe8..0635c9481 100644 --- a/borb/io/read/reference/xref_transformer.py +++ b/borb/io/read/reference/xref_transformer.py @@ -17,6 +17,7 @@ from borb.pdf.canvas.event.event_listener import Event, EventListener from borb.pdf.document.document import Document from borb.pdf.xref.plaintext_xref import PlainTextXREF +from borb.pdf.xref.rebuilt_xref import RebuiltXREF from borb.pdf.xref.stream_xref import StreamXREF from borb.pdf.xref.xref import XREF @@ -257,7 +258,23 @@ def _read_xref( else: doc[Name("XRef")] = most_recent_xref except Exception as ex0: - raise ex0 + most_recent_xref = None + exceptions_to_rethrow.append(ex0) + + # attempt to rebuild XREF from document + if most_recent_xref is None: + try: + most_recent_xref = RebuiltXREF() + assert most_recent_xref is not None + most_recent_xref.set_parent(doc) + most_recent_xref.read(src, tok) + if "XRef" in doc: + doc[Name("XRef")] = doc["XRef"].merge(most_recent_xref) + else: + doc[Name("XRef")] = most_recent_xref + except Exception as ex0: + most_recent_xref = None + exceptions_to_rethrow.append(ex0) # unable to read XREF # re-throw exceptions diff --git a/borb/io/write/ascii_art/ascii_logo.txt b/borb/io/write/ascii_art/ascii_logo.txt index 9b3dd4696..8f1965a0d 100644 --- a/borb/io/write/ascii_art/ascii_logo.txt +++ b/borb/io/write/ascii_art/ascii_logo.txt @@ -1,2 +1,2 @@ -borb version 2.0.20 +borb version 2.0.21 Joris Schellekens diff --git a/borb/io/write/conformance_level.py b/borb/io/write/conformance_level.py index c2f75b993..0cfcc72ba 100644 --- a/borb/io/write/conformance_level.py +++ b/borb/io/write/conformance_level.py @@ -1,3 +1,11 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +In turn, each PDF/A standard supports different conformance levels (a & b for PDF/A-1; and a, b & u for PDF/A-2 and -3). +These conformance levels control the “accessibility” requirements of a file that impact the ability of machines and people to understand the content. +""" + import enum diff --git a/borb/pdf/canvas/layout/annotation/annotation.py b/borb/pdf/canvas/layout/annotation/annotation.py index 96f468caf..db2a78d9e 100644 --- a/borb/pdf/canvas/layout/annotation/annotation.py +++ b/borb/pdf/canvas/layout/annotation/annotation.py @@ -1,3 +1,11 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +An annotation associates an object such as a note, sound, or movie with a location on a page of a PDF +document, or provides a way to interact with the user by means of the mouse and keyboard. PDF includes a +wide variety of standard annotation types, described in detail in 12.5.6, “Annotation Types.” +""" import datetime import typing from decimal import Decimal @@ -8,6 +16,12 @@ class Annotation(Dictionary): + """ + An annotation associates an object such as a note, sound, or movie with a location on a page of a PDF + document, or provides a way to interact with the user by means of the mouse and keyboard. PDF includes a + wide variety of standard annotation types, described in detail in 12.5.6, “Annotation Types.” + """ + @staticmethod def _timestamp_to_str() -> str: timestamp_str = "D:" diff --git a/borb/pdf/canvas/layout/annotation/remote_go_to_annotation.py b/borb/pdf/canvas/layout/annotation/remote_go_to_annotation.py index a0cd47d66..07e7e69a2 100644 --- a/borb/pdf/canvas/layout/annotation/remote_go_to_annotation.py +++ b/borb/pdf/canvas/layout/annotation/remote_go_to_annotation.py @@ -7,7 +7,7 @@ entries specific to this type of annotation. This method adds a link annotation with an action that opens a remote URI. """ -from borb.io.read.types import Name, String, Dictionary +from borb.io.read.types import Name, String, Dictionary, List, Decimal as bDecimal from borb.pdf.canvas.geometry.rectangle import Rectangle from borb.pdf.canvas.layout.annotation.annotation import Annotation @@ -27,6 +27,21 @@ def __init__(self, bounding_box: Rectangle, uri: str): # Link for a link annotation. self[Name("Subtype")] = Name("Link") + # (Optional) An array specifying the characteristics of the annotation’s + # border, which shall be drawn as a rounded rectangle. + # (PDF 1.0) The array consists of three numbers defining the horizontal + # corner radius, vertical corner radius, and border width, all in default user + # space units. If the corner radii are 0, the border has square (not rounded) + # corners; if the border width is 0, no border is drawn. + # (PDF 1.1) The array may have a fourth element, an optional dash array + # defining a pattern of dashes and gaps that shall be used in drawing the + # border. The dash array shall be specified in the same format as in the + # line dash pattern parameter of the graphics state (see 8.4.3.6, “Line + # Dash Pattern”). + self[Name("Border")] = List().set_can_be_referenced(False) + for _ in range(0, 3): + self[Name("Border")].append(bDecimal(0)) + # (Optional; PDF 1.1) An action that shall be performed when the link # annotation is activated (see 12.6, “Actions”). self[Name("A")] = Dictionary() diff --git a/borb/pdf/canvas/layout/layout_element.py b/borb/pdf/canvas/layout/layout_element.py index cdf06c539..26541d078 100644 --- a/borb/pdf/canvas/layout/layout_element.py +++ b/borb/pdf/canvas/layout/layout_element.py @@ -410,6 +410,12 @@ def _draw_border(self, page: "Page", border_box: Rectangle): # type: ignore[nam # print("R %f %f %f %f " % (border_box.x, border_box.y, border_box.width, border_box.height)) + n: int = 0 + xll: float = round(border_box.x, n) + yll: float = round(border_box.y, n) + xur: float = round(border_box.x + border_box.width, n) + yur: float = round(border_box.y + border_box.height, n) + # draw border(s) rgb_color = self._border_color.to_rgb() content = "q %f %f %f RG %f w" % ( @@ -420,31 +426,31 @@ def _draw_border(self, page: "Page", border_box: Rectangle): # type: ignore[nam ) if self._border_top: content += " %f %f m %f %f l s" % ( - border_box.x, - border_box.y + border_box.height, - border_box.x + border_box.width, - border_box.y + border_box.height, + xll, + yur, + xur, + yur, ) if self._border_right: content += " %d %d m %d %d l s" % ( - border_box.x + border_box.width, - border_box.y + border_box.height, - border_box.x + border_box.width, - border_box.y, + xur, + yur, + xur, + yll, ) if self._border_bottom: content += " %d %d m %d %d l s" % ( - border_box.x + border_box.width, - border_box.y, - border_box.x, - border_box.y, + xll, + yll, + xur, + yll, ) if self._border_left: content += " %d %d m %d %d l s" % ( - border_box.x, - border_box.y, - border_box.x, - border_box.y + border_box.height, + xll, + yur, + xll, + yll, ) content += " Q " self._append_to_content_stream(page, content) diff --git a/borb/pdf/canvas/line_art/rectangular_hitomezashi.py b/borb/pdf/canvas/line_art/rectangular_hitomezashi.py index ed1c0a3c3..bf7ef90ce 100644 --- a/borb/pdf/canvas/line_art/rectangular_hitomezashi.py +++ b/borb/pdf/canvas/line_art/rectangular_hitomezashi.py @@ -77,6 +77,12 @@ def hitomezashi( random.choice([True, False, False]) for _ in range(0, 32) ], ): + """ + This function generates a rectangular Hitomezashi grid pattern + :param horizontal_seed: a typing.List[bool] to be used as the horizontal seed + :param vertical_seed: a typing.List[bool] to be used as the vertical seed + :return: a rectangular Hitomezashi pattern, represented as a typing.List[typing.Tuple[typing.Tuple[Decimal, Decimal], typing.Tuple[Decimal, Decimal]]] + """ # keep track of lines lines: typing.List[ diff --git a/borb/pdf/canvas/line_art/rectangular_maze_factory.py b/borb/pdf/canvas/line_art/rectangular_maze_factory.py index 693489207..f034ffe96 100644 --- a/borb/pdf/canvas/line_art/rectangular_maze_factory.py +++ b/borb/pdf/canvas/line_art/rectangular_maze_factory.py @@ -1,11 +1,29 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +A maze where every point is reachable and where there is only one single path +from one point in the maze to any other point is called a perfect maze. +""" import random import typing from decimal import Decimal class RectangularMazeFactory: + """ + A maze where every point is reachable and where there is only one single path + from one point in the maze to any other point is called a perfect maze. + """ + @staticmethod def rectangular_maze(grid_width: int = 10, grid_height: int = 10): + """ + This function generates a perfect rectangular maze. + :param grid_width: the width of the grid (expressed in cells) + :param grid_height: the height of the grid (expressed in cells) + :return: a perfect maze, represented as a typing.List[typing.Tuple[typing.Tuple[Decimal, Decimal], typing.Tuple[Decimal, Decimal]]] + """ # determine lines cells: typing.List[typing.List[typing.Tuple[bool, bool, bool, bool]]] = [ diff --git a/borb/pdf/document/document.py b/borb/pdf/document/document.py index dde94296c..e51e9e465 100644 --- a/borb/pdf/document/document.py +++ b/borb/pdf/document/document.py @@ -421,6 +421,11 @@ def get_embedded_file(self, file_name: str) -> typing.Optional[bytes]: # def append_embedded_javascript(self, javascript: str) -> "Document": + """ + This function appends embedded JavaScript to this Document, returning self. + :param javascript: the Javascript str to be appended to this Document + :return: self + """ # build actual javascript stream stream = Stream() diff --git a/borb/pdf/document/name_tree.py b/borb/pdf/document/name_tree.py index 5a413300e..dbaddc642 100644 --- a/borb/pdf/document/name_tree.py +++ b/borb/pdf/document/name_tree.py @@ -1,9 +1,32 @@ +""" +Some categories of objects in a PDF file can be referred to by name rather than by object reference. The +correspondence between names and objects is established by the document’s name dictionary (PDF 1.2), +located by means of the Names entry in the document’s catalog (see 7.7.2, "Document Catalog"). Each entry in +this dictionary designates the root of a name tree (see 7.9.6, "Name Trees") defining names for a particular +category of objects. + +A name tree serves a similar purpose to a dictionary—associating keys and values—but by different means. +A name tree differs from a dictionary in the following important ways: +- Unlike the keys in a dictionary, which are name objects, those in a name tree are strings. +- The keys are ordered. +- The values associated with the keys may be objects of any type. Stream objects shall be specified by +indirect object references (7.3.8, "Stream Objects"). The dictionary, array, and string objects should be +specified by indirect object references, and other PDF objects (nulls, numbers, booleans, and names) +should be specified as direct objects. +- The data structure can represent an arbitrarily large collection of key-value pairs, which can be looked up +efficiently without requiring the entire data structure to be read from the PDF file. (In contrast, a dictionary +can be subject to an implementation limit on the number of entries it can contain.) +""" import typing from borb.io.read.types import Dictionary, Name, List, String class NameTree: + """ + A name tree is similar to a dictionary that associates keys and values but the keys in a name tree are strings and are ordered + """ + def __init__(self, document: Dictionary, name: Name): self._document: Dictionary = document self._name: Name = name @@ -70,6 +93,7 @@ def _put_new(self, parent: Dictionary, key: str, value: typing.Any): parent["Kids"].append(kid) def _put_existing(self, parent: Dictionary, key: str, value: typing.Any): + # TODO pass # diff --git a/borb/pdf/page/page.py b/borb/pdf/page/page.py index 96dd97b49..ff8adf820 100644 --- a/borb/pdf/page/page.py +++ b/borb/pdf/page/page.py @@ -212,7 +212,12 @@ def get_annotations(self) -> List: self[Name("Annots")] = List() return self["Annots"] - def append_annotation(self, annotation: Annotation): + def append_annotation(self, annotation: Annotation) -> "Page": + """ + This function appends an Annotation to this Page, returning self. + :param annotation: the Annotation object to append to this Page + :return: self + """ # (Optional except as noted below; PDF 1.3; not used in FDF files) An # indirect reference to the page object with which this annotation is diff --git a/borb/pdf/xref/rebuilt_xref.py b/borb/pdf/xref/rebuilt_xref.py new file mode 100644 index 000000000..b135aca42 --- /dev/null +++ b/borb/pdf/xref/rebuilt_xref.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +The cross-reference table contains information that permits random access to indirect objects within the file so +that the entire file need not be read to locate any particular object. +This implementation of PlainTextXREF is invoked whenever the XREF could not be loaded properly. +This implementation will then loop over the entire PDF file to find obj declaration statements. +""" +import io +import logging +import typing + +from borb.io.read.tokenize.high_level_tokenizer import HighLevelTokenizer +from borb.io.read.types import Reference, Name +from borb.pdf.xref.plaintext_xref import PlainTextXREF +from borb.pdf.xref.xref import XREF + +logger = logging.getLogger(__name__) + + +class RebuiltXREF(PlainTextXREF): + """ + The cross-reference table contains information that permits random access to indirect objects within the file so + that the entire file need not be read to locate any particular object. + This implementation of PlainTextXREF is invoked whenever the XREF could not be loaded properly. + This implementation will then loop over the entire PDF file to find obj declaration statements. + """ + + def read( + self, + src: typing.Union[io.BufferedIOBase, io.RawIOBase, io.BytesIO], + tok: HighLevelTokenizer, + initial_offset: typing.Optional[int] = None, + ) -> "XREF": + """ + This method attempts to read a plaintext XREF from the given io_source. + It will either throw an exception, or return this XREF + """ + + # logger + logger.info("Switching to RebuiltXREF parsing.") + + # get pos + pos_before: int = src.tell() + + # set pos + src.seek(0) + + # get object declarations + i: int = 0 + trailer_pos: typing.Optional[int] = None + bytes_in_pdf: bytes = src.read() + while i < len(bytes_in_pdf): + # 0 0 obj + if ( + 48 <= bytes_in_pdf[i] <= 57 # + and bytes_in_pdf[i + 1] == 32 # + and 48 <= bytes_in_pdf[i + 2] <= 57 # + and bytes_in_pdf[i + 3] == 32 # + and bytes_in_pdf[i + 4] == 111 # 'o' + and bytes_in_pdf[i + 5] == 98 # 'b' + and bytes_in_pdf[i + 6] == 106 # 'j' + ): + logger.debug("%d %d obj at %d" % (bytes_in_pdf[i] - 48, bytes_in_pdf[i+1] - 48, i)) + self._entries.append( + Reference( + object_number=bytes_in_pdf[i] - 48, + generation_number=bytes_in_pdf[i + 2] - 48, + byte_offset=i, + ) + ) + i += 7 + continue + + # 00 0 obj + if ( + 48 <= bytes_in_pdf[i] <= 57 # + and 48 <= bytes_in_pdf[i+1] <= 57 # + and bytes_in_pdf[i + 2] == 32 # + and 48 <= bytes_in_pdf[i + 3] <= 57 # + and bytes_in_pdf[i + 4] == 32 # + and bytes_in_pdf[i + 5] == 111 # 'o' + and bytes_in_pdf[i + 6] == 98 # 'b' + and bytes_in_pdf[i + 7] == 106 # 'j' + ): + logger.debug("%d %d obj at %d" % ((bytes_in_pdf[i] - 48) * 10 + (bytes_in_pdf[i+1] - 48), bytes_in_pdf[i+3] - 48, i)) + self._entries.append( + Reference( + object_number=(bytes_in_pdf[i] - 48) * 10 + (bytes_in_pdf[i+1] - 48), + generation_number=bytes_in_pdf[i + 3] - 48, + byte_offset=i, + ) + ) + i += 8 + continue + + # 000 0 obj + if ( + 48 <= bytes_in_pdf[i] <= 57 # + and 48 <= bytes_in_pdf[i + 1] <= 57 # + and 48 <= bytes_in_pdf[i + 2] <= 57 # + and bytes_in_pdf[i + 3] == 32 # + and 48 <= bytes_in_pdf[i + 4] <= 57 # + and bytes_in_pdf[i + 5] == 32 # + and bytes_in_pdf[i + 6] == 111 # 'o' + and bytes_in_pdf[i + 7] == 98 # 'b' + and bytes_in_pdf[i + 8] == 106 # 'j' + ): + obj_nr: int = (bytes_in_pdf[i] - 48) * 100 + (bytes_in_pdf[i+1] - 48) * 10 + (bytes_in_pdf[i+2] - 48) + logger.debug("%d %d obj at %d" % (obj_nr, bytes_in_pdf[i+4] - 48, i)) + self._entries.append( + Reference( + object_number=obj_nr, + generation_number=bytes_in_pdf[i + 4] - 48, + byte_offset=i, + ) + ) + i += 9 + continue + + # trailer + if ( + bytes_in_pdf[i] == 116 # 't' + and bytes_in_pdf[i + 1] == 114 # 'r' + and bytes_in_pdf[i + 2] == 97 # 'a' + and bytes_in_pdf[i + 3] == 105 # 'i' + and bytes_in_pdf[i + 4] == 108 # 'l' + and bytes_in_pdf[i + 5] == 101 # 'e' + and bytes_in_pdf[i + 6] == 114 # 'r' + ): + trailer_pos = i + + # default + i += 1 + + # read trailer + src.seek(trailer_pos) + self[Name("Trailer")] = self._read_trailer(src, tok) + self[Name("Trailer")].set_parent(self) + + # restore pos + src.seek(pos_before) + + # return + return self diff --git a/release_notes.md b/release_notes.md index 33a1ea0f6..3c8143825 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,11 +1,8 @@ -# :mega: borb release 2.0.20 +# :mega: borb release 2.0.21 -This release is a small feature release. +This release is a small feature release: -- `SoundAnnotation` can now be added to a PDF, enabling you to add voice-clips, music or other audio to your document -- `JavaScriptPushButton` makes it easier to add your own `JavaScript` enabled buttons -- minor improvement to `TextRankKeywordExtraction` - -The majority of the work this sprint went into updating the documentation. -You should check it out. All code-samples in the README are now actually stand-alone code files that can be run. -They are automatically included in the README, rather than duplicated (as before), making it a lot easier to maintain the examples repo. +- `borb` can now read some broken PDF documents +- tests have been added for this use case +- more documentation has been added in general (less than 10 undocumented methods) +- border for `RemoteGoToAnnotation` has been removed \ No newline at end of file diff --git a/setup.py b/setup.py index 71549ed74..7fc060316 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ setuptools.setup( name="borb", - version="2.0.20", + version="2.0.21", author="Joris Schellekens", author_email="joris.schellekens.1989@gmail.com", description="borb is a library for reading, creating and manipulating PDF files in python.", diff --git a/tests/corpus/test_copy_document_compare_size.py b/tests/corpus/test_copy_document_compare_size.py index 3e5903ece..9d1b99bd4 100644 --- a/tests/corpus/test_copy_document_compare_size.py +++ b/tests/corpus/test_copy_document_compare_size.py @@ -42,7 +42,7 @@ def __init__(self, methodName="runTest"): self.number_of_fails: int = 0 self.memory_stats_per_document: typing.Dict[str, typing.Tuple[int, int]] = {} - @unittest.skip + #@unittest.skip def test_against_entire_corpus(self): pdf_file_names = os.listdir(self.corpus_dir) pdfs = [ diff --git a/tests/corpus/test_copy_document_resize_images_compare_size.py b/tests/corpus/test_copy_document_resize_images_compare_size.py index 728fd8a21..8e6c729da 100644 --- a/tests/corpus/test_copy_document_resize_images_compare_size.py +++ b/tests/corpus/test_copy_document_resize_images_compare_size.py @@ -43,7 +43,7 @@ def __init__(self, methodName="runTest"): self.number_of_fails: int = 0 self.memory_stats_per_document: typing.Dict[str, typing.Tuple[int, int]] = {} - @unittest.skip + #@unittest.skip def test_against_entire_corpus(self): pdf_file_names = os.listdir(self.corpus_dir) pdfs = [ diff --git a/tests/corpus/test_extract_text_expect_ground_truth.py b/tests/corpus/test_extract_text_expect_ground_truth.py index 4cbcfadb9..ec4267563 100644 --- a/tests/corpus/test_extract_text_expect_ground_truth.py +++ b/tests/corpus/test_extract_text_expect_ground_truth.py @@ -46,7 +46,7 @@ def __init__(self, methodName="runTest"): self.time_per_document: typing.Dict[str, float] = {} self.fails_per_document: typing.Dict[str, int] = [] - @unittest.skip + #@unittest.skip def test_against_entire_corpus(self): pdf_file_names = os.listdir(self.corpus_dir) pdfs = [ diff --git a/tests/corpus/test_open_document.py b/tests/corpus/test_open_document.py index 58eaadbd6..142d5e19a 100644 --- a/tests/corpus/test_open_document.py +++ b/tests/corpus/test_open_document.py @@ -45,7 +45,7 @@ def __init__(self, methodName="runTest"): self.time_per_document: typing.Dict[str, float] = {} self.memory_stats_per_document: typing.Dict[str, typing.Tuple[int, int]] = {} - @unittest.skip + #@unittest.skip def test_against_entire_corpus(self): pdf_file_names = os.listdir(self.corpus_dir) pdfs = [ diff --git a/tests/output/test_add_all_rubber_stamp_annotations/output.pdf b/tests/output/test_add_all_rubber_stamp_annotations/output.pdf index adf48a1b8..961639360 100644 Binary files a/tests/output/test_add_all_rubber_stamp_annotations/output.pdf and b/tests/output/test_add_all_rubber_stamp_annotations/output.pdf differ diff --git a/tests/output/test_add_circle_annotation/output.pdf b/tests/output/test_add_circle_annotation/output.pdf index 1b1f16bc5..a68621052 100644 Binary files a/tests/output/test_add_circle_annotation/output.pdf and b/tests/output/test_add_circle_annotation/output.pdf differ diff --git a/tests/output/test_add_free_text_annotation/output_001.pdf b/tests/output/test_add_free_text_annotation/output_001.pdf index 4f6be97a6..c9cb81ce6 100644 Binary files a/tests/output/test_add_free_text_annotation/output_001.pdf and b/tests/output/test_add_free_text_annotation/output_001.pdf differ diff --git a/tests/output/test_add_free_text_annotation/output_002.pdf b/tests/output/test_add_free_text_annotation/output_002.pdf index 440e50e25..c83ac375b 100644 Binary files a/tests/output/test_add_free_text_annotation/output_002.pdf and b/tests/output/test_add_free_text_annotation/output_002.pdf differ diff --git a/tests/output/test_add_highlight_annotation/output_001.pdf b/tests/output/test_add_highlight_annotation/output_001.pdf index e8b79bfc5..e8ead2cf1 100644 Binary files a/tests/output/test_add_highlight_annotation/output_001.pdf and b/tests/output/test_add_highlight_annotation/output_001.pdf differ diff --git a/tests/output/test_add_highlight_annotation/output_002.pdf b/tests/output/test_add_highlight_annotation/output_002.pdf index 8571296b0..b58577a3c 100644 Binary files a/tests/output/test_add_highlight_annotation/output_002.pdf and b/tests/output/test_add_highlight_annotation/output_002.pdf differ diff --git a/tests/output/test_add_large_amount_of_headings/output_001.pdf b/tests/output/test_add_large_amount_of_headings/output_001.pdf index 86f051eaf..bc5206c5f 100644 Binary files a/tests/output/test_add_large_amount_of_headings/output_001.pdf and b/tests/output/test_add_large_amount_of_headings/output_001.pdf differ diff --git a/tests/output/test_add_large_amount_of_headings/output_002.pdf b/tests/output/test_add_large_amount_of_headings/output_002.pdf index 7b0ba0e24..57d50fa41 100644 Binary files a/tests/output/test_add_large_amount_of_headings/output_002.pdf and b/tests/output/test_add_large_amount_of_headings/output_002.pdf differ diff --git a/tests/output/test_add_line_annotation/output_001.pdf b/tests/output/test_add_line_annotation/output_001.pdf index c706469b3..3379aefb8 100644 Binary files a/tests/output/test_add_line_annotation/output_001.pdf and b/tests/output/test_add_line_annotation/output_001.pdf differ diff --git a/tests/output/test_add_line_annotation/output_002.pdf b/tests/output/test_add_line_annotation/output_002.pdf index 5d2626cce..fe6fc1cb9 100644 Binary files a/tests/output/test_add_line_annotation/output_002.pdf and b/tests/output/test_add_line_annotation/output_002.pdf differ diff --git a/tests/output/test_add_outline/output_001.pdf b/tests/output/test_add_outline/output_001.pdf index 0ca058fce..da603ce2c 100644 Binary files a/tests/output/test_add_outline/output_001.pdf and b/tests/output/test_add_outline/output_001.pdf differ diff --git a/tests/output/test_add_outline/output_002.pdf b/tests/output/test_add_outline/output_002.pdf index d7d78188c..03f84498b 100644 Binary files a/tests/output/test_add_outline/output_002.pdf and b/tests/output/test_add_outline/output_002.pdf differ diff --git a/tests/output/test_add_polygon_annotation_using_line_art_factory/output.pdf b/tests/output/test_add_polygon_annotation_using_line_art_factory/output.pdf index 85d53ad3b..ff30ab6e5 100644 Binary files a/tests/output/test_add_polygon_annotation_using_line_art_factory/output.pdf and b/tests/output/test_add_polygon_annotation_using_line_art_factory/output.pdf differ diff --git a/tests/output/test_add_polyline_annotation_using_line_art_factory/output.pdf b/tests/output/test_add_polyline_annotation_using_line_art_factory/output.pdf index 7d2979061..6e4a5b411 100644 Binary files a/tests/output/test_add_polyline_annotation_using_line_art_factory/output.pdf and b/tests/output/test_add_polyline_annotation_using_line_art_factory/output.pdf differ diff --git a/tests/output/test_add_redact_annotation/output_001.pdf b/tests/output/test_add_redact_annotation/output_001.pdf index 1bcfaa14d..07e1ea167 100644 Binary files a/tests/output/test_add_redact_annotation/output_001.pdf and b/tests/output/test_add_redact_annotation/output_001.pdf differ diff --git a/tests/output/test_add_redact_annotation/output_002.pdf b/tests/output/test_add_redact_annotation/output_002.pdf index 23037513c..32c969c92 100644 Binary files a/tests/output/test_add_redact_annotation/output_002.pdf and b/tests/output/test_add_redact_annotation/output_002.pdf differ diff --git a/tests/output/test_add_redact_annotation/output_003.pdf b/tests/output/test_add_redact_annotation/output_003.pdf index ae324b6b7..20fb4c3ca 100644 Binary files a/tests/output/test_add_redact_annotation/output_003.pdf and b/tests/output/test_add_redact_annotation/output_003.pdf differ diff --git a/tests/output/test_add_redact_annotation/output_004.pdf b/tests/output/test_add_redact_annotation/output_004.pdf index 7b204b173..c4fda60c1 100644 Binary files a/tests/output/test_add_redact_annotation/output_004.pdf and b/tests/output/test_add_redact_annotation/output_004.pdf differ diff --git a/tests/output/test_add_redact_annotation/output_005.pdf b/tests/output/test_add_redact_annotation/output_005.pdf index e3b2c9317..6a3f24dec 100644 Binary files a/tests/output/test_add_redact_annotation/output_005.pdf and b/tests/output/test_add_redact_annotation/output_005.pdf differ diff --git a/tests/output/test_add_remote_go_to_annotation/output_001.pdf b/tests/output/test_add_remote_go_to_annotation/output_001.pdf index 81b653b38..8f6b3e766 100644 Binary files a/tests/output/test_add_remote_go_to_annotation/output_001.pdf and b/tests/output/test_add_remote_go_to_annotation/output_001.pdf differ diff --git a/tests/output/test_add_remote_go_to_annotation/output_002.pdf b/tests/output/test_add_remote_go_to_annotation/output_002.pdf index 1e3baf82e..ce790f392 100644 Binary files a/tests/output/test_add_remote_go_to_annotation/output_002.pdf and b/tests/output/test_add_remote_go_to_annotation/output_002.pdf differ diff --git a/tests/output/test_add_sound_annotation/output_001.pdf b/tests/output/test_add_sound_annotation/output_001.pdf index a127a0eb1..2864fee96 100644 Binary files a/tests/output/test_add_sound_annotation/output_001.pdf and b/tests/output/test_add_sound_annotation/output_001.pdf differ diff --git a/tests/output/test_add_sound_annotation/output_002.pdf b/tests/output/test_add_sound_annotation/output_002.pdf index 4d09f6e26..5fc938ad8 100644 Binary files a/tests/output/test_add_sound_annotation/output_002.pdf and b/tests/output/test_add_sound_annotation/output_002.pdf differ diff --git a/tests/output/test_add_square_annotation/output.pdf b/tests/output/test_add_square_annotation/output.pdf index 4ca7a1348..73d422ab5 100644 Binary files a/tests/output/test_add_square_annotation/output.pdf and b/tests/output/test_add_square_annotation/output.pdf differ diff --git a/tests/output/test_add_square_annotation_in_free_space/output_001.pdf b/tests/output/test_add_square_annotation_in_free_space/output_001.pdf index 87be54369..55bfc22ea 100644 Binary files a/tests/output/test_add_square_annotation_in_free_space/output_001.pdf and b/tests/output/test_add_square_annotation_in_free_space/output_001.pdf differ diff --git a/tests/output/test_add_square_annotation_in_free_space/output_002.pdf b/tests/output/test_add_square_annotation_in_free_space/output_002.pdf index d281c4bee..b4374371f 100644 Binary files a/tests/output/test_add_square_annotation_in_free_space/output_002.pdf and b/tests/output/test_add_square_annotation_in_free_space/output_002.pdf differ diff --git a/tests/output/test_add_squiggle_annotation/output_001.pdf b/tests/output/test_add_squiggle_annotation/output_001.pdf index 34ea5a48c..8c2c07653 100644 Binary files a/tests/output/test_add_squiggle_annotation/output_001.pdf and b/tests/output/test_add_squiggle_annotation/output_001.pdf differ diff --git a/tests/output/test_add_squiggle_annotation/output_002.pdf b/tests/output/test_add_squiggle_annotation/output_002.pdf index a34f86dfa..0f2d62e8d 100644 Binary files a/tests/output/test_add_squiggle_annotation/output_002.pdf and b/tests/output/test_add_squiggle_annotation/output_002.pdf differ diff --git a/tests/output/test_add_strikeout_annotation/output_001.pdf b/tests/output/test_add_strikeout_annotation/output_001.pdf index d4fdd94d8..0b1b848b7 100644 Binary files a/tests/output/test_add_strikeout_annotation/output_001.pdf and b/tests/output/test_add_strikeout_annotation/output_001.pdf differ diff --git a/tests/output/test_add_strikeout_annotation/output_002.pdf b/tests/output/test_add_strikeout_annotation/output_002.pdf index 4652b44fb..05bafb9a9 100644 Binary files a/tests/output/test_add_strikeout_annotation/output_002.pdf and b/tests/output/test_add_strikeout_annotation/output_002.pdf differ diff --git a/tests/output/test_add_super_mario_annotation/output.pdf b/tests/output/test_add_super_mario_annotation/output.pdf index 45c3119b2..d21ae71f9 100644 Binary files a/tests/output/test_add_super_mario_annotation/output.pdf and b/tests/output/test_add_super_mario_annotation/output.pdf differ diff --git a/tests/output/test_add_text_annotation/output_001.pdf b/tests/output/test_add_text_annotation/output_001.pdf index 8d3ca7ef4..bff5a0db5 100644 Binary files a/tests/output/test_add_text_annotation/output_001.pdf and b/tests/output/test_add_text_annotation/output_001.pdf differ diff --git a/tests/output/test_add_text_annotation/output_002.pdf b/tests/output/test_add_text_annotation/output_002.pdf index 916aca056..a4563a67a 100644 Binary files a/tests/output/test_add_text_annotation/output_002.pdf and b/tests/output/test_add_text_annotation/output_002.pdf differ diff --git a/tests/output/test_add_underline_annotation/output_001.pdf b/tests/output/test_add_underline_annotation/output_001.pdf index 1c09360e3..1fb25a388 100644 Binary files a/tests/output/test_add_underline_annotation/output_001.pdf and b/tests/output/test_add_underline_annotation/output_001.pdf differ diff --git a/tests/output/test_add_underline_annotation/output_002.pdf b/tests/output/test_add_underline_annotation/output_002.pdf index e85d8380e..2ea998015 100644 Binary files a/tests/output/test_add_underline_annotation/output_002.pdf and b/tests/output/test_add_underline_annotation/output_002.pdf differ diff --git a/tests/output/test_analogous_color_scheme/output.pdf b/tests/output/test_analogous_color_scheme/output.pdf index 22667ac57..7ebdedab6 100644 Binary files a/tests/output/test_analogous_color_scheme/output.pdf and b/tests/output/test_analogous_color_scheme/output.pdf differ diff --git a/tests/output/test_append_embedded_file/output_001.pdf b/tests/output/test_append_embedded_file/output_001.pdf index ff8747b0c..73b3a1a21 100644 Binary files a/tests/output/test_append_embedded_file/output_001.pdf and b/tests/output/test_append_embedded_file/output_001.pdf differ diff --git a/tests/output/test_append_embedded_file/output_002.pdf b/tests/output/test_append_embedded_file/output_002.pdf index 1f7729f8a..2212ce6ab 100644 Binary files a/tests/output/test_append_embedded_file/output_002.pdf and b/tests/output/test_append_embedded_file/output_002.pdf differ diff --git a/tests/output/test_append_embedded_javascript/output_001.pdf b/tests/output/test_append_embedded_javascript/output_001.pdf index ab1a4da8b..7a97f19d2 100644 Binary files a/tests/output/test_append_embedded_javascript/output_001.pdf and b/tests/output/test_append_embedded_javascript/output_001.pdf differ diff --git a/tests/output/test_apply_redaction_annotations/output_001.pdf b/tests/output/test_apply_redaction_annotations/output_001.pdf index ceee2a02c..31ea93cdb 100644 Binary files a/tests/output/test_apply_redaction_annotations/output_001.pdf and b/tests/output/test_apply_redaction_annotations/output_001.pdf differ diff --git a/tests/output/test_apply_redaction_annotations/output_002.pdf b/tests/output/test_apply_redaction_annotations/output_002.pdf index 264dece04..add1c9e2f 100644 Binary files a/tests/output/test_apply_redaction_annotations/output_002.pdf and b/tests/output/test_apply_redaction_annotations/output_002.pdf differ diff --git a/tests/output/test_apply_redaction_annotations/output_003.pdf b/tests/output/test_apply_redaction_annotations/output_003.pdf index 37723b37f..aa9e9aab0 100644 Binary files a/tests/output/test_apply_redaction_annotations/output_003.pdf and b/tests/output/test_apply_redaction_annotations/output_003.pdf differ diff --git a/tests/output/test_apply_redaction_annotations/output_004.pdf b/tests/output/test_apply_redaction_annotations/output_004.pdf index b671c523a..f3c5a5f05 100644 Binary files a/tests/output/test_apply_redaction_annotations/output_004.pdf and b/tests/output/test_apply_redaction_annotations/output_004.pdf differ diff --git a/tests/output/test_apply_redaction_annotations/output_005.pdf b/tests/output/test_apply_redaction_annotations/output_005.pdf index ef8bdb60f..6f64f7b71 100644 Binary files a/tests/output/test_apply_redaction_annotations/output_005.pdf and b/tests/output/test_apply_redaction_annotations/output_005.pdf differ diff --git a/tests/output/test_apply_redaction_annotations/output_006.pdf b/tests/output/test_apply_redaction_annotations/output_006.pdf index 57d7b94c6..4b860e9a6 100644 Binary files a/tests/output/test_apply_redaction_annotations/output_006.pdf and b/tests/output/test_apply_redaction_annotations/output_006.pdf differ diff --git a/tests/output/test_browser_layout_inline_next_line/output.pdf b/tests/output/test_browser_layout_inline_next_line/output.pdf index 72edb56ca..14a82a868 100644 Binary files a/tests/output/test_browser_layout_inline_next_line/output.pdf and b/tests/output/test_browser_layout_inline_next_line/output.pdf differ diff --git a/tests/output/test_change_info_dictionary_author/output_001.pdf b/tests/output/test_change_info_dictionary_author/output_001.pdf index fc9c7293d..daa41a345 100644 Binary files a/tests/output/test_change_info_dictionary_author/output_001.pdf and b/tests/output/test_change_info_dictionary_author/output_001.pdf differ diff --git a/tests/output/test_change_info_dictionary_author/output_002.pdf b/tests/output/test_change_info_dictionary_author/output_002.pdf index 3fde97403..a28beb4d6 100644 Binary files a/tests/output/test_change_info_dictionary_author/output_002.pdf and b/tests/output/test_change_info_dictionary_author/output_002.pdf differ diff --git a/tests/output/test_concat_documents/output_000.pdf b/tests/output/test_concat_documents/output_000.pdf index 78e2ce7e7..91deee98f 100644 Binary files a/tests/output/test_concat_documents/output_000.pdf and b/tests/output/test_concat_documents/output_000.pdf differ diff --git a/tests/output/test_concat_documents/output_001.pdf b/tests/output/test_concat_documents/output_001.pdf index 7f99d89dc..607308877 100644 Binary files a/tests/output/test_concat_documents/output_001.pdf and b/tests/output/test_concat_documents/output_001.pdf differ diff --git a/tests/output/test_concat_documents/output_002.pdf b/tests/output/test_concat_documents/output_002.pdf index f15d85d82..980b29843 100644 Binary files a/tests/output/test_concat_documents/output_002.pdf and b/tests/output/test_concat_documents/output_002.pdf differ diff --git a/tests/output/test_copy_document_compare_size/0187_page_0_copy.pdf b/tests/output/test_copy_document_compare_size/0187_page_0_copy.pdf new file mode 100644 index 000000000..fc680efd6 Binary files /dev/null and b/tests/output/test_copy_document_compare_size/0187_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_compare_size/0430_page_0_copy.pdf b/tests/output/test_copy_document_compare_size/0430_page_0_copy.pdf new file mode 100644 index 000000000..128ecc8d0 Binary files /dev/null and b/tests/output/test_copy_document_compare_size/0430_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_compare_size/0462_page_0_copy.pdf b/tests/output/test_copy_document_compare_size/0462_page_0_copy.pdf new file mode 100644 index 000000000..f81bf7953 Binary files /dev/null and b/tests/output/test_copy_document_compare_size/0462_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_compare_size/0495_page_0_copy.pdf b/tests/output/test_copy_document_compare_size/0495_page_0_copy.pdf new file mode 100644 index 000000000..7971be6f2 Binary files /dev/null and b/tests/output/test_copy_document_compare_size/0495_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_compare_size/0594_page_0_copy.pdf b/tests/output/test_copy_document_compare_size/0594_page_0_copy.pdf new file mode 100644 index 000000000..bd387472b Binary files /dev/null and b/tests/output/test_copy_document_compare_size/0594_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_compare_size/output.pdf b/tests/output/test_copy_document_compare_size/output.pdf index 5b3aa4eba..29918ac91 100644 Binary files a/tests/output/test_copy_document_compare_size/output.pdf and b/tests/output/test_copy_document_compare_size/output.pdf differ diff --git a/tests/output/test_copy_document_resize_images_compare_size/0187_page_0_copy.pdf b/tests/output/test_copy_document_resize_images_compare_size/0187_page_0_copy.pdf new file mode 100644 index 000000000..467087dc1 Binary files /dev/null and b/tests/output/test_copy_document_resize_images_compare_size/0187_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_resize_images_compare_size/0430_page_0_copy.pdf b/tests/output/test_copy_document_resize_images_compare_size/0430_page_0_copy.pdf new file mode 100644 index 000000000..eb20fd13e Binary files /dev/null and b/tests/output/test_copy_document_resize_images_compare_size/0430_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_resize_images_compare_size/0462_page_0_copy.pdf b/tests/output/test_copy_document_resize_images_compare_size/0462_page_0_copy.pdf new file mode 100644 index 000000000..9637ea611 Binary files /dev/null and b/tests/output/test_copy_document_resize_images_compare_size/0462_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_resize_images_compare_size/0495_page_0_copy.pdf b/tests/output/test_copy_document_resize_images_compare_size/0495_page_0_copy.pdf new file mode 100644 index 000000000..8eacabd40 Binary files /dev/null and b/tests/output/test_copy_document_resize_images_compare_size/0495_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_resize_images_compare_size/0594_page_0_copy.pdf b/tests/output/test_copy_document_resize_images_compare_size/0594_page_0_copy.pdf new file mode 100644 index 000000000..4d748336d Binary files /dev/null and b/tests/output/test_copy_document_resize_images_compare_size/0594_page_0_copy.pdf differ diff --git a/tests/output/test_copy_document_resize_images_compare_size/output.pdf b/tests/output/test_copy_document_resize_images_compare_size/output.pdf index 2ff4cad9d..7b26cb621 100644 Binary files a/tests/output/test_copy_document_resize_images_compare_size/output.pdf and b/tests/output/test_copy_document_resize_images_compare_size/output.pdf differ diff --git a/tests/output/test_count_annotations/output_001.pdf b/tests/output/test_count_annotations/output_001.pdf index c10f644a1..546e3711f 100644 Binary files a/tests/output/test_count_annotations/output_001.pdf and b/tests/output/test_count_annotations/output_001.pdf differ diff --git a/tests/output/test_count_annotations/output_002.pdf b/tests/output/test_count_annotations/output_002.pdf index fb4e48c3f..e858abc7d 100644 Binary files a/tests/output/test_count_annotations/output_002.pdf and b/tests/output/test_count_annotations/output_002.pdf differ diff --git a/tests/output/test_create_document_with_output_intent/output_001.pdf b/tests/output/test_create_document_with_output_intent/output_001.pdf index 3f097296e..1a22a8bc5 100644 Binary files a/tests/output/test_create_document_with_output_intent/output_001.pdf and b/tests/output/test_create_document_with_output_intent/output_001.pdf differ diff --git a/tests/output/test_detect_table/input_000.pdf b/tests/output/test_detect_table/input_000.pdf index fd87e3094..32748a81e 100644 Binary files a/tests/output/test_detect_table/input_000.pdf and b/tests/output/test_detect_table/input_000.pdf differ diff --git a/tests/output/test_detect_table/input_001.pdf b/tests/output/test_detect_table/input_001.pdf index 8f9305a9f..47f1c470b 100644 Binary files a/tests/output/test_detect_table/input_001.pdf and b/tests/output/test_detect_table/input_001.pdf differ diff --git a/tests/output/test_detect_table/input_002.pdf b/tests/output/test_detect_table/input_002.pdf index be20fe4c2..fe21c790f 100644 Binary files a/tests/output/test_detect_table/input_002.pdf and b/tests/output/test_detect_table/input_002.pdf differ diff --git a/tests/output/test_detect_table/input_003.pdf b/tests/output/test_detect_table/input_003.pdf index 7742379dc..1b67e7aa8 100644 Binary files a/tests/output/test_detect_table/input_003.pdf and b/tests/output/test_detect_table/input_003.pdf differ diff --git a/tests/output/test_detect_table/input_004.pdf b/tests/output/test_detect_table/input_004.pdf index e446efa46..5e4674444 100644 Binary files a/tests/output/test_detect_table/input_004.pdf and b/tests/output/test_detect_table/input_004.pdf differ diff --git a/tests/output/test_detect_table/input_005.pdf b/tests/output/test_detect_table/input_005.pdf index a3dd1f308..65287b0d4 100644 Binary files a/tests/output/test_detect_table/input_005.pdf and b/tests/output/test_detect_table/input_005.pdf differ diff --git a/tests/output/test_detect_table/input_006.pdf b/tests/output/test_detect_table/input_006.pdf index 381d1b9e8..f4483fdfd 100644 Binary files a/tests/output/test_detect_table/input_006.pdf and b/tests/output/test_detect_table/input_006.pdf differ diff --git a/tests/output/test_detect_table/output_000.pdf b/tests/output/test_detect_table/output_000.pdf index 6ed1177e3..5acfae619 100644 Binary files a/tests/output/test_detect_table/output_000.pdf and b/tests/output/test_detect_table/output_000.pdf differ diff --git a/tests/output/test_detect_table/output_001.pdf b/tests/output/test_detect_table/output_001.pdf index 01e2f9452..c97db097f 100644 Binary files a/tests/output/test_detect_table/output_001.pdf and b/tests/output/test_detect_table/output_001.pdf differ diff --git a/tests/output/test_detect_table/output_002.pdf b/tests/output/test_detect_table/output_002.pdf index 8e91b5902..e7cf902f6 100644 Binary files a/tests/output/test_detect_table/output_002.pdf and b/tests/output/test_detect_table/output_002.pdf differ diff --git a/tests/output/test_detect_table/output_003.pdf b/tests/output/test_detect_table/output_003.pdf index ca7519100..4eea05e20 100644 Binary files a/tests/output/test_detect_table/output_003.pdf and b/tests/output/test_detect_table/output_003.pdf differ diff --git a/tests/output/test_detect_table/output_004.pdf b/tests/output/test_detect_table/output_004.pdf index be2c8bc8d..eec13df65 100644 Binary files a/tests/output/test_detect_table/output_004.pdf and b/tests/output/test_detect_table/output_004.pdf differ diff --git a/tests/output/test_detect_table/output_005.pdf b/tests/output/test_detect_table/output_005.pdf index 51a5d6e4c..67e9e4a70 100644 Binary files a/tests/output/test_detect_table/output_005.pdf and b/tests/output/test_detect_table/output_005.pdf differ diff --git a/tests/output/test_detect_table/output_006.pdf b/tests/output/test_detect_table/output_006.pdf index 28493bb86..592456546 100644 Binary files a/tests/output/test_detect_table/output_006.pdf and b/tests/output/test_detect_table/output_006.pdf differ diff --git a/tests/output/test_digit_placement_ubuntu_font/output_001.pdf b/tests/output/test_digit_placement_ubuntu_font/output_001.pdf index 4b57a0882..947ac5b11 100644 Binary files a/tests/output/test_digit_placement_ubuntu_font/output_001.pdf and b/tests/output/test_digit_placement_ubuntu_font/output_001.pdf differ diff --git a/tests/output/test_digit_placement_ubuntu_font/output_001.png b/tests/output/test_digit_placement_ubuntu_font/output_001.png index 931b2cf28..61ecf8b8b 100644 Binary files a/tests/output/test_digit_placement_ubuntu_font/output_001.png and b/tests/output/test_digit_placement_ubuntu_font/output_001.png differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_000.pdf b/tests/output/test_export_html_to_pdf/example_html_input_000.pdf index 5a8b1d6d4..7d577e707 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_000.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_000.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_001.pdf b/tests/output/test_export_html_to_pdf/example_html_input_001.pdf index 28a1d54d4..194dc8475 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_001.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_001.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_002.pdf b/tests/output/test_export_html_to_pdf/example_html_input_002.pdf index f4ddb6808..5eef06fb9 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_002.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_002.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_003.pdf b/tests/output/test_export_html_to_pdf/example_html_input_003.pdf index fd2a19032..f96140cdb 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_003.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_003.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_004.pdf b/tests/output/test_export_html_to_pdf/example_html_input_004.pdf index 532722768..b6975571e 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_004.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_004.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_005.pdf b/tests/output/test_export_html_to_pdf/example_html_input_005.pdf index 511b55d86..6eafcbd91 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_005.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_005.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_006.pdf b/tests/output/test_export_html_to_pdf/example_html_input_006.pdf index cfc373fd1..f83f37b96 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_006.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_006.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_007.pdf b/tests/output/test_export_html_to_pdf/example_html_input_007.pdf index 4c75bf31b..73bab1b02 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_007.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_007.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_008.pdf b/tests/output/test_export_html_to_pdf/example_html_input_008.pdf index 52f73d679..22aafaebb 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_008.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_008.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_009.pdf b/tests/output/test_export_html_to_pdf/example_html_input_009.pdf index 217b8ce06..7324086fe 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_009.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_009.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_010.pdf b/tests/output/test_export_html_to_pdf/example_html_input_010.pdf index 08b31da40..db4dda788 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_010.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_010.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_011.pdf b/tests/output/test_export_html_to_pdf/example_html_input_011.pdf index e92f9cb75..a6a30fba5 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_011.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_011.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_012.pdf b/tests/output/test_export_html_to_pdf/example_html_input_012.pdf index 22a138ca0..703bf2316 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_012.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_012.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_013.pdf b/tests/output/test_export_html_to_pdf/example_html_input_013.pdf index 6ad3cc6fe..8b757610f 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_013.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_013.pdf differ diff --git a/tests/output/test_export_html_to_pdf/example_html_input_014.pdf b/tests/output/test_export_html_to_pdf/example_html_input_014.pdf index ac6359a35..5a95ab928 100644 Binary files a/tests/output/test_export_html_to_pdf/example_html_input_014.pdf and b/tests/output/test_export_html_to_pdf/example_html_input_014.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-001.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-001.md.pdf index 982e4b48a..17b63bd43 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-001.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-001.md.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-002.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-002.md.pdf index b243eaa8e..069aa07aa 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-002.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-002.md.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-003.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-003.md.pdf index 5cb63de3a..5f0b24e57 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-003.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-003.md.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-004.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-004.md.pdf index 0063694c6..5241933e8 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-004.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-004.md.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-005.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-005.md.pdf index 259ecf73d..5b269ad1b 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-005.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-005.md.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-006.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-006.md.pdf index fd3244911..12b430335 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-006.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-006.md.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-007.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-007.md.pdf index 5599335e4..815caeb2c 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-007.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-007.md.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-008.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-008.md.pdf index 571d38ab5..7844b01eb 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-008.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-008.md.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-009.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-009.md.pdf index 97734fac1..0f53eea1a 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-009.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-009.md.pdf differ diff --git a/tests/output/test_export_markdown_to_pdf/example-markdown-input-010.md.pdf b/tests/output/test_export_markdown_to_pdf/example-markdown-input-010.md.pdf index 176beb754..e46886939 100644 Binary files a/tests/output/test_export_markdown_to_pdf/example-markdown-input-010.md.pdf and b/tests/output/test_export_markdown_to_pdf/example-markdown-input-010.md.pdf differ diff --git a/tests/output/test_export_to_mp3/output.mp3 b/tests/output/test_export_to_mp3/output.mp3 index 13b3c8350..e782a6c51 100644 Binary files a/tests/output/test_export_to_mp3/output.mp3 and b/tests/output/test_export_to_mp3/output.mp3 differ diff --git a/tests/output/test_extract_colors/output_001.pdf b/tests/output/test_extract_colors/output_001.pdf index 3be8b2d5e..de4ad6de2 100644 Binary files a/tests/output/test_extract_colors/output_001.pdf and b/tests/output/test_extract_colors/output_001.pdf differ diff --git a/tests/output/test_extract_colors/output_002.pdf b/tests/output/test_extract_colors/output_002.pdf index c5bf8ed51..4d15ea391 100644 Binary files a/tests/output/test_extract_colors/output_002.pdf and b/tests/output/test_extract_colors/output_002.pdf differ diff --git a/tests/output/test_extract_colors/output_002.png b/tests/output/test_extract_colors/output_002.png index 2bbddc2b6..78183f499 100644 Binary files a/tests/output/test_extract_colors/output_002.png and b/tests/output/test_extract_colors/output_002.png differ diff --git a/tests/output/test_extract_courier_text/output_001.pdf b/tests/output/test_extract_courier_text/output_001.pdf index 11631ac58..0e68aa517 100644 Binary files a/tests/output/test_extract_courier_text/output_001.pdf and b/tests/output/test_extract_courier_text/output_001.pdf differ diff --git a/tests/output/test_extract_font_names/output_001.pdf b/tests/output/test_extract_font_names/output_001.pdf index 32b072c1a..09b86446a 100644 Binary files a/tests/output/test_extract_font_names/output_001.pdf and b/tests/output/test_extract_font_names/output_001.pdf differ diff --git a/tests/output/test_extract_font_names/output_002.pdf b/tests/output/test_extract_font_names/output_002.pdf index c4a2b9329..62a068d77 100644 Binary files a/tests/output/test_extract_font_names/output_002.pdf and b/tests/output/test_extract_font_names/output_002.pdf differ diff --git a/tests/output/test_extract_keywords/output_001.pdf b/tests/output/test_extract_keywords/output_001.pdf index 1614536ff..ae1a3ab18 100644 Binary files a/tests/output/test_extract_keywords/output_001.pdf and b/tests/output/test_extract_keywords/output_001.pdf differ diff --git a/tests/output/test_extract_keywords/output_002.pdf b/tests/output/test_extract_keywords/output_002.pdf index 0cb630f93..d955ddccb 100644 Binary files a/tests/output/test_extract_keywords/output_002.pdf and b/tests/output/test_extract_keywords/output_002.pdf differ diff --git a/tests/output/test_extract_keywords/output_003.pdf b/tests/output/test_extract_keywords/output_003.pdf index 1f760c0ba..bddff2b83 100644 Binary files a/tests/output/test_extract_keywords/output_003.pdf and b/tests/output/test_extract_keywords/output_003.pdf differ diff --git a/tests/output/test_extract_red_text/output_001.pdf b/tests/output/test_extract_red_text/output_001.pdf index b82af29fe..a40dd6aff 100644 Binary files a/tests/output/test_extract_red_text/output_001.pdf and b/tests/output/test_extract_red_text/output_001.pdf differ diff --git a/tests/output/test_extract_regex/output_001.pdf b/tests/output/test_extract_regex/output_001.pdf index d6c8b0066..874144047 100644 Binary files a/tests/output/test_extract_regex/output_001.pdf and b/tests/output/test_extract_regex/output_001.pdf differ diff --git a/tests/output/test_extract_regex/output_002.pdf b/tests/output/test_extract_regex/output_002.pdf index 53c5e1665..938c0f403 100644 Binary files a/tests/output/test_extract_regex/output_002.pdf and b/tests/output/test_extract_regex/output_002.pdf differ diff --git a/tests/output/test_extract_text/output_001.pdf b/tests/output/test_extract_text/output_001.pdf index 9db4fb65b..e89dc442c 100644 Binary files a/tests/output/test_extract_text/output_001.pdf and b/tests/output/test_extract_text/output_001.pdf differ diff --git a/tests/output/test_extract_text/output_002.pdf b/tests/output/test_extract_text/output_002.pdf index 226b26edb..21f305d2e 100644 Binary files a/tests/output/test_extract_text/output_002.pdf and b/tests/output/test_extract_text/output_002.pdf differ diff --git a/tests/output/test_extract_text_expect_ground_truth/output.pdf b/tests/output/test_extract_text_expect_ground_truth/output.pdf index 84e113971..cea51ea1f 100644 Binary files a/tests/output/test_extract_text_expect_ground_truth/output.pdf and b/tests/output/test_extract_text_expect_ground_truth/output.pdf differ diff --git a/tests/output/test_extract_text_from_self_made_invoice/output.pdf b/tests/output/test_extract_text_from_self_made_invoice/output.pdf index 540561796..370959cf6 100644 Binary files a/tests/output/test_extract_text_from_self_made_invoice/output.pdf and b/tests/output/test_extract_text_from_self_made_invoice/output.pdf differ diff --git a/tests/output/test_fix_broken_xref/output_001.pdf b/tests/output/test_fix_broken_xref/output_001.pdf new file mode 100644 index 000000000..8e0615d29 Binary files /dev/null and b/tests/output/test_fix_broken_xref/output_001.pdf differ diff --git a/tests/output/test_fix_broken_xref/output_002.pdf b/tests/output/test_fix_broken_xref/output_002.pdf new file mode 100644 index 000000000..f07488552 Binary files /dev/null and b/tests/output/test_fix_broken_xref/output_002.pdf differ diff --git a/tests/output/test_margin_and_padding/output_001.pdf b/tests/output/test_margin_and_padding/output_001.pdf index 0fc35b387..39d33d74d 100644 Binary files a/tests/output/test_margin_and_padding/output_001.pdf and b/tests/output/test_margin_and_padding/output_001.pdf differ diff --git a/tests/output/test_margin_and_padding/output_002.pdf b/tests/output/test_margin_and_padding/output_002.pdf index 73eecb7e8..31f3d164d 100644 Binary files a/tests/output/test_margin_and_padding/output_002.pdf and b/tests/output/test_margin_and_padding/output_002.pdf differ diff --git a/tests/output/test_modify_image/output_001.pdf b/tests/output/test_modify_image/output_001.pdf index f08a2cba1..8f0e8431a 100644 Binary files a/tests/output/test_modify_image/output_001.pdf and b/tests/output/test_modify_image/output_001.pdf differ diff --git a/tests/output/test_modify_image/output_002.pdf b/tests/output/test_modify_image/output_002.pdf index ebfacc282..0c88cdc9c 100644 Binary files a/tests/output/test_modify_image/output_002.pdf and b/tests/output/test_modify_image/output_002.pdf differ diff --git a/tests/output/test_open_document/output.pdf b/tests/output/test_open_document/output.pdf index 445051ecd..b88c451d2 100644 Binary files a/tests/output/test_open_document/output.pdf and b/tests/output/test_open_document/output.pdf differ diff --git a/tests/output/test_open_encrypted_document/output.pdf b/tests/output/test_open_encrypted_document/output.pdf index d005cb866..346c5c3a9 100644 Binary files a/tests/output/test_open_encrypted_document/output.pdf and b/tests/output/test_open_encrypted_document/output.pdf differ diff --git a/tests/output/test_optimize_images/output_001.pdf b/tests/output/test_optimize_images/output_001.pdf index 9d5df774d..8706e72db 100644 Binary files a/tests/output/test_optimize_images/output_001.pdf and b/tests/output/test_optimize_images/output_001.pdf differ diff --git a/tests/output/test_page_has_empty_resource_dictionary/output_001.pdf b/tests/output/test_page_has_empty_resource_dictionary/output_001.pdf index c5fb1912d..f3887e55f 100644 Binary files a/tests/output/test_page_has_empty_resource_dictionary/output_001.pdf and b/tests/output/test_page_has_empty_resource_dictionary/output_001.pdf differ diff --git a/tests/output/test_redact_common_regular_expressions/output_001.pdf b/tests/output/test_redact_common_regular_expressions/output_001.pdf index 6d192c70d..da10e6dbb 100644 Binary files a/tests/output/test_redact_common_regular_expressions/output_001.pdf and b/tests/output/test_redact_common_regular_expressions/output_001.pdf differ diff --git a/tests/output/test_redact_common_regular_expressions/output_002.pdf b/tests/output/test_redact_common_regular_expressions/output_002.pdf index a9ef1cac8..401baade0 100644 Binary files a/tests/output/test_redact_common_regular_expressions/output_002.pdf and b/tests/output/test_redact_common_regular_expressions/output_002.pdf differ diff --git a/tests/output/test_redact_common_regular_expressions/output_003.pdf b/tests/output/test_redact_common_regular_expressions/output_003.pdf index 6c93ef782..c4fcab2f7 100644 Binary files a/tests/output/test_redact_common_regular_expressions/output_003.pdf and b/tests/output/test_redact_common_regular_expressions/output_003.pdf differ diff --git a/tests/output/test_remove_annotation/output_001.pdf b/tests/output/test_remove_annotation/output_001.pdf index fcd681b65..02f565fe5 100644 Binary files a/tests/output/test_remove_annotation/output_001.pdf and b/tests/output/test_remove_annotation/output_001.pdf differ diff --git a/tests/output/test_remove_annotation/output_002.pdf b/tests/output/test_remove_annotation/output_002.pdf index 369f77894..b889baedd 100644 Binary files a/tests/output/test_remove_annotation/output_002.pdf and b/tests/output/test_remove_annotation/output_002.pdf differ diff --git a/tests/output/test_remove_annotation/output_003.pdf b/tests/output/test_remove_annotation/output_003.pdf index 6c19b5aee..2e445f38b 100644 Binary files a/tests/output/test_remove_annotation/output_003.pdf and b/tests/output/test_remove_annotation/output_003.pdf differ diff --git a/tests/output/test_remove_page/output_001.pdf b/tests/output/test_remove_page/output_001.pdf index 1110a6a22..3ffb28ab6 100644 Binary files a/tests/output/test_remove_page/output_001.pdf and b/tests/output/test_remove_page/output_001.pdf differ diff --git a/tests/output/test_remove_page/output_002.pdf b/tests/output/test_remove_page/output_002.pdf index 8c59713c9..7d3a87b46 100644 Binary files a/tests/output/test_remove_page/output_002.pdf and b/tests/output/test_remove_page/output_002.pdf differ diff --git a/tests/output/test_remove_page/output_003.pdf b/tests/output/test_remove_page/output_003.pdf index b3c3b7b99..3f619f535 100644 Binary files a/tests/output/test_remove_page/output_003.pdf and b/tests/output/test_remove_page/output_003.pdf differ diff --git a/tests/output/test_remove_page/output_004.pdf b/tests/output/test_remove_page/output_004.pdf index ec5bcd343..945eb3967 100644 Binary files a/tests/output/test_remove_page/output_004.pdf and b/tests/output/test_remove_page/output_004.pdf differ diff --git a/tests/output/test_rotate_page/output_001.pdf b/tests/output/test_rotate_page/output_001.pdf index 3edef12d1..1dcc9ec51 100644 Binary files a/tests/output/test_rotate_page/output_001.pdf and b/tests/output/test_rotate_page/output_001.pdf differ diff --git a/tests/output/test_rotate_page/output_002.pdf b/tests/output/test_rotate_page/output_002.pdf index edd730301..3d65dbb94 100644 Binary files a/tests/output/test_rotate_page/output_002.pdf and b/tests/output/test_rotate_page/output_002.pdf differ diff --git a/tests/output/test_rotate_page/output_003.pdf b/tests/output/test_rotate_page/output_003.pdf index b7ab01a61..b92c06f2c 100644 Binary files a/tests/output/test_rotate_page/output_003.pdf and b/tests/output/test_rotate_page/output_003.pdf differ diff --git a/tests/output/test_split_complementary_color_scheme/output.pdf b/tests/output/test_split_complementary_color_scheme/output.pdf index 36dcbfa8f..fedb28ddc 100644 Binary files a/tests/output/test_split_complementary_color_scheme/output.pdf and b/tests/output/test_split_complementary_color_scheme/output.pdf differ diff --git a/tests/output/test_tetradic_rectangle_color_scheme/output.pdf b/tests/output/test_tetradic_rectangle_color_scheme/output.pdf index a45b41fff..bc0d167c6 100644 Binary files a/tests/output/test_tetradic_rectangle_color_scheme/output.pdf and b/tests/output/test_tetradic_rectangle_color_scheme/output.pdf differ diff --git a/tests/output/test_tetradic_square_color_scheme/output.pdf b/tests/output/test_tetradic_square_color_scheme/output.pdf index 3bae1c311..6eedf7499 100644 Binary files a/tests/output/test_tetradic_square_color_scheme/output.pdf and b/tests/output/test_tetradic_square_color_scheme/output.pdf differ diff --git a/tests/output/test_triadic_color_scheme/output.pdf b/tests/output/test_triadic_color_scheme/output.pdf index 95d9573c5..d4cfe6059 100644 Binary files a/tests/output/test_triadic_color_scheme/output.pdf and b/tests/output/test_triadic_color_scheme/output.pdf differ diff --git a/tests/output/test_write_2_scatter_plots/output.pdf b/tests/output/test_write_2_scatter_plots/output.pdf index 6d6d41095..f60309615 100644 Binary files a/tests/output/test_write_2_scatter_plots/output.pdf and b/tests/output/test_write_2_scatter_plots/output.pdf differ diff --git a/tests/output/test_write_3d_density_chart/output.pdf b/tests/output/test_write_3d_density_chart/output.pdf index c7b9e58b8..d99c43948 100644 Binary files a/tests/output/test_write_3d_density_chart/output.pdf and b/tests/output/test_write_3d_density_chart/output.pdf differ diff --git a/tests/output/test_write_3d_surface_plot/output.pdf b/tests/output/test_write_3d_surface_plot/output.pdf index 6de88c857..ba353bc05 100644 Binary files a/tests/output/test_write_3d_surface_plot/output.pdf and b/tests/output/test_write_3d_surface_plot/output.pdf differ diff --git a/tests/output/test_write_all_types_of_barcode/output.pdf b/tests/output/test_write_all_types_of_barcode/output.pdf index 02a15b52f..875391661 100644 Binary files a/tests/output/test_write_all_types_of_barcode/output.pdf and b/tests/output/test_write_all_types_of_barcode/output.pdf differ diff --git a/tests/output/test_write_battleship/output.pdf b/tests/output/test_write_battleship/output.pdf index df76d22a0..6398a43ad 100644 Binary files a/tests/output/test_write_battleship/output.pdf and b/tests/output/test_write_battleship/output.pdf differ diff --git a/tests/output/test_write_blobs/output.pdf b/tests/output/test_write_blobs/output.pdf index b0297a337..0ee033b18 100644 Binary files a/tests/output/test_write_blobs/output.pdf and b/tests/output/test_write_blobs/output.pdf differ diff --git a/tests/output/test_write_check_box/output_001.pdf b/tests/output/test_write_check_box/output_001.pdf index 6560df2ee..4e21868e0 100644 Binary files a/tests/output/test_write_check_box/output_001.pdf and b/tests/output/test_write_check_box/output_001.pdf differ diff --git a/tests/output/test_write_check_box/output_002.pdf b/tests/output/test_write_check_box/output_002.pdf index 9a31d6cdf..bdc65be14 100644 Binary files a/tests/output/test_write_check_box/output_002.pdf and b/tests/output/test_write_check_box/output_002.pdf differ diff --git a/tests/output/test_write_chunk_of_text/output.pdf b/tests/output/test_write_chunk_of_text/output.pdf index cce35270c..816c7af7d 100644 Binary files a/tests/output/test_write_chunk_of_text/output.pdf and b/tests/output/test_write_chunk_of_text/output.pdf differ diff --git a/tests/output/test_write_chunk_of_text_escaped_chars/output.pdf b/tests/output/test_write_chunk_of_text_escaped_chars/output.pdf index fad0bfacc..7aceede56 100644 Binary files a/tests/output/test_write_chunk_of_text_escaped_chars/output.pdf and b/tests/output/test_write_chunk_of_text_escaped_chars/output.pdf differ diff --git a/tests/output/test_write_chunk_of_text_in_rainbow_colors/output.pdf b/tests/output/test_write_chunk_of_text_in_rainbow_colors/output.pdf index 4a38dc894..9cfa09743 100644 Binary files a/tests/output/test_write_chunk_of_text_in_rainbow_colors/output.pdf and b/tests/output/test_write_chunk_of_text_in_rainbow_colors/output.pdf differ diff --git a/tests/output/test_write_chunks_of_text/output_001.pdf b/tests/output/test_write_chunks_of_text/output_001.pdf index c3c7c402d..c20559af6 100644 Binary files a/tests/output/test_write_chunks_of_text/output_001.pdf and b/tests/output/test_write_chunks_of_text/output_001.pdf differ diff --git a/tests/output/test_write_chunks_of_text/output_002.pdf b/tests/output/test_write_chunks_of_text/output_002.pdf index 58f64f1fa..1cb89a2d6 100644 Binary files a/tests/output/test_write_chunks_of_text/output_002.pdf and b/tests/output/test_write_chunks_of_text/output_002.pdf differ diff --git a/tests/output/test_write_chunks_of_text/output_003.pdf b/tests/output/test_write_chunks_of_text/output_003.pdf index ec0012ee6..334f4af9c 100644 Binary files a/tests/output/test_write_chunks_of_text/output_003.pdf and b/tests/output/test_write_chunks_of_text/output_003.pdf differ diff --git a/tests/output/test_write_chunks_of_text/output_004.pdf b/tests/output/test_write_chunks_of_text/output_004.pdf index bea205f51..e30d3f3b4 100644 Binary files a/tests/output/test_write_chunks_of_text/output_004.pdf and b/tests/output/test_write_chunks_of_text/output_004.pdf differ diff --git a/tests/output/test_write_chunks_of_text/output_005.pdf b/tests/output/test_write_chunks_of_text/output_005.pdf index 45c2dd529..eec382b3a 100644 Binary files a/tests/output/test_write_chunks_of_text/output_005.pdf and b/tests/output/test_write_chunks_of_text/output_005.pdf differ diff --git a/tests/output/test_write_chunks_of_text_preserves_bounding_boxes/output.pdf b/tests/output/test_write_chunks_of_text_preserves_bounding_boxes/output.pdf index 4d6ecd015..2221f1cfc 100644 Binary files a/tests/output/test_write_chunks_of_text_preserves_bounding_boxes/output.pdf and b/tests/output/test_write_chunks_of_text_preserves_bounding_boxes/output.pdf differ diff --git a/tests/output/test_write_code_128_barcode/output.pdf b/tests/output/test_write_code_128_barcode/output.pdf index 083a2677a..3efb83bc2 100644 Binary files a/tests/output/test_write_code_128_barcode/output.pdf and b/tests/output/test_write_code_128_barcode/output.pdf differ diff --git a/tests/output/test_write_code_128_barcode_in_color/output.pdf b/tests/output/test_write_code_128_barcode_in_color/output.pdf index a550c4111..8148044da 100644 Binary files a/tests/output/test_write_code_128_barcode_in_color/output.pdf and b/tests/output/test_write_code_128_barcode_in_color/output.pdf differ diff --git a/tests/output/test_write_codeblock/output.pdf b/tests/output/test_write_codeblock/output.pdf index a40795f5f..f5d0049a5 100644 Binary files a/tests/output/test_write_codeblock/output.pdf and b/tests/output/test_write_codeblock/output.pdf differ diff --git a/tests/output/test_write_dragon_curve/output.pdf b/tests/output/test_write_dragon_curve/output.pdf index 4c2c4d88f..13c655428 100644 Binary files a/tests/output/test_write_dragon_curve/output.pdf and b/tests/output/test_write_dragon_curve/output.pdf differ diff --git a/tests/output/test_write_drop_down_list/output_001.pdf b/tests/output/test_write_drop_down_list/output_001.pdf index 371f6e17d..294d7daf2 100644 Binary files a/tests/output/test_write_drop_down_list/output_001.pdf and b/tests/output/test_write_drop_down_list/output_001.pdf differ diff --git a/tests/output/test_write_drop_down_list/output_002.pdf b/tests/output/test_write_drop_down_list/output_002.pdf index f30110733..a25980154 100644 Binary files a/tests/output/test_write_drop_down_list/output_002.pdf and b/tests/output/test_write_drop_down_list/output_002.pdf differ diff --git a/tests/output/test_write_emoji/output.pdf b/tests/output/test_write_emoji/output.pdf index e54549862..e9b23b693 100644 Binary files a/tests/output/test_write_emoji/output.pdf and b/tests/output/test_write_emoji/output.pdf differ diff --git a/tests/output/test_write_empty_document/output.pdf b/tests/output/test_write_empty_document/output.pdf index e58dd003b..d02e85bd7 100644 Binary files a/tests/output/test_write_empty_document/output.pdf and b/tests/output/test_write_empty_document/output.pdf differ diff --git a/tests/output/test_write_fixed_column_width_table/output_001.pdf b/tests/output/test_write_fixed_column_width_table/output_001.pdf index 5f22ca203..496595c23 100644 Binary files a/tests/output/test_write_fixed_column_width_table/output_001.pdf and b/tests/output/test_write_fixed_column_width_table/output_001.pdf differ diff --git a/tests/output/test_write_fixed_column_width_table/output_002.pdf b/tests/output/test_write_fixed_column_width_table/output_002.pdf index 3639ca33a..8b879155d 100644 Binary files a/tests/output/test_write_fixed_column_width_table/output_002.pdf and b/tests/output/test_write_fixed_column_width_table/output_002.pdf differ diff --git a/tests/output/test_write_fixed_column_width_table/output_003.pdf b/tests/output/test_write_fixed_column_width_table/output_003.pdf index 433491e52..620b893b0 100644 Binary files a/tests/output/test_write_fixed_column_width_table/output_003.pdf and b/tests/output/test_write_fixed_column_width_table/output_003.pdf differ diff --git a/tests/output/test_write_fixed_column_width_table/output_004.pdf b/tests/output/test_write_fixed_column_width_table/output_004.pdf index e563a52e7..61c57572c 100644 Binary files a/tests/output/test_write_fixed_column_width_table/output_004.pdf and b/tests/output/test_write_fixed_column_width_table/output_004.pdf differ diff --git a/tests/output/test_write_fixed_column_width_table/output_005.pdf b/tests/output/test_write_fixed_column_width_table/output_005.pdf index 69ef6e88c..f2a5a5073 100644 Binary files a/tests/output/test_write_fixed_column_width_table/output_005.pdf and b/tests/output/test_write_fixed_column_width_table/output_005.pdf differ diff --git a/tests/output/test_write_flexi_table/output_001.pdf b/tests/output/test_write_flexi_table/output_001.pdf index 6976e215e..a2ff803c4 100644 Binary files a/tests/output/test_write_flexi_table/output_001.pdf and b/tests/output/test_write_flexi_table/output_001.pdf differ diff --git a/tests/output/test_write_flexi_table/output_002.pdf b/tests/output/test_write_flexi_table/output_002.pdf index a207704c6..e23abb5b5 100644 Binary files a/tests/output/test_write_flexi_table/output_002.pdf and b/tests/output/test_write_flexi_table/output_002.pdf differ diff --git a/tests/output/test_write_flexi_table/output_003.pdf b/tests/output/test_write_flexi_table/output_003.pdf index b6c846739..2b2ec920b 100644 Binary files a/tests/output/test_write_flexi_table/output_003.pdf and b/tests/output/test_write_flexi_table/output_003.pdf differ diff --git a/tests/output/test_write_flexi_table/output_004.pdf b/tests/output/test_write_flexi_table/output_004.pdf index eaa111c81..c9864f738 100644 Binary files a/tests/output/test_write_flexi_table/output_004.pdf and b/tests/output/test_write_flexi_table/output_004.pdf differ diff --git a/tests/output/test_write_flexi_table/output_005.pdf b/tests/output/test_write_flexi_table/output_005.pdf index 916d482ee..5b79184b1 100644 Binary files a/tests/output/test_write_flexi_table/output_005.pdf and b/tests/output/test_write_flexi_table/output_005.pdf differ diff --git a/tests/output/test_write_flexi_table_with_preferred_width/output.pdf b/tests/output/test_write_flexi_table_with_preferred_width/output.pdf index a57ec87c1..0b79e2f69 100644 Binary files a/tests/output/test_write_flexi_table_with_preferred_width/output.pdf and b/tests/output/test_write_flexi_table_with_preferred_width/output.pdf differ diff --git a/tests/output/test_write_flowchart_line_art/output.pdf b/tests/output/test_write_flowchart_line_art/output.pdf index 78ee5bda5..cb9b48ec9 100644 Binary files a/tests/output/test_write_flowchart_line_art/output.pdf and b/tests/output/test_write_flowchart_line_art/output.pdf differ diff --git a/tests/output/test_write_flyer/output.pdf b/tests/output/test_write_flyer/output.pdf index b82de5363..d308e5a65 100644 Binary files a/tests/output/test_write_flyer/output.pdf and b/tests/output/test_write_flyer/output.pdf differ diff --git a/tests/output/test_write_gradient_rectangular_maze/output_001.pdf b/tests/output/test_write_gradient_rectangular_maze/output_001.pdf index c04250a38..ba6432a3d 100644 Binary files a/tests/output/test_write_gradient_rectangular_maze/output_001.pdf and b/tests/output/test_write_gradient_rectangular_maze/output_001.pdf differ diff --git a/tests/output/test_write_gradient_rectangular_maze/output_002.pdf b/tests/output/test_write_gradient_rectangular_maze/output_002.pdf index 1d50d72f6..df791a306 100644 Binary files a/tests/output/test_write_gradient_rectangular_maze/output_002.pdf and b/tests/output/test_write_gradient_rectangular_maze/output_002.pdf differ diff --git a/tests/output/test_write_gradient_rectangular_maze/output_003.pdf b/tests/output/test_write_gradient_rectangular_maze/output_003.pdf index 5c4f53243..e9e95de4e 100644 Binary files a/tests/output/test_write_gradient_rectangular_maze/output_003.pdf and b/tests/output/test_write_gradient_rectangular_maze/output_003.pdf differ diff --git a/tests/output/test_write_grayscale_image/output.pdf b/tests/output/test_write_grayscale_image/output.pdf index 858e23ce4..5dc05e35e 100644 Binary files a/tests/output/test_write_grayscale_image/output.pdf and b/tests/output/test_write_grayscale_image/output.pdf differ diff --git a/tests/output/test_write_hello_world_with_monaco_font/output_001.pdf b/tests/output/test_write_hello_world_with_monaco_font/output_001.pdf index f63d5de5f..c7e49f0f2 100644 Binary files a/tests/output/test_write_hello_world_with_monaco_font/output_001.pdf and b/tests/output/test_write_hello_world_with_monaco_font/output_001.pdf differ diff --git a/tests/output/test_write_hello_world_with_simhei_font/output_001.pdf b/tests/output/test_write_hello_world_with_simhei_font/output_001.pdf index dac82b9ab..d8d096f65 100644 Binary files a/tests/output/test_write_hello_world_with_simhei_font/output_001.pdf and b/tests/output/test_write_hello_world_with_simhei_font/output_001.pdf differ diff --git a/tests/output/test_write_hyphenated_paragraph/output_001.pdf b/tests/output/test_write_hyphenated_paragraph/output_001.pdf index bdf617296..c2044abda 100644 Binary files a/tests/output/test_write_hyphenated_paragraph/output_001.pdf and b/tests/output/test_write_hyphenated_paragraph/output_001.pdf differ diff --git a/tests/output/test_write_hyphenated_paragraph/output_002.pdf b/tests/output/test_write_hyphenated_paragraph/output_002.pdf index 69d0a34c7..ba9e6396e 100644 Binary files a/tests/output/test_write_hyphenated_paragraph/output_002.pdf and b/tests/output/test_write_hyphenated_paragraph/output_002.pdf differ diff --git a/tests/output/test_write_image_aligned_center/output.pdf b/tests/output/test_write_image_aligned_center/output.pdf index 9b29f438a..ae59a082d 100644 Binary files a/tests/output/test_write_image_aligned_center/output.pdf and b/tests/output/test_write_image_aligned_center/output.pdf differ diff --git a/tests/output/test_write_image_by_url/output.pdf b/tests/output/test_write_image_by_url/output.pdf index c80c3ab43..f5cb8100c 100644 Binary files a/tests/output/test_write_image_by_url/output.pdf and b/tests/output/test_write_image_by_url/output.pdf differ diff --git a/tests/output/test_write_incomplete_table/output.pdf b/tests/output/test_write_incomplete_table/output.pdf index f116e2633..8be0bf2a5 100644 Binary files a/tests/output/test_write_incomplete_table/output.pdf and b/tests/output/test_write_incomplete_table/output.pdf differ diff --git a/tests/output/test_write_line_of_text_justified_center/output.pdf b/tests/output/test_write_line_of_text_justified_center/output.pdf index 4d04288df..6efc1f1bf 100644 Binary files a/tests/output/test_write_line_of_text_justified_center/output.pdf and b/tests/output/test_write_line_of_text_justified_center/output.pdf differ diff --git a/tests/output/test_write_line_of_text_justified_full/output.pdf b/tests/output/test_write_line_of_text_justified_full/output.pdf index 3e7921b11..27fc2d51a 100644 Binary files a/tests/output/test_write_line_of_text_justified_full/output.pdf and b/tests/output/test_write_line_of_text_justified_full/output.pdf differ diff --git a/tests/output/test_write_line_of_text_justified_right/output_001.pdf b/tests/output/test_write_line_of_text_justified_right/output_001.pdf index 0bbecea14..c8e984564 100644 Binary files a/tests/output/test_write_line_of_text_justified_right/output_001.pdf and b/tests/output/test_write_line_of_text_justified_right/output_001.pdf differ diff --git a/tests/output/test_write_line_of_text_justified_right/output_002.pdf b/tests/output/test_write_line_of_text_justified_right/output_002.pdf index 2944ed192..168bee43a 100644 Binary files a/tests/output/test_write_line_of_text_justified_right/output_002.pdf and b/tests/output/test_write_line_of_text_justified_right/output_002.pdf differ diff --git a/tests/output/test_write_lissajours_line_art/output.pdf b/tests/output/test_write_lissajours_line_art/output.pdf index 86be6f20b..0cb5fe06a 100644 Binary files a/tests/output/test_write_lissajours_line_art/output.pdf and b/tests/output/test_write_lissajours_line_art/output.pdf differ diff --git a/tests/output/test_write_long_unordered_list/output.pdf b/tests/output/test_write_long_unordered_list/output.pdf index a258b3db1..f0814bf32 100644 Binary files a/tests/output/test_write_long_unordered_list/output.pdf and b/tests/output/test_write_long_unordered_list/output.pdf differ diff --git a/tests/output/test_write_multiple_pages/output.pdf b/tests/output/test_write_multiple_pages/output.pdf index 96e3fd9fe..00ed80d4a 100644 Binary files a/tests/output/test_write_multiple_pages/output.pdf and b/tests/output/test_write_multiple_pages/output.pdf differ diff --git a/tests/output/test_write_nested_ordered_list/output.pdf b/tests/output/test_write_nested_ordered_list/output.pdf index f64002d1a..8f0278352 100644 Binary files a/tests/output/test_write_nested_ordered_list/output.pdf and b/tests/output/test_write_nested_ordered_list/output.pdf differ diff --git a/tests/output/test_write_nested_unordered_list/output.pdf b/tests/output/test_write_nested_unordered_list/output.pdf index c35b25fbe..2d1fa357d 100644 Binary files a/tests/output/test_write_nested_unordered_list/output.pdf and b/tests/output/test_write_nested_unordered_list/output.pdf differ diff --git a/tests/output/test_write_nested_unordered_list/output.png b/tests/output/test_write_nested_unordered_list/output.png index 358714d94..da43a9a88 100644 Binary files a/tests/output/test_write_nested_unordered_list/output.png and b/tests/output/test_write_nested_unordered_list/output.png differ diff --git a/tests/output/test_write_ordered_list/output_001.pdf b/tests/output/test_write_ordered_list/output_001.pdf index 2a4239633..a643580ce 100644 Binary files a/tests/output/test_write_ordered_list/output_001.pdf and b/tests/output/test_write_ordered_list/output_001.pdf differ diff --git a/tests/output/test_write_ordered_list/output_002.pdf b/tests/output/test_write_ordered_list/output_002.pdf index 0c648f19b..aab9d5bac 100644 Binary files a/tests/output/test_write_ordered_list/output_002.pdf and b/tests/output/test_write_ordered_list/output_002.pdf differ diff --git a/tests/output/test_write_paragraph/output.pdf b/tests/output/test_write_paragraph/output.pdf index 012f97d83..b1793e238 100644 Binary files a/tests/output/test_write_paragraph/output.pdf and b/tests/output/test_write_paragraph/output.pdf differ diff --git a/tests/output/test_write_paragraph_alignment/output.pdf b/tests/output/test_write_paragraph_alignment/output.pdf index a941d737b..66b4d0726 100644 Binary files a/tests/output/test_write_paragraph_alignment/output.pdf and b/tests/output/test_write_paragraph_alignment/output.pdf differ diff --git a/tests/output/test_write_paragraph_border_left/output.pdf b/tests/output/test_write_paragraph_border_left/output.pdf index f562e7662..e515ff7d8 100644 Binary files a/tests/output/test_write_paragraph_border_left/output.pdf and b/tests/output/test_write_paragraph_border_left/output.pdf differ diff --git a/tests/output/test_write_paragraph_force_split/output.pdf b/tests/output/test_write_paragraph_force_split/output.pdf index 43f3a23d1..f251aac79 100644 Binary files a/tests/output/test_write_paragraph_force_split/output.pdf and b/tests/output/test_write_paragraph_force_split/output.pdf differ diff --git a/tests/output/test_write_paragraph_justified_center/output_001.pdf b/tests/output/test_write_paragraph_justified_center/output_001.pdf index 6dc0e5103..c807c9c96 100644 Binary files a/tests/output/test_write_paragraph_justified_center/output_001.pdf and b/tests/output/test_write_paragraph_justified_center/output_001.pdf differ diff --git a/tests/output/test_write_paragraph_justified_center/output_002.pdf b/tests/output/test_write_paragraph_justified_center/output_002.pdf index 0fa755d8e..d9b7fa1cb 100644 Binary files a/tests/output/test_write_paragraph_justified_center/output_002.pdf and b/tests/output/test_write_paragraph_justified_center/output_002.pdf differ diff --git a/tests/output/test_write_paragraph_justified_center_with_padding/output.pdf b/tests/output/test_write_paragraph_justified_center_with_padding/output.pdf index 390e4efb8..9dfadd86d 100644 Binary files a/tests/output/test_write_paragraph_justified_center_with_padding/output.pdf and b/tests/output/test_write_paragraph_justified_center_with_padding/output.pdf differ diff --git a/tests/output/test_write_paragraph_justified_center_with_padding_and_border/output.pdf b/tests/output/test_write_paragraph_justified_center_with_padding_and_border/output.pdf index e91a1aab4..20554c9df 100644 Binary files a/tests/output/test_write_paragraph_justified_center_with_padding_and_border/output.pdf and b/tests/output/test_write_paragraph_justified_center_with_padding_and_border/output.pdf differ diff --git a/tests/output/test_write_paragraph_justified_center_with_padding_and_border_and_background/output.pdf b/tests/output/test_write_paragraph_justified_center_with_padding_and_border_and_background/output.pdf index 723226a42..165f1f2a0 100644 Binary files a/tests/output/test_write_paragraph_justified_center_with_padding_and_border_and_background/output.pdf and b/tests/output/test_write_paragraph_justified_center_with_padding_and_border_and_background/output.pdf differ diff --git a/tests/output/test_write_paragraph_justified_full/output.pdf b/tests/output/test_write_paragraph_justified_full/output.pdf index 22081c4b0..63068dbcf 100644 Binary files a/tests/output/test_write_paragraph_justified_full/output.pdf and b/tests/output/test_write_paragraph_justified_full/output.pdf differ diff --git a/tests/output/test_write_paragraph_justified_right/output.pdf b/tests/output/test_write_paragraph_justified_right/output.pdf index a67b7219b..540d31a6f 100644 Binary files a/tests/output/test_write_paragraph_justified_right/output.pdf and b/tests/output/test_write_paragraph_justified_right/output.pdf differ diff --git a/tests/output/test_write_paragraph_preserve_space/output.pdf b/tests/output/test_write_paragraph_preserve_space/output.pdf index 1bb65dd68..2b1850cb5 100644 Binary files a/tests/output/test_write_paragraph_preserve_space/output.pdf and b/tests/output/test_write_paragraph_preserve_space/output.pdf differ diff --git a/tests/output/test_write_paragraph_save_twice/output_001.pdf b/tests/output/test_write_paragraph_save_twice/output_001.pdf index cadf7ecc7..9e14ec541 100644 Binary files a/tests/output/test_write_paragraph_save_twice/output_001.pdf and b/tests/output/test_write_paragraph_save_twice/output_001.pdf differ diff --git a/tests/output/test_write_paragraph_save_twice/output_002.pdf b/tests/output/test_write_paragraph_save_twice/output_002.pdf index 0eaa0a6ab..bb60b435f 100644 Binary files a/tests/output/test_write_paragraph_save_twice/output_002.pdf and b/tests/output/test_write_paragraph_save_twice/output_002.pdf differ diff --git a/tests/output/test_write_paragraph_with_accented_letters/output.pdf b/tests/output/test_write_paragraph_with_accented_letters/output.pdf index 5a3dd1157..d1cb8c353 100644 Binary files a/tests/output/test_write_paragraph_with_accented_letters/output.pdf and b/tests/output/test_write_paragraph_with_accented_letters/output.pdf differ diff --git a/tests/output/test_write_paragraphs_using_multi_column_layout/output.pdf b/tests/output/test_write_paragraphs_using_multi_column_layout/output.pdf index 9e475c8d0..90576122d 100644 Binary files a/tests/output/test_write_paragraphs_using_multi_column_layout/output.pdf and b/tests/output/test_write_paragraphs_using_multi_column_layout/output.pdf differ diff --git a/tests/output/test_write_paragraphs_using_single_column_layout/output.pdf b/tests/output/test_write_paragraphs_using_single_column_layout/output.pdf index 9ba53a6e0..51f0fd019 100644 Binary files a/tests/output/test_write_paragraphs_using_single_column_layout/output.pdf and b/tests/output/test_write_paragraphs_using_single_column_layout/output.pdf differ diff --git a/tests/output/test_write_paragraphs_with_headings/output.pdf b/tests/output/test_write_paragraphs_with_headings/output.pdf index f2c8986c4..9d807f831 100644 Binary files a/tests/output/test_write_paragraphs_with_headings/output.pdf and b/tests/output/test_write_paragraphs_with_headings/output.pdf differ diff --git a/tests/output/test_write_pdf_a_1b/output_001.pdf b/tests/output/test_write_pdf_a_1b/output_001.pdf index 119e0f29e..34a595772 100644 Binary files a/tests/output/test_write_pdf_a_1b/output_001.pdf and b/tests/output/test_write_pdf_a_1b/output_001.pdf differ diff --git a/tests/output/test_write_pdf_a_1b/output_002.pdf b/tests/output/test_write_pdf_a_1b/output_002.pdf index 4b2a92774..037d24e01 100644 Binary files a/tests/output/test_write_pdf_a_1b/output_002.pdf and b/tests/output/test_write_pdf_a_1b/output_002.pdf differ diff --git a/tests/output/test_write_pil_image/output.pdf b/tests/output/test_write_pil_image/output.pdf index bfe9aeb09..51a1df6b1 100644 Binary files a/tests/output/test_write_pil_image/output.pdf and b/tests/output/test_write_pil_image/output.pdf differ diff --git a/tests/output/test_write_png_image_by_url/output.pdf b/tests/output/test_write_png_image_by_url/output.pdf index fc282b111..442869130 100644 Binary files a/tests/output/test_write_png_image_by_url/output.pdf and b/tests/output/test_write_png_image_by_url/output.pdf differ diff --git a/tests/output/test_write_push_button/output_001.pdf b/tests/output/test_write_push_button/output_001.pdf index e683017eb..9594b3189 100644 Binary files a/tests/output/test_write_push_button/output_001.pdf and b/tests/output/test_write_push_button/output_001.pdf differ diff --git a/tests/output/test_write_push_button/output_002.pdf b/tests/output/test_write_push_button/output_002.pdf index 6e44bfdb5..f89603002 100644 Binary files a/tests/output/test_write_push_button/output_002.pdf and b/tests/output/test_write_push_button/output_002.pdf differ diff --git a/tests/output/test_write_push_button/output_003.pdf b/tests/output/test_write_push_button/output_003.pdf index 081248a94..8d4ad7e11 100644 Binary files a/tests/output/test_write_push_button/output_003.pdf and b/tests/output/test_write_push_button/output_003.pdf differ diff --git a/tests/output/test_write_radar_plot/output.pdf b/tests/output/test_write_radar_plot/output.pdf index 9de1a7c9f..8b85534fd 100644 Binary files a/tests/output/test_write_radar_plot/output.pdf and b/tests/output/test_write_radar_plot/output.pdf differ diff --git a/tests/output/test_write_rectangular_hitomezashi/output.pdf b/tests/output/test_write_rectangular_hitomezashi/output.pdf index 33eb56abe..11f1d90b3 100644 Binary files a/tests/output/test_write_rectangular_hitomezashi/output.pdf and b/tests/output/test_write_rectangular_hitomezashi/output.pdf differ diff --git a/tests/output/test_write_rectangular_maze/output.pdf b/tests/output/test_write_rectangular_maze/output.pdf index c40301014..d4798765f 100644 Binary files a/tests/output/test_write_rectangular_maze/output.pdf and b/tests/output/test_write_rectangular_maze/output.pdf differ diff --git a/tests/output/test_write_single_line_justified_full/output_001.pdf b/tests/output/test_write_single_line_justified_full/output_001.pdf index 9ef6ad18b..629f963d0 100644 Binary files a/tests/output/test_write_single_line_justified_full/output_001.pdf and b/tests/output/test_write_single_line_justified_full/output_001.pdf differ diff --git a/tests/output/test_write_single_line_justified_full/output_002.pdf b/tests/output/test_write_single_line_justified_full/output_002.pdf index 31a42dc87..291830dd9 100644 Binary files a/tests/output/test_write_single_line_justified_full/output_002.pdf and b/tests/output/test_write_single_line_justified_full/output_002.pdf differ diff --git a/tests/output/test_write_table_with_col_span/output.pdf b/tests/output/test_write_table_with_col_span/output.pdf index dbf12fdac..07f31bb28 100644 Binary files a/tests/output/test_write_table_with_col_span/output.pdf and b/tests/output/test_write_table_with_col_span/output.pdf differ diff --git a/tests/output/test_write_table_with_image/output.pdf b/tests/output/test_write_table_with_image/output.pdf index 228080d24..87e1a0df3 100644 Binary files a/tests/output/test_write_table_with_image/output.pdf and b/tests/output/test_write_table_with_image/output.pdf differ diff --git a/tests/output/test_write_table_with_non_black_paragraphs/output.pdf b/tests/output/test_write_table_with_non_black_paragraphs/output.pdf index 7f9e9663d..17db47082 100644 Binary files a/tests/output/test_write_table_with_non_black_paragraphs/output.pdf and b/tests/output/test_write_table_with_non_black_paragraphs/output.pdf differ diff --git a/tests/output/test_write_table_with_rainbow_background/output.pdf b/tests/output/test_write_table_with_rainbow_background/output.pdf index 4ba3599af..918efd322 100644 Binary files a/tests/output/test_write_table_with_rainbow_background/output.pdf and b/tests/output/test_write_table_with_rainbow_background/output.pdf differ diff --git a/tests/output/test_write_table_with_row_span/output.pdf b/tests/output/test_write_table_with_row_span/output.pdf index 9aa5d288c..b9f3b956f 100644 Binary files a/tests/output/test_write_table_with_row_span/output.pdf and b/tests/output/test_write_table_with_row_span/output.pdf differ diff --git a/tests/output/test_write_table_with_special_characters/output.pdf b/tests/output/test_write_table_with_special_characters/output.pdf index 05d77daf7..b4b7dcf1a 100644 Binary files a/tests/output/test_write_table_with_special_characters/output.pdf and b/tests/output/test_write_table_with_special_characters/output.pdf differ diff --git a/tests/output/test_write_tents_and_trees/output.pdf b/tests/output/test_write_tents_and_trees/output.pdf index 5108309ed..410ed614d 100644 Binary files a/tests/output/test_write_tents_and_trees/output.pdf and b/tests/output/test_write_tents_and_trees/output.pdf differ diff --git a/tests/output/test_write_text_area/output_001.pdf b/tests/output/test_write_text_area/output_001.pdf index eec48e0f1..64064a00a 100644 Binary files a/tests/output/test_write_text_area/output_001.pdf and b/tests/output/test_write_text_area/output_001.pdf differ diff --git a/tests/output/test_write_text_area/output_002.pdf b/tests/output/test_write_text_area/output_002.pdf index 977bf5fbe..dbe80673e 100644 Binary files a/tests/output/test_write_text_area/output_002.pdf and b/tests/output/test_write_text_area/output_002.pdf differ diff --git a/tests/output/test_write_text_field/output_001.pdf b/tests/output/test_write_text_field/output_001.pdf index 021d3c615..5c24182fa 100644 Binary files a/tests/output/test_write_text_field/output_001.pdf and b/tests/output/test_write_text_field/output_001.pdf differ diff --git a/tests/output/test_write_text_field/output_002.pdf b/tests/output/test_write_text_field/output_002.pdf index 69a95845a..5d958cb5c 100644 Binary files a/tests/output/test_write_text_field/output_002.pdf and b/tests/output/test_write_text_field/output_002.pdf differ diff --git a/tests/output/test_write_unordered_list/output.pdf b/tests/output/test_write_unordered_list/output.pdf index 82b81b135..65864d505 100644 Binary files a/tests/output/test_write_unordered_list/output.pdf and b/tests/output/test_write_unordered_list/output.pdf differ diff --git a/tests/output/test_write_using_low_level_instructions/output.pdf b/tests/output/test_write_using_low_level_instructions/output.pdf index 05ff7fed9..584f8bcb5 100644 Binary files a/tests/output/test_write_using_low_level_instructions/output.pdf and b/tests/output/test_write_using_low_level_instructions/output.pdf differ diff --git a/tests/output/test_write_with_truetype_font/output_001.pdf b/tests/output/test_write_with_truetype_font/output_001.pdf index 82aabd7cd..6b8d175b5 100644 Binary files a/tests/output/test_write_with_truetype_font/output_001.pdf and b/tests/output/test_write_with_truetype_font/output_001.pdf differ diff --git a/tests/output/test_write_with_truetype_font/output_002.pdf b/tests/output/test_write_with_truetype_font/output_002.pdf index 345adbf3e..7c63a3d71 100644 Binary files a/tests/output/test_write_with_truetype_font/output_002.pdf and b/tests/output/test_write_with_truetype_font/output_002.pdf differ diff --git a/tests/output/test_write_with_truetype_font/output_002.png b/tests/output/test_write_with_truetype_font/output_002.png index 781f8a194..a8b2d1b3f 100644 Binary files a/tests/output/test_write_with_truetype_font/output_002.png and b/tests/output/test_write_with_truetype_font/output_002.png differ diff --git a/tests/output/test_write_with_truetype_font/output_003.pdf b/tests/output/test_write_with_truetype_font/output_003.pdf index 16d7c167a..fd520dafe 100644 Binary files a/tests/output/test_write_with_truetype_font/output_003.pdf and b/tests/output/test_write_with_truetype_font/output_003.pdf differ diff --git a/tests/output/test_write_with_truetype_font/output_004.pdf b/tests/output/test_write_with_truetype_font/output_004.pdf index b5c1d32bc..6290e3a9f 100644 Binary files a/tests/output/test_write_with_truetype_font/output_004.pdf and b/tests/output/test_write_with_truetype_font/output_004.pdf differ diff --git a/tests/output/test_write_xl_image/output.pdf b/tests/output/test_write_xl_image/output.pdf index c3a7e99d6..fd28bb6a5 100644 Binary files a/tests/output/test_write_xl_image/output.pdf and b/tests/output/test_write_xl_image/output.pdf differ diff --git a/tests/pdf/canvas/layout/forms/test_write_push_button.py b/tests/pdf/canvas/layout/forms/test_write_push_button.py index fcbe4953e..e0a5db56c 100644 --- a/tests/pdf/canvas/layout/forms/test_write_push_button.py +++ b/tests/pdf/canvas/layout/forms/test_write_push_button.py @@ -175,6 +175,7 @@ def test_write_javascript_push_button_using_layout_manager(self): text="Hello World!", javascript="app.alert('Hello World', 3)", horizontal_alignment=Alignment.RIGHT, + margin_top=Decimal(10) ) ) diff --git a/tests/pdf/canvas/layout/forms/test_write_text_field.py b/tests/pdf/canvas/layout/forms/test_write_text_field.py index f71a467b3..7aa40a449 100644 --- a/tests/pdf/canvas/layout/forms/test_write_text_field.py +++ b/tests/pdf/canvas/layout/forms/test_write_text_field.py @@ -145,11 +145,11 @@ def test_check_acroform_value(self): assert doc is not None assert doc.get_page(0).has_acroforms() - assert doc.get_page(0).has_form_field("Field 1") + assert doc.get_page(0).has_form_field("field-000") - doc.get_page(0).set_form_field_value("Field 1", "Lipsum") + doc.get_page(0).set_form_field_value("field-000", "Lipsum") - assert doc.get_page(0).get_form_field_value("Field 1") == "Lipsum" + assert doc.get_page(0).get_form_field_value("field-000") == "Lipsum" if __name__ == "__main__": diff --git a/tests/pdf/document/fix_broken/__init__.py b/tests/pdf/document/fix_broken/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/pdf/document/fix_broken/test_fix_broken_xref.py b/tests/pdf/document/fix_broken/test_fix_broken_xref.py new file mode 100644 index 000000000..ddbe07c3b --- /dev/null +++ b/tests/pdf/document/fix_broken/test_fix_broken_xref.py @@ -0,0 +1,105 @@ +import typing +import unittest +from datetime import datetime +from decimal import Decimal +from pathlib import Path + +from borb.pdf.canvas.layout.table.fixed_column_width_table import FixedColumnWidthTable as Table +from borb.pdf.canvas.layout.page_layout.multi_column_layout import SingleColumnLayout +from borb.pdf.canvas.layout.text.paragraph import Paragraph +from borb.pdf.document.document import Document +from borb.pdf.page.page import Page +from borb.pdf.pdf import PDF +from borb.toolkit.text.simple_text_extraction import SimpleTextExtraction + + +class TestRemovePage(unittest.TestCase): + def __init__(self, methodName="runTest"): + super().__init__(methodName) + # find output dir + p: Path = Path(__file__).parent + while "output" not in [x.stem for x in p.iterdir() if x.is_dir()]: + p = p.parent + p = p / "output" + self.output_dir = Path(p, Path(__file__).stem.replace(".py", "")) + if not self.output_dir.exists(): + self.output_dir.mkdir() + + def test_create_document(self): + + # create document + pdf = Document() + + # add page + page = Page() + pdf.append_page(page) + + # add test information + layout = SingleColumnLayout(page) + layout.add( + Table(number_of_columns=2, number_of_rows=3) + .add(Paragraph("Date", font="Helvetica-Bold")) + .add(Paragraph(datetime.now().strftime("%d/%m/%Y, %H:%M:%S"))) + .add(Paragraph("Test", font="Helvetica-Bold")) + .add(Paragraph(Path(__file__).stem)) + .add(Paragraph("Description", font="Helvetica-Bold")) + .add( + Paragraph( + "This test creates a PDF with 1 page. Subsequent tests then screw up the XREF." + ) + ) + .set_padding_on_all_cells(Decimal(2), Decimal(2), Decimal(2), Decimal(2)) + ) + + # determine output location + out_file = self.output_dir / "output_001.pdf" + + # attempt to store PDF + with open(out_file, "wb") as in_file_handle: + PDF.dumps(in_file_handle, pdf) + + + def test_break_document(self): + # read input document + bytes_in: bytes = b"" + with open(self.output_dir / "output_001.pdf", "rb") as pdf_in_file_handle: + bytes_in = pdf_in_file_handle.read() + + # randomly insert spaces + with open(self.output_dir / "output_002.pdf", "wb") as pdf_out_file_handle: + i: int = 0 + while i < len(bytes_in): + + # 1 0 obj + if 48 <= bytes_in[i] <= 57 and bytes_in[i+1] == 32 and 48 <= bytes_in[i+2] <= 57 and bytes_in[i+3] == 32 and bytes_in[i+4] == 111 and bytes_in[i+5] == 98 and bytes_in[i+6] == 106: + pdf_out_file_handle.write(b"\n") + pdf_out_file_handle.write(b"% These bytes were added after the document was created.\n") + pdf_out_file_handle.write(b"% This causes the XREF table to be wrong.\n") + pdf_out_file_handle.write(b"\n") + pdf_out_file_handle.write(bytes_in[i:i+7]) + i += 7 + continue + + # regular + pdf_out_file_handle.write(bytes_in[i:i+1]) + i += 1 + + def test_read_broken_document(self): + + # read input document + doc: typing.Optional[Document] = None + l: SimpleTextExtraction = SimpleTextExtraction() + with open(self.output_dir / "output_002.pdf", "rb") as pdf_in_file_handle: + doc = PDF.loads(pdf_in_file_handle, [l]) + + # read info properties + assert doc.get_document_info().get_producer() == 'borb' + + # check number of pages + assert doc.get_document_info().get_number_of_pages() == 1 + + # check text + txt: str = l.get_text_for_page(0) + assert 'test_fix_broken_xref' in txt + assert 'Description This test creates a PDF with 1 page.' in txt + assert 'Subsequent tests then screw up the XREF.' in txt \ No newline at end of file diff --git a/tests/toolkit/text/test_part_of_speech_tagger.py b/tests/toolkit/text/test_part_of_speech_tagger.py deleted file mode 100644 index 3daaa162d..000000000 --- a/tests/toolkit/text/test_part_of_speech_tagger.py +++ /dev/null @@ -1,110 +0,0 @@ -import json -import typing -import unittest -from pathlib import Path - -from borb.toolkit.text.bigram_part_of_speech_tagger import BigramPartOfSpeechTagger - -unittest.TestLoader.sortTestMethodsUsing = None - - -class TestPartOfSpeechTagger(unittest.TestCase): - def test_part_of_speech_tagger_001(self): - t: BigramPartOfSpeechTagger = BigramPartOfSpeechTagger() - - # load - pos_path: Path = Path(__file__).parent / "bigram_part_of_speech_tagger_en.json" - with open(pos_path, "r") as json_file_handle: - t.from_json(json.loads(json_file_handle.read())) - - # tag - toks: typing.List[str] = [ - "A", - "big", - "yellow", - "taxi", - "took", - "my", - "girl", - "away", - ".", - ] - tags: typing.List[str] = t.tag_list_str(toks) - assert tags == ["at", "jj", "jj", "nn", "vbd", "pp$", "nn", "rb", "."] - - def test_part_of_speech_tagger_002(self): - t: BigramPartOfSpeechTagger = BigramPartOfSpeechTagger() - - # load - pos_path: Path = Path(__file__).parent / "bigram_part_of_speech_tagger_en.json" - with open(pos_path, "r") as json_file_handle: - t.from_json(json.loads(json_file_handle.read())) - - # tag - toks: typing.List[str] = [ - "Pity", - "the", - "living", - ",", - "and", - ",", - "above", - "all", - "those", - "who", - "live", - "without", - "love", - ".", - ] - tags: typing.List[str] = t.tag_list_str(toks) - assert tags == [ - "vb", - "at", - "nn", - ",", - "cc", - ",", - "in", - "abn", - "dts", - "wps", - "vb", - "in", - "nn", - ".", - ] - - def test_part_of_speech_tagger_003(self): - t: BigramPartOfSpeechTagger = BigramPartOfSpeechTagger() - - # load - pos_path: Path = Path(__file__).parent / "bigram_part_of_speech_tagger_en.json" - with open(pos_path, "r") as json_file_handle: - t.from_json(json.loads(json_file_handle.read())) - - # tag - tokens_and_tags: typing.List[typing.Tuple[str, str]] = t.tag_str( - "Pity the living, and, above all those who live without love." - ) - tags: typing.List[str] = [x[1] for x in tokens_and_tags] - assert tags == [ - "vb", - "at", - "nn", - ",", - "cc", - ",", - "in", - "abn", - "dts", - "wps", - "vb", - "in", - "nn", - ".", - ] - - -if __name__ == "__main__": - unittest.main()