diff --git a/LICENSE.md b/LICENSE similarity index 53% rename from LICENSE.md rename to LICENSE index 6124431c9..f288702d2 100644 --- a/LICENSE.md +++ b/LICENSE @@ -1,127 +1,137 @@ -GNU Affero General Public License -================================= + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 -_Version 3, 19 November 2007_ -_Copyright © 2007 Free Software Foundation, Inc. <>_ + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. -Everyone is permitted to copy and distribute verbatim copies -of this license document, but changing it is not allowed. + Preamble -## Preamble + The GNU General Public License is a free, copyleft license for +software and other kinds of works. -The GNU Affero General Public License is a free, copyleft license for -software and other kinds of works, specifically designed to ensure -cooperation with the community in the case of network server software. - -The licenses for most software and other practical works are designed + The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, -our General Public Licenses are intended to guarantee your freedom to +the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free -software for all its users. +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. -When we speak of free software, we are referring to freedom, not + When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. -Developers that use our General Public Licenses protect your rights -with two steps: **(1)** assert copyright on the software, and **(2)** offer -you this License which gives you legal permission to copy, distribute -and/or modify the software. - -A secondary benefit of defending all users' freedom is that -improvements made in alternate versions of the program, if they -receive widespread use, become available for other developers to -incorporate. Many developers of free software are heartened and -encouraged by the resulting cooperation. However, in the case of -software used on network servers, this result may fail to come about. -The GNU General Public License permits making a modified version and -letting the public access it on a server without ever releasing its -source code to the public. - -The GNU Affero General Public License is designed specifically to -ensure that, in such cases, the modified source code becomes available -to the community. It requires the operator of a network server to -provide the source code of the modified version running there to the -users of that server. Therefore, public use of a modified version, on -a publicly accessible server, gives the public access to the source -code of the modified version. - -An older license, called the Affero General Public License and -published by Affero, was designed to accomplish similar goals. This is -a different license, not a version of the Affero GPL, but Affero has -released a new version of the Affero GPL which permits relicensing under -this license. - -The precise terms and conditions for copying, distribution and + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and modification follow. -## TERMS AND CONDITIONS + TERMS AND CONDITIONS -### 0. Definitions + 0. Definitions. -“This License” refers to version 3 of the GNU Affero General Public License. + "This License" refers to version 3 of the GNU General Public License. -“Copyright” also means copyright-like laws that apply to other kinds of + "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. -“The Program” refers to any copyrightable work licensed under this -License. Each licensee is addressed as “you”. “Licensees” and -“recipients” may be individuals or organizations. + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. -To “modify” a work means to copy from or adapt all or part of the work + To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a “modified version” of the -earlier work or a work “based on” the earlier work. +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. -A “covered work” means either the unmodified Program or a work based + A "covered work" means either the unmodified Program or a work based on the Program. -To “propagate” a work means to do anything with it that, without + To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. -To “convey” a work means any kind of propagation that enables other + To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. -An interactive user interface displays “Appropriate Legal Notices” + An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible -feature that **(1)** displays an appropriate copyright notice, and **(2)** +feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. -### 1. Source Code + 1. Source Code. -The “source code” for a work means the preferred form of the work -for making modifications to it. “Object code” means any non-source + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source form of a work. -A “Standard Interface” means an interface that either is an official + A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. -The “System Libraries” of an executable work include anything, other -than the work as a whole, that **(a)** is included in the normal form of + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major -Component, and **(b)** serves only to enable use of the work with that +Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A -“Major Component”, in this context, means a major essential component +"Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. -The “Corresponding Source” for a work in object code form means all + The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's @@ -134,16 +144,16 @@ linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. -The Corresponding Source need not include anything that users + The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. -The Corresponding Source for a work in source code form is that + The Corresponding Source for a work in source code form is that same work. -### 2. Basic Permissions + 2. Basic Permissions. -All rights granted under this License are granted for the term of + All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a @@ -151,7 +161,7 @@ covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. -You may make, run and propagate covered works that you do not + You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you @@ -162,19 +172,19 @@ for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. -Conveying under any other circumstances is permitted solely under + Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. -### 3. Protecting Users' Legal Rights From Anti-Circumvention Law + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. -No covered work shall be deemed part of an effective technological + No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. -When you convey a covered work, you waive any legal power to forbid + When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or @@ -182,9 +192,9 @@ modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. -### 4. Conveying Verbatim Copies + 4. Conveying Verbatim Copies. -You may convey verbatim copies of the Program's source code as you + You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any @@ -192,97 +202,104 @@ non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. -You may charge any price or no price for each copy that you convey, + You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. -### 5. Conveying Modified Source Versions + 5. Conveying Modified Source Versions. -You may convey a work based on the Program, or the modifications to + You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: -* **a)** The work must carry prominent notices stating that you modified -it, and giving a relevant date. -* **b)** The work must carry prominent notices stating that it is -released under this License and any conditions added under section 7. -This requirement modifies the requirement in section 4 to -“keep intact all notices”. -* **c)** You must license the entire work, as a whole, under this -License to anyone who comes into possession of a copy. This -License will therefore apply, along with any applicable section 7 -additional terms, to the whole of the work, and all its parts, -regardless of how they are packaged. This License gives no -permission to license the work in any other way, but it does not -invalidate such permission if you have separately received it. -* **d)** If the work has interactive user interfaces, each must display -Appropriate Legal Notices; however, if the Program has interactive -interfaces that do not display Appropriate Legal Notices, your -work need not make them do so. - -A compilation of a covered work with other separate and independent + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an -“aggregate” if the compilation and its resulting copyright are not +"aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. -### 6. Conveying Non-Source Forms + 6. Conveying Non-Source Forms. -You may convey a covered work in object code form under the terms + You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: -* **a)** Convey the object code in, or embodied in, a physical product -(including a physical distribution medium), accompanied by the -Corresponding Source fixed on a durable physical medium -customarily used for software interchange. -* **b)** Convey the object code in, or embodied in, a physical product -(including a physical distribution medium), accompanied by a -written offer, valid for at least three years and valid for as -long as you offer spare parts or customer support for that product -model, to give anyone who possesses the object code either **(1)** a -copy of the Corresponding Source for all the software in the -product that is covered by this License, on a durable physical -medium customarily used for software interchange, for a price no -more than your reasonable cost of physically performing this -conveying of source, or **(2)** access to copy the -Corresponding Source from a network server at no charge. -* **c)** Convey individual copies of the object code with a copy of the -written offer to provide the Corresponding Source. This -alternative is allowed only occasionally and noncommercially, and -only if you received the object code with such an offer, in accord -with subsection 6b. -* **d)** Convey the object code by offering access from a designated -place (gratis or for a charge), and offer equivalent access to the -Corresponding Source in the same way through the same place at no -further charge. You need not require recipients to copy the -Corresponding Source along with the object code. If the place to -copy the object code is a network server, the Corresponding Source -may be on a different server (operated by you or a third party) -that supports equivalent copying facilities, provided you maintain -clear directions next to the object code saying where to find the -Corresponding Source. Regardless of what server hosts the -Corresponding Source, you remain obligated to ensure that it is -available for as long as needed to satisfy these requirements. -* **e)** Convey the object code using peer-to-peer transmission, provided -you inform other peers where the object code and Corresponding -Source of the work are being offered to the general public at no -charge under subsection 6d. - -A separable portion of the object code, whose source code is excluded + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. -A “User Product” is either **(1)** a “consumer product”, which means any + A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, -or household purposes, or **(2)** anything designed or sold for incorporation +or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, “normally used” refers to a +product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product @@ -290,7 +307,7 @@ is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. -“Installation Information” for a User Product means any methods, + "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must @@ -298,7 +315,7 @@ suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. -If you convey an object code work under this section in, or with, or + If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a @@ -309,7 +326,7 @@ if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). -The requirement to provide Installation Information does not include a + The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a @@ -317,15 +334,15 @@ network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. -Corresponding Source conveyed, and Installation Information provided, + Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. -### 7. Additional Terms + 7. Additional Terms. -“Additional permissions” are terms that supplement the terms of this + "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent @@ -334,37 +351,42 @@ apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. -When you convey a copy of a covered work, you may at your option + When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. -Notwithstanding any other provision of this License, for material you + Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: -* **a)** Disclaiming warranty or limiting liability differently from the -terms of sections 15 and 16 of this License; or -* **b)** Requiring preservation of specified reasonable legal notices or -author attributions in that material or in the Appropriate Legal -Notices displayed by works containing it; or -* **c)** Prohibiting misrepresentation of the origin of that material, or -requiring that modified versions of such material be marked in -reasonable ways as different from the original version; or -* **d)** Limiting the use for publicity purposes of names of licensors or -authors of the material; or -* **e)** Declining to grant rights under trademark law for use of some -trade names, trademarks, or service marks; or -* **f)** Requiring indemnification of licensors and authors of that -material by anyone who conveys the material (or modified versions of -it) with contractual assumptions of liability to the recipient, for -any liability that these contractual assumptions directly impose on -those licensors and authors. - -All other non-permissive additional terms are considered “further -restrictions” within the meaning of section 10. If the Program as you + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains @@ -373,46 +395,46 @@ License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. -If you add terms to a covered work in accord with this section, you + If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. -Additional terms, permissive or non-permissive, may be stated in the + Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. -### 8. Termination + 8. Termination. -You may not propagate or modify a covered work except as expressly + You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). -However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated **(a)** + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and **(b)** permanently, if the copyright +finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. -Moreover, your license from a particular copyright holder is + Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. -Termination of your rights under this section does not terminate the + Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. -### 9. Acceptance Not Required for Having Copies + 9. Acceptance Not Required for Having Copies. -You are not required to accept this License in order to receive or + You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, @@ -421,14 +443,14 @@ modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. -### 10. Automatic Licensing of Downstream Recipients + 10. Automatic Licensing of Downstream Recipients. -Each time you convey a covered work, the recipient automatically + Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. -An “entity transaction” is a transaction transferring control of an + An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that @@ -438,7 +460,7 @@ give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. -You may not impose any further restrictions on the exercise of the + You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation @@ -446,49 +468,49 @@ rights granted under this License, and you may not initiate litigation any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. -### 11. Patents + 11. Patents. -A “contributor” is a copyright holder who authorizes use under this + A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's “contributor version”. +work thus licensed is called the contributor's "contributor version". -A contributor's “essential patent claims” are all patent claims + A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For -purposes of this definition, “control” includes the right to grant +purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. -Each contributor grants you a non-exclusive, worldwide, royalty-free + Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. -In the following three paragraphs, a “patent license” is any express + In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to -sue for patent infringement). To “grant” such a patent license to a +sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. -If you convey a covered work, knowingly relying on a patent license, + If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, -then you must either **(1)** cause the Corresponding Source to be so -available, or **(2)** arrange to deprive yourself of the benefit of the -patent license for this particular work, or **(3)** arrange, in a manner +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent -license to downstream recipients. “Knowingly relying” means you have +license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. -If, pursuant to or in connection with a single transaction or + If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify @@ -496,7 +518,7 @@ or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. -A patent license is “discriminatory” if it does not include within + A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered @@ -505,19 +527,19 @@ in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory -patent license **(a)** in connection with copies of the covered work -conveyed by you (or copies made from those copies), or **(b)** primarily +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. -Nothing in this License shall be construed as excluding or limiting + Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. -### 12. No Surrender of Others' Freedom + 12. No Surrender of Others' Freedom. -If conditions are imposed on you (whether by court order, agreement or + If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this @@ -527,67 +549,57 @@ to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. -### 13. Remote Network Interaction; Use with the GNU General Public License - -Notwithstanding any other provision of this License, if you modify the -Program, your modified version must prominently offer all users -interacting with it remotely through a computer network (if your version -supports such interaction) an opportunity to receive the Corresponding -Source of your version by providing access to the Corresponding Source -from a network server at no charge, through some standard or customary -means of facilitating copying of software. This Corresponding Source -shall include the Corresponding Source for any work covered by version 3 -of the GNU General Public License that is incorporated pursuant to the -following paragraph. + 13. Use with the GNU Affero General Public License. -Notwithstanding any other provision of this License, you have + Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed -under version 3 of the GNU General Public License into a single +under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, -but the work with which it is combined will remain governed by version -3 of the GNU General Public License. +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. -### 14. Revised Versions of this License + 14. Revised Versions of this License. -The Free Software Foundation may publish revised and/or new versions of -the GNU Affero General Public License from time to time. Such new versions -will be similar in spirit to the present version, but may differ in detail to + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU Affero General -Public License “or any later version” applies to it, you have the + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the -GNU Affero General Public License, you may choose any version ever published +GNU General Public License, you may choose any version ever published by the Free Software Foundation. -If the Program specifies that a proxy can decide which future -versions of the GNU Affero General Public License can be used, that proxy's + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. -Later license versions may give you additional or different + Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. -### 15. Disclaimer of Warranty + 15. Disclaimer of Warranty. -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. -### 16. Limitation of Liability + 16. Limitation of Liability. -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE @@ -597,55 +609,66 @@ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -### 17. Interpretation of Sections 15 and 16 + 17. Interpretation of Sections 15 and 16. -If the disclaimer of warranty and limitation of liability provided + If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. -_END OF TERMS AND CONDITIONS_ + END OF TERMS AND CONDITIONS -## How to Apply These Terms to Your New Programs + How to Apply These Terms to Your New Programs -If you develop a new program, and you want it to be of the greatest + If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. -To do so, attach the following notices to the program. It is safest + To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least -the “copyright” line and a pointer to where the full notice is found. +the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by + it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. + GNU General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + You should have received a copy of the GNU General Public License + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. -If your software can interact with users remotely through a computer -network, you should also make sure that it provides a way for users to -get its source. For example, if your program is a web application, its -interface could display a “Source” link that leads users to an archive -of the code. There are many ways you could offer source, and different -solutions will be better for different programs; see section 13 for the -specific requirements. - -You should also get your employer (if you work as a programmer) or school, -if any, to sign a “copyright disclaimer” for the program, if necessary. -For more information on this, and how to apply and follow the GNU AGPL, see -<>. \ No newline at end of file + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md index 6d81cf9b0..d844dd396 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# ![borb logo](https://github.com/jorisschellekens/borb/raw/master/readme_img/logo/borb_64.png) borb +# ![borb logo](https://github.com/jorisschellekens/borb/raw/master/logo/borb_64.png) borb [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) diff --git a/borb/io/read/any_object_transformer.py b/borb/io/read/any_object_transformer.py new file mode 100644 index 000000000..3763b0140 --- /dev/null +++ b/borb/io/read/any_object_transformer.py @@ -0,0 +1,98 @@ +# !/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +This implementation of ReadBaseTransformer aggregates all +other implementations of ReadBaseTransformer +""" +import io +import typing +from typing import Any, Optional, Union + +from borb.io.read.font.font_dictionary_transformer import FontDictionaryTransformer +from borb.io.read.function.function_dictionary_transformer import FunctionDictionaryTransformer +from borb.io.read.image.ccitt_fax_image_transformer import CCITTFaxImageTransformer +from borb.io.read.image.compressed_jpeg_image_transformer import CompressedJPEGImageTransformer +from borb.io.read.image.grayscale_image_transformer import GrayscaleImageTransformer +from borb.io.read.image.jbig2_image_transformer import JBIG2ImageTransformer +from borb.io.read.image.jpeg_2000_image_transformer import JPEG2000ImageTransformer +from borb.io.read.image.jpeg_image_transformer import JPEGImageTransformer +from borb.io.read.metadata.xmp_metadata_transformer import XMPMetadataTransformer +from borb.io.read.object.array_transformer import ArrayTransformer +from borb.io.read.object.dictionary_transformer import DictionaryTransformer +from borb.io.read.object.stream_transformer import StreamTransformer +from borb.io.read.page.page_dictionary_transformer import PageDictionaryTransformer +from borb.io.read.page.root_dictionary_transformer import RootDictionaryTransformer +from borb.io.read.primitive.number_transformer import NumberTransformer +from borb.io.read.primitive.string_transformer import StringTransformer +from borb.io.read.transformer import Transformer, ReadTransformerState +from borb.io.read.reference.reference_transformer import ReferenceTransformer +from borb.io.read.reference.xref_transformer import XREFTransformer +from borb.io.read.types import AnyPDFType +from borb.pdf.canvas.event.event_listener import EventListener + + +class AnyObjectTransformer(Transformer): + """ + This implementation of ReadBaseTransformer aggregates all other implementations + of ReadBaseTransformer + """ + + def __init__(self): + super().__init__() + self.add_child_transformer(XREFTransformer()) + # XMP + self.add_child_transformer(XMPMetadataTransformer()) + # fonts + self.add_child_transformer(FontDictionaryTransformer()) + # images + self.add_child_transformer(CCITTFaxImageTransformer()) + self.add_child_transformer(GrayscaleImageTransformer()) + self.add_child_transformer(JBIG2ImageTransformer()) + self.add_child_transformer(JPEG2000ImageTransformer()) + self.add_child_transformer(JPEGImageTransformer()) + self.add_child_transformer(CompressedJPEGImageTransformer()) + # pages + self.add_child_transformer(RootDictionaryTransformer()) + self.add_child_transformer(PageDictionaryTransformer()) + # references + self.add_child_transformer(ReferenceTransformer()) + # primitives + self.add_child_transformer(FunctionDictionaryTransformer()) + self.add_child_transformer(StreamTransformer()) + self.add_child_transformer(StringTransformer()) + self.add_child_transformer(NumberTransformer()) + # objects + self.add_child_transformer(DictionaryTransformer()) + self.add_child_transformer(ArrayTransformer()) + + def can_be_transformed( + self, object: Union[io.BufferedIOBase, io.RawIOBase, io.BytesIO, AnyPDFType] + ) -> bool: + """ + This function returns True if the object to be transformed can be transformed by this ReadAnyObjectTransformer + """ + return isinstance(object, io.IOBase) + + def transform( + self, + object_to_transform: Union[io.BufferedIOBase, io.RawIOBase, AnyPDFType], + parent_object: Any, + context: Optional[ReadTransformerState] = None, + event_listeners: typing.List[EventListener] = [], + ) -> Any: + """ + This function reads an object from a byte stream. + The object being read depends on the implementation of ReadAnyObjectTransformer. + """ + if context is None: + return super().transform( + object_to_transform, + parent_object, + ReadTransformerState(), + event_listeners, + ) + else: + return super().transform( + object_to_transform, parent_object, context, event_listeners + ) diff --git a/borb/io/read/font/read_font_dictionary_transformer.py b/borb/io/read/font/font_dictionary_transformer.py similarity index 93% rename from borb/io/read/font/read_font_dictionary_transformer.py rename to borb/io/read/font/font_dictionary_transformer.py index 819848110..e0026726a 100644 --- a/borb/io/read/font/read_font_dictionary_transformer.py +++ b/borb/io/read/font/font_dictionary_transformer.py @@ -2,13 +2,13 @@ # -*- coding: utf-8 -*- """ -This implementation of ReadBaseTransformer is responsible for reading a Font object +This implementation of BaseTransformer is responsible for reading a Font object """ import io import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Dictionary, Stream from borb.pdf.canvas.event.event_listener import EventListener from borb.pdf.canvas.font.composite_font.cid_font_type_0 import CIDType0Font @@ -20,13 +20,13 @@ from borb.pdf.canvas.font.simple_font.true_type_font import TrueTypeFont -class ReadFontDictionaryTransformer(ReadBaseTransformer): +class FontDictionaryTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading a Font object """ def __init__(self): - super(ReadFontDictionaryTransformer, self).__init__() + super(FontDictionaryTransformer, self).__init__() self._accept_true_type_standard_14_fonts: bool = True def can_be_transformed( diff --git a/borb/io/read/function/read_function_dictionary_transformer.py b/borb/io/read/function/function_dictionary_transformer.py similarity index 95% rename from borb/io/read/function/read_function_dictionary_transformer.py rename to borb/io/read/function/function_dictionary_transformer.py index da822f7a6..1156e6823 100644 --- a/borb/io/read/function/read_function_dictionary_transformer.py +++ b/borb/io/read/function/function_dictionary_transformer.py @@ -10,12 +10,12 @@ from typing import Any, Optional, Union from borb.io.filter.stream_decode_util import decode_stream -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Dictionary, Function, Name, Reference, Stream from borb.pdf.canvas.event.event_listener import EventListener -class FunctionDictionaryTransformer(ReadBaseTransformer): +class FunctionDictionaryTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading a Function Dictionary """ diff --git a/borb/io/read/image/read_ccitt_fax_image_transformer.py b/borb/io/read/image/ccitt_fax_image_transformer.py similarity index 94% rename from borb/io/read/image/read_ccitt_fax_image_transformer.py rename to borb/io/read/image/ccitt_fax_image_transformer.py index 5984f3d9f..f511fd596 100644 --- a/borb/io/read/image/read_ccitt_fax_image_transformer.py +++ b/borb/io/read/image/ccitt_fax_image_transformer.py @@ -9,7 +9,7 @@ import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Stream, add_base_methods from borb.pdf.canvas.event.event_listener import EventListener from PIL import Image # type: ignore [import] @@ -17,7 +17,7 @@ logger = logging.getLogger(__name__) -class ReadCCITTFaxImageTransformer(ReadBaseTransformer): +class CCITTFaxImageTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading CCITT fax images """ diff --git a/borb/io/read/image/read_compressed_jpeg_image_transformer.py b/borb/io/read/image/compressed_jpeg_image_transformer.py similarity index 95% rename from borb/io/read/image/read_compressed_jpeg_image_transformer.py rename to borb/io/read/image/compressed_jpeg_image_transformer.py index f0706432d..c1f7e7b2a 100644 --- a/borb/io/read/image/read_compressed_jpeg_image_transformer.py +++ b/borb/io/read/image/compressed_jpeg_image_transformer.py @@ -10,7 +10,7 @@ from typing import Any, Optional, Union from borb.io.filter.stream_decode_util import decode_stream -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Name, Stream, add_base_methods from borb.pdf.canvas.event.event_listener import EventListener from PIL import Image # type: ignore [import] @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) -class ReadCompressedJPEGImageTransformer(ReadBaseTransformer): +class CompressedJPEGImageTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading a jpeg image object """ diff --git a/borb/io/read/image/read_grayscale_image_transformer.py b/borb/io/read/image/grayscale_image_transformer.py similarity index 95% rename from borb/io/read/image/read_grayscale_image_transformer.py rename to borb/io/read/image/grayscale_image_transformer.py index 62264b9ad..011b3b1fb 100644 --- a/borb/io/read/image/read_grayscale_image_transformer.py +++ b/borb/io/read/image/grayscale_image_transformer.py @@ -10,7 +10,7 @@ from typing import Any, Optional, Union from borb.io.filter.stream_decode_util import decode_stream -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Reference, Stream, add_base_methods from borb.pdf.canvas.event.event_listener import EventListener from PIL import Image # type: ignore [import] @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) -class ReadGrayscaleImageTransformer(ReadBaseTransformer): +class GrayscaleImageTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading a grayscale image object """ diff --git a/borb/io/read/image/read_jbig2_image_transformer.py b/borb/io/read/image/jbig2_image_transformer.py similarity index 94% rename from borb/io/read/image/read_jbig2_image_transformer.py rename to borb/io/read/image/jbig2_image_transformer.py index 6cec6d02e..cec5fc702 100644 --- a/borb/io/read/image/read_jbig2_image_transformer.py +++ b/borb/io/read/image/jbig2_image_transformer.py @@ -9,7 +9,7 @@ import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Stream, add_base_methods from borb.pdf.canvas.event.event_listener import EventListener from PIL import Image # type: ignore [import] @@ -17,7 +17,7 @@ logger = logging.getLogger(__name__) -class ReadJBIG2ImageTransformer(ReadBaseTransformer): +class JBIG2ImageTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading a jbig2 image object """ diff --git a/borb/io/read/image/read_jpeg_2000_image_transformer.py b/borb/io/read/image/jpeg_2000_image_transformer.py similarity index 94% rename from borb/io/read/image/read_jpeg_2000_image_transformer.py rename to borb/io/read/image/jpeg_2000_image_transformer.py index 695a3a2d9..6de0ab85c 100644 --- a/borb/io/read/image/read_jpeg_2000_image_transformer.py +++ b/borb/io/read/image/jpeg_2000_image_transformer.py @@ -9,7 +9,7 @@ import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Stream, add_base_methods from borb.pdf.canvas.event.event_listener import EventListener from PIL import Image # type: ignore [import] @@ -17,7 +17,7 @@ logger = logging.getLogger(__name__) -class ReadJPEG2000ImageTransformer(ReadBaseTransformer): +class JPEG2000ImageTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading a jpeg2000 image object """ diff --git a/borb/io/read/image/read_jpeg_image_transformer.py b/borb/io/read/image/jpeg_image_transformer.py similarity index 94% rename from borb/io/read/image/read_jpeg_image_transformer.py rename to borb/io/read/image/jpeg_image_transformer.py index 1d34971a9..101a8b97e 100644 --- a/borb/io/read/image/read_jpeg_image_transformer.py +++ b/borb/io/read/image/jpeg_image_transformer.py @@ -9,7 +9,7 @@ import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Stream, add_base_methods from borb.pdf.canvas.event.event_listener import EventListener from PIL import Image # type: ignore [import] @@ -17,7 +17,7 @@ logger = logging.getLogger(__name__) -class ReadJPEGImageTransformer(ReadBaseTransformer): +class JPEGImageTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading a jpeg image object """ diff --git a/borb/io/read/metadata/read_xmp_metadata_transformer.py b/borb/io/read/metadata/xmp_metadata_transformer.py similarity index 93% rename from borb/io/read/metadata/read_xmp_metadata_transformer.py rename to borb/io/read/metadata/xmp_metadata_transformer.py index 7546060d7..f62edf672 100644 --- a/borb/io/read/metadata/read_xmp_metadata_transformer.py +++ b/borb/io/read/metadata/xmp_metadata_transformer.py @@ -18,15 +18,15 @@ import xml.etree.ElementTree as ET from typing import Any, Optional, Union -from borb.io.read.object.read_stream_transformer import ReadStreamTransformer -from borb.io.read.read_base_transformer import ReadTransformerState +from borb.io.read.object.stream_transformer import StreamTransformer +from borb.io.read.transformer import ReadTransformerState from borb.io.read.types import AnyPDFType, Element, Stream from borb.pdf.canvas.event.event_listener import EventListener logger = logging.getLogger(__name__) -class ReadXMPMetadataTransformer(ReadStreamTransformer): +class XMPMetadataTransformer(StreamTransformer): """ A metadata stream may be attached to a document through the Metadata entry in the document catalogue (see 7.7.2, “Document Catalog”). The metadata framework provides a date stamp for metadata expressed in @@ -65,7 +65,7 @@ def transform( """ # delegate to super (ReadStreamTransformer) - out_value = super(ReadXMPMetadataTransformer, self).transform( + out_value = super(XMPMetadataTransformer, self).transform( object_to_transform=object_to_transform, parent_object=parent_object, context=context, diff --git a/borb/io/read/object/read_array_transformer.py b/borb/io/read/object/array_transformer.py similarity index 92% rename from borb/io/read/object/read_array_transformer.py rename to borb/io/read/object/array_transformer.py index 1de87c126..f6c3f369c 100644 --- a/borb/io/read/object/read_array_transformer.py +++ b/borb/io/read/object/array_transformer.py @@ -8,12 +8,12 @@ import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, List from borb.pdf.canvas.event.event_listener import EventListener -class ReadArrayTransformer(ReadBaseTransformer): +class ArrayTransformer(Transformer): """ This implementation of BaseTransformer converts a PDFArray to a List """ diff --git a/borb/io/read/object/read_dictionary_transformer.py b/borb/io/read/object/dictionary_transformer.py similarity index 92% rename from borb/io/read/object/read_dictionary_transformer.py rename to borb/io/read/object/dictionary_transformer.py index 2ccbcc923..956f63b7e 100644 --- a/borb/io/read/object/read_dictionary_transformer.py +++ b/borb/io/read/object/dictionary_transformer.py @@ -8,12 +8,12 @@ import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Dictionary from borb.pdf.canvas.event.event_listener import EventListener -class ReadDictionaryTransformer(ReadBaseTransformer): +class DictionaryTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading a Dictionary object """ diff --git a/borb/io/read/object/read_stream_transformer.py b/borb/io/read/object/stream_transformer.py similarity index 94% rename from borb/io/read/object/read_stream_transformer.py rename to borb/io/read/object/stream_transformer.py index 8f6af9a8d..d09fd8354 100644 --- a/borb/io/read/object/read_stream_transformer.py +++ b/borb/io/read/object/stream_transformer.py @@ -9,12 +9,12 @@ from typing import Any, Optional, Union from borb.io.filter.stream_decode_util import decode_stream -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Reference, Stream from borb.pdf.canvas.event.event_listener import EventListener -class ReadStreamTransformer(ReadBaseTransformer): +class StreamTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading Stream objects """ diff --git a/borb/io/read/page/read_page_dictionary_transformer.py b/borb/io/read/page/page_dictionary_transformer.py similarity index 96% rename from borb/io/read/page/read_page_dictionary_transformer.py rename to borb/io/read/page/page_dictionary_transformer.py index a738e15da..b6f38c09f 100644 --- a/borb/io/read/page/read_page_dictionary_transformer.py +++ b/borb/io/read/page/page_dictionary_transformer.py @@ -9,7 +9,7 @@ import zlib from typing import Any, Dict, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType from borb.io.read.types import Decimal as pDecimal from borb.io.read.types import Dictionary, List, Name, Stream @@ -21,7 +21,7 @@ from borb.pdf.page.page import Page -class ReadPageDictionaryTransformer(ReadBaseTransformer): +class PageDictionaryTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading Page objects """ diff --git a/borb/io/read/page/read_root_dictionary_transformer.py b/borb/io/read/page/root_dictionary_transformer.py similarity index 91% rename from borb/io/read/page/read_root_dictionary_transformer.py rename to borb/io/read/page/root_dictionary_transformer.py index c89465c74..7e2fc29ba 100644 --- a/borb/io/read/page/read_root_dictionary_transformer.py +++ b/borb/io/read/page/root_dictionary_transformer.py @@ -8,8 +8,8 @@ import typing from typing import Any, Dict, List, Optional, Union -from borb.io.read.object.read_dictionary_transformer import ReadDictionaryTransformer -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.object.dictionary_transformer import DictionaryTransformer +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Decimal, Dictionary from borb.io.read.types import List as pList from borb.io.read.types import Name @@ -17,7 +17,7 @@ from borb.pdf.page.page import Page -class ReadRootDictionaryTransformer(ReadBaseTransformer): +class RootDictionaryTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading the \Catalog object """ @@ -53,7 +53,7 @@ def transform( # convert using Dictionary transformer transformed_root_dictionary: Optional[Dictionary] = None for t in self.get_root_transformer().get_children(): - if isinstance(t, ReadDictionaryTransformer): + if isinstance(t, DictionaryTransformer): transformed_root_dictionary = t.transform( object_to_transform, parent_object, context, [] ) diff --git a/borb/io/read/primitive/read_number_transformer.py b/borb/io/read/primitive/number_transformer.py similarity index 89% rename from borb/io/read/primitive/read_number_transformer.py rename to borb/io/read/primitive/number_transformer.py index cb4533c23..7bc88eed8 100644 --- a/borb/io/read/primitive/read_number_transformer.py +++ b/borb/io/read/primitive/number_transformer.py @@ -8,12 +8,12 @@ import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Decimal from borb.pdf.canvas.event.event_listener import EventListener -class ReadNumberTransformer(ReadBaseTransformer): +class NumberTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading Decimal objects """ diff --git a/borb/io/read/primitive/read_string_transformer.py b/borb/io/read/primitive/string_transformer.py similarity index 90% rename from borb/io/read/primitive/read_string_transformer.py rename to borb/io/read/primitive/string_transformer.py index db34b78ab..7cf73dee3 100644 --- a/borb/io/read/primitive/read_string_transformer.py +++ b/borb/io/read/primitive/string_transformer.py @@ -8,12 +8,12 @@ import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, HexadecimalString, Name, String from borb.pdf.canvas.event.event_listener import EventListener -class ReadStringTransformer(ReadBaseTransformer): +class StringTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading String objects """ diff --git a/borb/io/read/read_any_object_transformer.py b/borb/io/read/read_any_object_transformer.py deleted file mode 100644 index c8d5d5ad2..000000000 --- a/borb/io/read/read_any_object_transformer.py +++ /dev/null @@ -1,116 +0,0 @@ -# !/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -This implementation of ReadBaseTransformer aggregates all -other implementations of ReadBaseTransformer -""" -import io -import typing -from typing import Any, Optional, Union - -from borb.io.read.font.read_font_dictionary_transformer import ( - ReadFontDictionaryTransformer, -) -from borb.io.read.function.read_function_dictionary_transformer import ( - FunctionDictionaryTransformer, -) -from borb.io.read.image.read_ccitt_fax_image_transformer import ( - ReadCCITTFaxImageTransformer, -) -from borb.io.read.image.read_compressed_jpeg_image_transformer import ( - ReadCompressedJPEGImageTransformer, -) -from borb.io.read.image.read_grayscale_image_transformer import ( - ReadGrayscaleImageTransformer, -) -from borb.io.read.image.read_jbig2_image_transformer import ReadJBIG2ImageTransformer -from borb.io.read.image.read_jpeg_2000_image_transformer import ( - ReadJPEG2000ImageTransformer, -) -from borb.io.read.image.read_jpeg_image_transformer import ReadJPEGImageTransformer -from borb.io.read.metadata.read_xmp_metadata_transformer import ( - ReadXMPMetadataTransformer, -) -from borb.io.read.object.read_array_transformer import ReadArrayTransformer -from borb.io.read.object.read_dictionary_transformer import ReadDictionaryTransformer -from borb.io.read.object.read_stream_transformer import ReadStreamTransformer -from borb.io.read.page.read_page_dictionary_transformer import ( - ReadPageDictionaryTransformer, -) -from borb.io.read.page.read_root_dictionary_transformer import ( - ReadRootDictionaryTransformer, -) -from borb.io.read.primitive.read_number_transformer import ReadNumberTransformer -from borb.io.read.primitive.read_string_transformer import ReadStringTransformer -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState -from borb.io.read.reference.read_reference_transformer import ReadReferenceTransformer -from borb.io.read.reference.read_xref_transformer import ReadXREFTransformer -from borb.io.read.types import AnyPDFType -from borb.pdf.canvas.event.event_listener import EventListener - - -class ReadAnyObjectTransformer(ReadBaseTransformer): - """ - This implementation of ReadBaseTransformer aggregates all other implementations - of ReadBaseTransformer - """ - - def __init__(self): - super().__init__() - self.add_child_transformer(ReadXREFTransformer()) - # XMP - self.add_child_transformer(ReadXMPMetadataTransformer()) - # fonts - self.add_child_transformer(ReadFontDictionaryTransformer()) - # images - self.add_child_transformer(ReadCCITTFaxImageTransformer()) - self.add_child_transformer(ReadGrayscaleImageTransformer()) - self.add_child_transformer(ReadJBIG2ImageTransformer()) - self.add_child_transformer(ReadJPEG2000ImageTransformer()) - self.add_child_transformer(ReadJPEGImageTransformer()) - self.add_child_transformer(ReadCompressedJPEGImageTransformer()) - # pages - self.add_child_transformer(ReadRootDictionaryTransformer()) - self.add_child_transformer(ReadPageDictionaryTransformer()) - # references - self.add_child_transformer(ReadReferenceTransformer()) - # primitives - self.add_child_transformer(FunctionDictionaryTransformer()) - self.add_child_transformer(ReadStreamTransformer()) - self.add_child_transformer(ReadStringTransformer()) - self.add_child_transformer(ReadNumberTransformer()) - # objects - self.add_child_transformer(ReadDictionaryTransformer()) - self.add_child_transformer(ReadArrayTransformer()) - - def can_be_transformed( - self, object: Union[io.BufferedIOBase, io.RawIOBase, io.BytesIO, AnyPDFType] - ) -> bool: - """ - This function returns True if the object to be transformed can be transformed by this ReadAnyObjectTransformer - """ - return isinstance(object, io.IOBase) - - def transform( - self, - object_to_transform: Union[io.BufferedIOBase, io.RawIOBase, AnyPDFType], - parent_object: Any, - context: Optional[ReadTransformerState] = None, - event_listeners: typing.List[EventListener] = [], - ) -> Any: - """ - This function reads an object from a byte stream. - The object being read depends on the implementation of ReadAnyObjectTransformer. - """ - if context is None: - return super().transform( - object_to_transform, - parent_object, - ReadTransformerState(), - event_listeners, - ) - else: - return super().transform( - object_to_transform, parent_object, context, event_listeners - ) diff --git a/borb/io/read/reference/read_reference_transformer.py b/borb/io/read/reference/reference_transformer.py similarity index 95% rename from borb/io/read/reference/read_reference_transformer.py rename to borb/io/read/reference/reference_transformer.py index 24c300a34..60a009a1d 100644 --- a/borb/io/read/reference/read_reference_transformer.py +++ b/borb/io/read/reference/reference_transformer.py @@ -10,7 +10,7 @@ import typing from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.types import AnyPDFType, Reference from borb.pdf.canvas.event.event_listener import EventListener from borb.pdf.xref.xref import XREF @@ -18,14 +18,14 @@ logger = logging.getLogger(__name__) -class ReadReferenceTransformer(ReadBaseTransformer): +class ReferenceTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading Reference objects e.g. 97 0 R """ def __init__(self): - super(ReadReferenceTransformer, self).__init__() + super(ReferenceTransformer, self).__init__() self._cache: typing.Dict[Reference, AnyPDFType] = {} self._cache_hits: int = 0 self._cache_fails: int = 0 diff --git a/borb/io/read/reference/read_xref_transformer.py b/borb/io/read/reference/xref_transformer.py similarity index 97% rename from borb/io/read/reference/read_xref_transformer.py rename to borb/io/read/reference/xref_transformer.py index d3e470532..685d2eeee 100644 --- a/borb/io/read/reference/read_xref_transformer.py +++ b/borb/io/read/reference/xref_transformer.py @@ -10,7 +10,7 @@ from decimal import Decimal from typing import Any, Optional, Union -from borb.io.read.read_base_transformer import ReadBaseTransformer, ReadTransformerState +from borb.io.read.transformer import Transformer, ReadTransformerState from borb.io.read.tokenize.high_level_tokenizer import HighLevelTokenizer from borb.io.read.types import AnyPDFType, Dictionary, Name from borb.pdf.canvas.event.event_listener import Event, EventListener @@ -36,7 +36,7 @@ class EndDocumentEvent(Event): pass -class ReadXREFTransformer(ReadBaseTransformer): +class XREFTransformer(Transformer): """ This implementation of ReadBaseTransformer is responsible for reading the XRef object """ @@ -77,10 +77,10 @@ def transform( context.root_object._event_occurred(BeginDocumentEvent()) # type: ignore [attr-defined] # remove prefix - ReadXREFTransformer._remove_prefix(context) + XREFTransformer._remove_prefix(context) # check header - ReadXREFTransformer._check_header(context) + XREFTransformer._check_header(context) # file size context.source.seek(0, os.SEEK_END) diff --git a/borb/io/read/read_base_transformer.py b/borb/io/read/transformer.py similarity index 92% rename from borb/io/read/read_base_transformer.py rename to borb/io/read/transformer.py index 66cede1c2..c46ab73fa 100644 --- a/borb/io/read/read_base_transformer.py +++ b/borb/io/read/transformer.py @@ -36,7 +36,7 @@ def __init__( self.indirect_reference_chain: typing.Set[Reference] = set() -class ReadBaseTransformer: +class Transformer: """ Base Transformer implementation. Add children to handle specific cases (transforming dictionaries, arrays, xref, etc) @@ -48,25 +48,25 @@ def __init__(self): self._level = 0 self._invocation_count = 0 - def get_children(self) -> typing.List["ReadBaseTransformer"]: + def get_children(self) -> typing.List["Transformer"]: """ This functions returns all child ReadBaseTransformers of this ReadBaseTransformer """ return self._children - def add_child_transformer(self, child_transformer: "ReadBaseTransformer") -> "ReadBaseTransformer": # type: ignore[name-defined] + def add_child_transformer(self, child_transformer: "Transformer") -> "Transformer": # type: ignore[name-defined] """ Add a child ReadBaseTransformer to this ReadBaseTransformer. Child transformers can be used to encapsulate specific object-creation/transformation logic. e.g. creating XREF, converting arrays, dictionaries, etc :param handler: the ReadBaseTransformer implementation to be added - :type handler: ReadBaseTransformer + :type handler: Transformer """ self._children.append(child_transformer) child_transformer._parent = self return self - def get_root_transformer(self) -> "ReadBaseTransformer": # type: ignore[name-defined] + def get_root_transformer(self) -> "Transformer": # type: ignore[name-defined] """ This function returns the top-level ReadBaseTransformer. This is useful when delegating calls from inside a ReadBaseTransformer to another. diff --git a/borb/io/write/any_object_transformer.py b/borb/io/write/any_object_transformer.py new file mode 100644 index 000000000..8c2e18f65 --- /dev/null +++ b/borb/io/write/any_object_transformer.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" +This implementation of WriteBaseTransformer acts as an aggregator for +its child transformers, allowing it to transform AnyPDFType +""" +import io +from typing import Optional, Union + +from borb.io.read.types import AnyPDFType +from borb.io.write.ascii_art.ascii_art_transformer import ASCIIArtTransformer +from borb.io.write.image.image_transformer import ImageTransformer +from borb.io.write.object.array_transformer import ArrayTransformer +from borb.io.write.object.dictionary_transformer import DictionaryTransformer +from borb.io.write.object.stream_transformer import StreamTransformer +from borb.io.write.page.page_transformer import PageTransformer +from borb.io.write.page.pages_transformer import PagesTransformer +from borb.io.write.primitive.boolean_transformer import BooleanTransformer +from borb.io.write.primitive.name_transformer import NameTransformer +from borb.io.write.primitive.number_transformer import NumberTransformer +from borb.io.write.primitive.string_transformer import StringTransformer +from borb.io.write.reference.reference_transformer import ReferenceTransform +from borb.io.write.reference.xref_transformer import XREFTransformer +from borb.io.write.transformer import ( + Transformer, + WriteTransformerState, +) +from borb.io.write.document.document_transformer import DocumentTransformer +from borb.io.write.xmp.xmp_transformer import XMPTransformer + + +class AnyObjectTransformer(Transformer): + """ + This implementation of WriteBaseTransformer acts as an aggregator for + its child transformers, allowing it to transform AnyPDFType + """ + + def __init__(self): + super().__init__() + # fun + self.add_child_transformer(ASCIIArtTransformer()) + # special object types + self.add_child_transformer(DocumentTransformer()) + self.add_child_transformer(XREFTransformer()) + self.add_child_transformer(PagesTransformer()) + self.add_child_transformer(PageTransformer()) + # object types + self.add_child_transformer(ArrayTransformer()) + self.add_child_transformer(StreamTransformer()) + self.add_child_transformer(DictionaryTransformer()) + self.add_child_transformer(ImageTransformer()) + self.add_child_transformer(XMPTransformer()) + # primitives + self.add_child_transformer(NameTransformer()) + self.add_child_transformer(StringTransformer()) + self.add_child_transformer(ReferenceTransform()) + self.add_child_transformer(NumberTransformer()) + self.add_child_transformer(BooleanTransformer()) + + def can_be_transformed(self, object_to_transform: AnyPDFType): + """ + This function returns True if the object to be transformed + can be transformed by this WriteBaseTransformer + """ + return False + + def transform( + self, + object_to_transform: AnyPDFType, + context: Optional[WriteTransformerState] = None, + destination: Optional[Union[io.BufferedIOBase, io.RawIOBase]] = None, + ): + """ + This method writes an (PDF) object to a byte stream + """ + if context is None: + super().transform( + object_to_transform, + WriteTransformerState( + destination=destination, root_object=object_to_transform + ), + ) + else: + super().transform(object_to_transform, context) diff --git a/borb/io/write/ascii_art/write_ascii_art_transformer.py b/borb/io/write/ascii_art/ascii_art_transformer.py similarity index 93% rename from borb/io/write/ascii_art/write_ascii_art_transformer.py rename to borb/io/write/ascii_art/ascii_art_transformer.py index 47c95414e..d87f26e90 100644 --- a/borb/io/write/ascii_art/write_ascii_art_transformer.py +++ b/borb/io/write/ascii_art/ascii_art_transformer.py @@ -8,13 +8,13 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Stream -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) -class WriteASCIIArtTransformer(WriteBaseTransformer): +class ASCIIArtTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing ASCII art in every PDF """ diff --git a/borb/io/write/ascii_art/ascii_logo.txt b/borb/io/write/ascii_art/ascii_logo.txt index ea43a33bc..8e3a68613 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.9 +borb version 2.0.9.1 Joris Schellekens diff --git a/borb/io/write/document/__init__.py b/borb/io/write/document/__init__.py new file mode 100644 index 000000000..bcf77caad --- /dev/null +++ b/borb/io/write/document/__init__.py @@ -0,0 +1,43 @@ +""" + This file is part of the borb (R) project. + Copyright (c) 2020-2040 borb Group NV + Authors: Joris Schellekens, et al. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License version 3 + as published by the Free Software Foundation with the addition of the + following permission added to Section 15 as permitted in Section 7(a): + FOR ANY PART OF THE COVERED WORK IN WHICH THE COPYRIGHT IS OWNED BY + BORB GROUP. BORB GROUP DISCLAIMS THE WARRANTY OF NON INFRINGEMENT + OF THIRD PARTY RIGHTS + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program; if not, see http://www.gnu.org/licenses or write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA, 02110-1301 USA. + + The interactive user interfaces in modified source and object code versions + of this program must display Appropriate Legal Notices, as required under + Section 5 of the GNU Affero General Public License. + In accordance with Section 7(b) of the GNU Affero General Public License, + a covered work must retain the producer line in every PDF that is created + or manipulated using borb. + + You can be released from the requirements of the license by purchasing + a commercial license. Buying such a license is mandatory as soon as you + develop commercial activities involving the borb software without + disclosing the source code of your own applications. + + These activities include: offering paid services to customers as an ASP, + serving PDFs on the fly in a web application, shipping borb with a closed + source product. + + For more information, please contact borb Software Corp. at this + address: joris.schellekens.1989@gmail.com +""" diff --git a/borb/io/write/write_pdf_transformer.py b/borb/io/write/document/document_transformer.py similarity index 94% rename from borb/io/write/write_pdf_transformer.py rename to borb/io/write/document/document_transformer.py index 810b2610d..4c414dbfd 100644 --- a/borb/io/write/write_pdf_transformer.py +++ b/borb/io/write/document/document_transformer.py @@ -18,8 +18,8 @@ Name, String, ) -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) from borb.pdf.document import Document @@ -27,7 +27,7 @@ logger = logging.getLogger(__name__) -class WritePDFTransformer(WriteBaseTransformer): +class DocumentTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing Document objects """ @@ -56,7 +56,7 @@ def transform( context.destination.write(b"\n") # invalidate all references - WritePDFTransformer._invalidate_all_references(object_to_transform) + DocumentTransformer._invalidate_all_references(object_to_transform) # create Info dictionary if needed if "Info" not in object_to_transform["XRef"]["Trailer"]: @@ -77,7 +77,7 @@ def transform( object_to_transform["XRef"]["Trailer"]["ID"].set_can_be_referenced(False) # set CreationDate - modification_date = WritePDFTransformer._timestamp_to_str() + modification_date = DocumentTransformer._timestamp_to_str() if "CreationDate" not in object_to_transform["XRef"]["Trailer"][Name("Info")]: object_to_transform["XRef"]["Trailer"][Name("Info")][ Name("CreationDate") diff --git a/borb/io/write/image/write_image_transformer.py b/borb/io/write/image/image_transformer.py similarity index 97% rename from borb/io/write/image/write_image_transformer.py rename to borb/io/write/image/image_transformer.py index 0a57700be..0abb9d106 100644 --- a/borb/io/write/image/write_image_transformer.py +++ b/borb/io/write/image/image_transformer.py @@ -11,14 +11,14 @@ from borb.io.read.types import AnyPDFType from borb.io.read.types import Decimal as pDecimal from borb.io.read.types import Name, Reference, Stream, add_base_methods -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) from PIL import Image as PILImage # type: ignore [import] -class WriteImageTransformer(WriteBaseTransformer): +class ImageTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing Image objects """ diff --git a/borb/io/write/object/write_array_transformer.py b/borb/io/write/object/array_transformer.py similarity index 96% rename from borb/io/write/object/write_array_transformer.py rename to borb/io/write/object/array_transformer.py index 52b301df9..eb202ab9c 100644 --- a/borb/io/write/object/write_array_transformer.py +++ b/borb/io/write/object/array_transformer.py @@ -9,8 +9,8 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Dictionary, List, Reference, Stream -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) from PIL.Image import Image # type: ignore [import] @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) -class WriteArrayTransformer(WriteBaseTransformer): +class ArrayTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing List objects """ diff --git a/borb/io/write/object/write_dictionary_transformer.py b/borb/io/write/object/dictionary_transformer.py similarity index 96% rename from borb/io/write/object/write_dictionary_transformer.py rename to borb/io/write/object/dictionary_transformer.py index fedb6b947..efbc134d2 100644 --- a/borb/io/write/object/write_dictionary_transformer.py +++ b/borb/io/write/object/dictionary_transformer.py @@ -9,8 +9,8 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Dictionary, Element, List, Reference, Stream -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) from PIL.Image import Image # type: ignore [import] @@ -18,7 +18,7 @@ logger = logging.getLogger(__name__) -class WriteDictionaryTransformer(WriteBaseTransformer): +class DictionaryTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing Dictionary objects """ diff --git a/borb/io/write/object/write_stream_transformer.py b/borb/io/write/object/stream_transformer.py similarity index 96% rename from borb/io/write/object/write_stream_transformer.py rename to borb/io/write/object/stream_transformer.py index 266e622a7..4ec46cb82 100644 --- a/borb/io/write/object/write_stream_transformer.py +++ b/borb/io/write/object/stream_transformer.py @@ -12,15 +12,15 @@ from borb.io.read.types import AnyPDFType from borb.io.read.types import Decimal as pDecimal from borb.io.read.types import Dictionary, List, Name, Reference, Stream -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) logger = logging.getLogger(__name__) -class WriteStreamTransformer(WriteBaseTransformer): +class StreamTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing Stream objects """ diff --git a/borb/io/write/page/write_page_transformer.py b/borb/io/write/page/page_transformer.py similarity index 85% rename from borb/io/write/page/write_page_transformer.py rename to borb/io/write/page/page_transformer.py index 43592689f..69e6c5574 100644 --- a/borb/io/write/page/write_page_transformer.py +++ b/borb/io/write/page/page_transformer.py @@ -9,14 +9,14 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Dictionary, Name -from borb.io.write.object.write_dictionary_transformer import WriteDictionaryTransformer -from borb.io.write.write_base_transformer import WriteTransformerState +from borb.io.write.object.dictionary_transformer import DictionaryTransformer +from borb.io.write.transformer import WriteTransformerState from borb.pdf.document import Document logger = logging.getLogger(__name__) -class WritePageTransformer(WriteDictionaryTransformer): +class PageTransformer(DictionaryTransformer): """ This implementation of WriteBaseTransformer is responsible for writing Dictionary objects of \Type \Page @@ -54,4 +54,4 @@ def transform( object_to_transform[k].set_can_be_referenced(False) # type: ignore [attr-defined] # delegate to super - super(WritePageTransformer, self).transform(object_to_transform, context) + super(PageTransformer, self).transform(object_to_transform, context) diff --git a/borb/io/write/page/write_pages_transformer.py b/borb/io/write/page/pages_transformer.py similarity index 85% rename from borb/io/write/page/write_pages_transformer.py rename to borb/io/write/page/pages_transformer.py index ee4dbd166..d7fa52a87 100644 --- a/borb/io/write/page/write_pages_transformer.py +++ b/borb/io/write/page/pages_transformer.py @@ -10,13 +10,13 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Dictionary, Name, Reference -from borb.io.write.object.write_dictionary_transformer import WriteDictionaryTransformer -from borb.io.write.write_base_transformer import WriteTransformerState +from borb.io.write.object.dictionary_transformer import DictionaryTransformer +from borb.io.write.transformer import WriteTransformerState logger = logging.getLogger(__name__) -class WritePagesTransformer(WriteDictionaryTransformer): +class PagesTransformer(DictionaryTransformer): """ This implementation of WriteBaseTransformer is responsible for writing Dictionary objects of \Type \Pages @@ -52,7 +52,7 @@ def transform( object_to_transform["Kids"][i] = ref # delegate to super - super(WritePagesTransformer, self).transform(object_to_transform, context) + super(PagesTransformer, self).transform(object_to_transform, context) # write \Page objects for p in queue: diff --git a/borb/io/write/primitive/write_boolean_transformer.py b/borb/io/write/primitive/boolean_transformer.py similarity index 89% rename from borb/io/write/primitive/write_boolean_transformer.py rename to borb/io/write/primitive/boolean_transformer.py index f22b46a8b..fac9effbf 100644 --- a/borb/io/write/primitive/write_boolean_transformer.py +++ b/borb/io/write/primitive/boolean_transformer.py @@ -7,13 +7,13 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Boolean -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) -class WriteBooleanTransformer(WriteBaseTransformer): +class BooleanTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing booleans """ diff --git a/borb/io/write/primitive/write_name_transformer.py b/borb/io/write/primitive/name_transformer.py similarity index 88% rename from borb/io/write/primitive/write_name_transformer.py rename to borb/io/write/primitive/name_transformer.py index 186a7a546..e75176580 100644 --- a/borb/io/write/primitive/write_name_transformer.py +++ b/borb/io/write/primitive/name_transformer.py @@ -7,13 +7,13 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Name -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) -class WriteNameTransformer(WriteBaseTransformer): +class NameTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing Name objects """ diff --git a/borb/io/write/primitive/write_number_transformer.py b/borb/io/write/primitive/number_transformer.py similarity index 90% rename from borb/io/write/primitive/write_number_transformer.py rename to borb/io/write/primitive/number_transformer.py index a145d1f2b..3571f55d2 100644 --- a/borb/io/write/primitive/write_number_transformer.py +++ b/borb/io/write/primitive/number_transformer.py @@ -7,13 +7,13 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Decimal -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) -class WriteNumberTransformer(WriteBaseTransformer): +class NumberTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing Decimal objects """ diff --git a/borb/io/write/primitive/write_string_transformer.py b/borb/io/write/primitive/string_transformer.py similarity index 92% rename from borb/io/write/primitive/write_string_transformer.py rename to borb/io/write/primitive/string_transformer.py index fad28ab70..36fd71772 100644 --- a/borb/io/write/primitive/write_string_transformer.py +++ b/borb/io/write/primitive/string_transformer.py @@ -7,13 +7,13 @@ from typing import Optional from borb.io.read.types import AnyPDFType, HexadecimalString, String -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) -class WriteStringTransformer(WriteBaseTransformer): +class StringTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing String objects """ diff --git a/borb/io/write/reference/write_reference_transformer.py b/borb/io/write/reference/reference_transformer.py similarity index 91% rename from borb/io/write/reference/write_reference_transformer.py rename to borb/io/write/reference/reference_transformer.py index be366c82d..147d44880 100644 --- a/borb/io/write/reference/write_reference_transformer.py +++ b/borb/io/write/reference/reference_transformer.py @@ -7,13 +7,13 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Reference -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) -class WriteReferenceTransform(WriteBaseTransformer): +class ReferenceTransform(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing References """ diff --git a/borb/io/write/reference/write_xref_transformer.py b/borb/io/write/reference/xref_transformer.py similarity index 97% rename from borb/io/write/reference/write_xref_transformer.py rename to borb/io/write/reference/xref_transformer.py index c80526291..692efdc1d 100644 --- a/borb/io/write/reference/write_xref_transformer.py +++ b/borb/io/write/reference/xref_transformer.py @@ -8,14 +8,14 @@ from typing import Optional from borb.io.read.types import AnyPDFType, Decimal, Dictionary, Name, Reference -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) from borb.pdf.xref.xref import XREF -class WriteXREFTransformer(WriteBaseTransformer): +class XREFTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing XREF objects """ diff --git a/borb/io/write/write_base_transformer.py b/borb/io/write/transformer.py similarity index 95% rename from borb/io/write/write_base_transformer.py rename to borb/io/write/transformer.py index 65867ab6a..8745d626f 100644 --- a/borb/io/write/write_base_transformer.py +++ b/borb/io/write/transformer.py @@ -37,7 +37,7 @@ def __init__( # fmt: on -class WriteBaseTransformer: +class Transformer: """ This class represents the base transformer for persisting a PDF Document. It allows you to add child BaseWriteTransformer implementations to handle specific cases, @@ -45,12 +45,12 @@ class WriteBaseTransformer: """ def __init__(self): - self._handlers: typing.List["WriteBaseTransformer"] = [] - self._parent: typing.Optional["WriteBaseTransformer"] = None + self._handlers: typing.List["Transformer"] = [] + self._parent: typing.Optional["Transformer"] = None def add_child_transformer( - self, handler: "WriteBaseTransformer" # type: ignore [name-defined] - ) -> "WriteBaseTransformer": # type: ignore [name-defined] + self, handler: "Transformer" # type: ignore [name-defined] + ) -> "Transformer": # type: ignore [name-defined] """ This function adds a BaseWriteTransformer to this WriteBaseTransformer. Children of this WriteBaseTransformer will be called in turn, and their @@ -63,7 +63,7 @@ def add_child_transformer( handler._parent = self return self - def get_root_transformer(self) -> "WriteBaseTransformer": # type: ignore [name-defined] + def get_root_transformer(self) -> "Transformer": # type: ignore [name-defined] """ This function returns the WriteBaseTransformer at the root of this WriteBaseTransformer hierarchy. This allows child WriteBaseTransformer implementations to call the root transformer. diff --git a/borb/io/write/write_any_object_transformer.py b/borb/io/write/write_any_object_transformer.py deleted file mode 100644 index f1bd7f190..000000000 --- a/borb/io/write/write_any_object_transformer.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -This implementation of WriteBaseTransformer acts as an aggregator for -its child transformers, allowing it to transform AnyPDFType -""" -import io -from typing import Optional, Union - -from borb.io.read.types import AnyPDFType -from borb.io.write.ascii_art.write_ascii_art_transformer import WriteASCIIArtTransformer -from borb.io.write.image.write_image_transformer import WriteImageTransformer -from borb.io.write.object.write_array_transformer import WriteArrayTransformer -from borb.io.write.object.write_dictionary_transformer import WriteDictionaryTransformer -from borb.io.write.object.write_stream_transformer import WriteStreamTransformer -from borb.io.write.page.write_page_transformer import WritePageTransformer -from borb.io.write.page.write_pages_transformer import WritePagesTransformer -from borb.io.write.primitive.write_boolean_transformer import WriteBooleanTransformer -from borb.io.write.primitive.write_name_transformer import WriteNameTransformer -from borb.io.write.primitive.write_number_transformer import WriteNumberTransformer -from borb.io.write.primitive.write_string_transformer import WriteStringTransformer -from borb.io.write.reference.write_reference_transformer import WriteReferenceTransform -from borb.io.write.reference.write_xref_transformer import WriteXREFTransformer -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, - WriteTransformerState, -) -from borb.io.write.write_pdf_transformer import WritePDFTransformer -from borb.io.write.xmp.write_xmp_transformer import WriteXMPTransformer - - -class WriteAnyObjectTransformer(WriteBaseTransformer): - """ - This implementation of WriteBaseTransformer acts as an aggregator for - its child transformers, allowing it to transform AnyPDFType - """ - - def __init__(self): - super().__init__() - # fun - self.add_child_transformer(WriteASCIIArtTransformer()) - # special object types - self.add_child_transformer(WritePDFTransformer()) - self.add_child_transformer(WriteXREFTransformer()) - self.add_child_transformer(WritePagesTransformer()) - self.add_child_transformer(WritePageTransformer()) - # object types - self.add_child_transformer(WriteArrayTransformer()) - self.add_child_transformer(WriteStreamTransformer()) - self.add_child_transformer(WriteDictionaryTransformer()) - self.add_child_transformer(WriteImageTransformer()) - self.add_child_transformer(WriteXMPTransformer()) - # primitives - self.add_child_transformer(WriteNameTransformer()) - self.add_child_transformer(WriteStringTransformer()) - self.add_child_transformer(WriteReferenceTransform()) - self.add_child_transformer(WriteNumberTransformer()) - self.add_child_transformer(WriteBooleanTransformer()) - - def can_be_transformed(self, object_to_transform: AnyPDFType): - """ - This function returns True if the object to be transformed - can be transformed by this WriteBaseTransformer - """ - return False - - def transform( - self, - object_to_transform: AnyPDFType, - context: Optional[WriteTransformerState] = None, - destination: Optional[Union[io.BufferedIOBase, io.RawIOBase]] = None, - ): - """ - This method writes an (PDF) object to a byte stream - """ - if context is None: - super().transform( - object_to_transform, - WriteTransformerState( - destination=destination, root_object=object_to_transform - ), - ) - else: - super().transform(object_to_transform, context) diff --git a/borb/io/write/xmp/write_xmp_transformer.py b/borb/io/write/xmp/xmp_transformer.py similarity index 94% rename from borb/io/write/xmp/write_xmp_transformer.py rename to borb/io/write/xmp/xmp_transformer.py index af7bf35b5..23e47b0fb 100644 --- a/borb/io/write/xmp/write_xmp_transformer.py +++ b/borb/io/write/xmp/xmp_transformer.py @@ -12,15 +12,15 @@ from borb.io.read.types import AnyPDFType from borb.io.read.types import Decimal as pDecimal from borb.io.read.types import Name, Reference, Stream -from borb.io.write.write_base_transformer import ( - WriteBaseTransformer, +from borb.io.write.transformer import ( + Transformer, WriteTransformerState, ) logger = logging.getLogger(__name__) -class WriteXMPTransformer(WriteBaseTransformer): +class XMPTransformer(Transformer): """ This implementation of WriteBaseTransformer is responsible for writing XMP meta-data information """ diff --git a/borb/pdf/canvas/font/glyph_line.py b/borb/pdf/canvas/font/glyph_line.py index 47f07fe5c..21c753316 100644 --- a/borb/pdf/canvas/font/glyph_line.py +++ b/borb/pdf/canvas/font/glyph_line.py @@ -7,7 +7,6 @@ or contribute to a specific meaning of what is written, with that meaning dependent on cultural and social usage. """ import typing -from curses.ascii import isspace from decimal import Decimal from borb.io.read.types import Decimal as pDecimal @@ -146,6 +145,10 @@ def uses_descent(self) -> bool: """ return any([(x in ["y", "p", "q", "f", "g", "j"]) for x in self.get_text()]) + @staticmethod + def _isspace(c: str) -> bool: + return ord(c) in [9, 10, 11, 12, 13, 32] + def get_width_in_text_space(self) -> Decimal: """ This function calculates the width (in text space) of this GlyphLine @@ -155,7 +158,7 @@ def get_width_in_text_space(self) -> Decimal: glyph_width_in_text_space = g.get_width() * self._font_size * Decimal(0.001) # add word spacing where applicable - if len(g.get_unicode_str()) == 1 and isspace(g.get_unicode_str()): + if len(g.get_unicode_str()) == 1 and GlyphLine._isspace(g.get_unicode_str()): glyph_width_in_text_space += self._word_spacing # horizontal scaling diff --git a/borb/pdf/pdf.py b/borb/pdf/pdf.py index 18bd8ebaf..ee8b6b662 100644 --- a/borb/pdf/pdf.py +++ b/borb/pdf/pdf.py @@ -11,8 +11,8 @@ import io from typing import List, Union -from borb.io.read.read_any_object_transformer import ReadAnyObjectTransformer -from borb.io.write.write_any_object_transformer import WriteAnyObjectTransformer +from borb.io.read.any_object_transformer import AnyObjectTransformer as ReadAnyObjectTransformer +from borb.io.write.any_object_transformer import AnyObjectTransformer as WriteAnyObjectTransformer from borb.pdf.canvas.event.event_listener import EventListener from borb.pdf.document import Document diff --git a/borb/toolkit/ocr/ocr_as_optional_content_group.py b/borb/toolkit/ocr/ocr_as_optional_content_group.py index 515913ea7..760fe7f60 100644 --- a/borb/toolkit/ocr/ocr_as_optional_content_group.py +++ b/borb/toolkit/ocr/ocr_as_optional_content_group.py @@ -12,7 +12,7 @@ from pathlib import Path from borb.datastructure.disjoint_set import disjointset -from borb.io.read.reference.read_xref_transformer import EndDocumentEvent +from borb.io.read.reference.xref_transformer import EndDocumentEvent from borb.io.read.types import Decimal as pDecimal from borb.io.read.types import Dictionary, List, Name, String from borb.pdf.canvas.event.event_listener import Event diff --git a/release_notes.md b/release_notes.md index 603e9feec..280b7a450 100644 --- a/release_notes.md +++ b/release_notes.md @@ -1,18 +1,5 @@ -# :mega: borb release 2.0.9 +# :mega: borb release 2.0.9.1 This release features: -- A small fix in `ChunksOfText` ensuring the `LayoutElement` does make unneeded copies - - I also added a few tests for the new behaviour - -- More documentation in the `Page` class (some minor work on annotations) - -- A new annotation type (or rather a convenience method for an existing annotation type): remote-go-to - - This enables you to embed links to websites in your PDF's. - - I also added a few tests for this new method. - -- Fixed a fair amount of MyPy warnings - -- Added TextRank keyword-extraction algorithm - - Implemented `BigramPartOfSpeechTagger` - - Added test(s) \ No newline at end of file +- A small fix to remove the `curses` dependency \ No newline at end of file diff --git a/setup.py b/setup.py index db002d4f4..b44614331 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ setuptools.setup( name="borb", - version="2.0.9", + version="2.0.9.1", 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/output/test_add_all_rubber_stamp_annotations/output.pdf b/tests/output/test_add_all_rubber_stamp_annotations/output.pdf index 75f581b83..8b7f7dda1 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 4f77a3f6b..7828931ea 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 d0fbc6e77..6affe8215 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 12e420d25..4524ba660 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 2672a616e..c1689be08 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 e5d216d74..b510d2ee7 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_line_annotation/output_001.pdf b/tests/output/test_add_line_annotation/output_001.pdf index b6798ed96..a22536620 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 8673f89f6..93c58a103 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 8cc3c0700..b6f0a5852 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 c66d36d56..748ff4cf1 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 2e8ac8850..09299e104 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_polygon_annotation_using_line_art_factory/output.png b/tests/output/test_add_polygon_annotation_using_line_art_factory/output.png index 9b9088624..e5dcacf83 100644 Binary files a/tests/output/test_add_polygon_annotation_using_line_art_factory/output.png and b/tests/output/test_add_polygon_annotation_using_line_art_factory/output.png 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 4834179bd..0ea605297 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 60d764eb4..d7ee6d63c 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 f5f9a6485..9d2c969e6 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 ab9839e15..e3f41c071 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 9ad31b200..83f7a7b6d 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 d4e44179f..52b7b9afe 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 d19f3e8c2..2784b33b0 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 b3098e767..771335fe5 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_square_annotation/output.pdf b/tests/output/test_add_square_annotation/output.pdf index 1b397db07..0eb010793 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 064ee88e0..eaf30947a 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 1613d4121..1e292e599 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 9b08645e0..6446060cc 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 f2c805478..4f2e12c4d 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 10ca107da..e89bb05c2 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 601f937bc..078523267 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 671793b0c..87e3aa9b5 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 84f3c84a4..fe7a9f695 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 7874b4f30..9b37efdb9 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 252a5f6b7..d7695dc14 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 09751b3ce..286410dff 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 34d759ee0..bf15f2dae 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 1d4081bda..e1badcc13 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 98f598965..71dcf7cc1 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_apply_redaction_annotations/output_001.pdf b/tests/output/test_apply_redaction_annotations/output_001.pdf index ad4a63afc..7947e6f70 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 f98d69b8e..10770fd75 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 2a1f620be..7d11e4261 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 06af0e61f..f11f0f781 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 ad0615c5b..ee0bb9867 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 a15730936..537d4f31a 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_change_info_dictionary_author/output_001.pdf b/tests/output/test_change_info_dictionary_author/output_001.pdf index 84e2079f2..c104d2c42 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 67938b569..9f7290662 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 9079e8da3..53662bd60 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 b728439cb..11f7192ec 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 b9cdcbe4f..8ffee9569 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_count_annotations/output_001.pdf b/tests/output/test_count_annotations/output_001.pdf index 1b0a37131..3d5098934 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 678cee3a2..e345e3bb9 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 8d4419a53..77196b047 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 64b8b2d15..debd47491 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 fa3b7d9b5..ecc6a56ba 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 accdf9cf7..06890cc9b 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 c8e0c3898..41213455e 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 c90978ca8..4fb74a18a 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 5b6673b28..3e4617f9c 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 7b35a3901..07ee87e52 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 fb5d5c3bc..a4b1cd6e3 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 3636dbfd8..389bb8e6b 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 cc06d2a44..72dca73a2 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 1326a30f8..f3935e0d4 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 de449d640..fe1fcddce 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 d99581868..3779c93a2 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 2065a4805..74d14c864 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_export_html_to_pdf/example_html_input_000.pdf b/tests/output/test_export_html_to_pdf/example_html_input_000.pdf index f251a3225..caa7402e3 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 022e7e327..1a54c667e 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 eb657db02..349d14f88 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 b378db8bb..c533d9917 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 d477840fa..af44e8d1c 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 4ea95aec0..7d541af33 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 98cf07739..54c90c43c 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 c747afda3..a152e8649 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 afbd13272..8df6c7868 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 e5d33af27..8696fbfc8 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 a8fca86fa..fa7fd38fc 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 f743d8286..7c21c589f 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 3abbb67b9..17594e5c3 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 93661acdc..1c1ad3bec 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 6e972444e..e61072da8 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 ea99d605d..2b2f493a8 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 a05994123..3cb4ffe11 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 5a166c8f0..b5257ce8a 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 2c6d625f7..8d85e50e2 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 5a8c1658d..f0fc2d8b3 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 887135034..5c3b571ee 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 75b6a84c1..2ab42c46f 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 c432e5eab..86d8fea7f 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 599a41142..97b20f20d 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_pdf_to_jpg/output_001.jpg b/tests/output/test_export_pdf_to_jpg/output_001.jpg index 90439eec3..4f8bf4df7 100644 Binary files a/tests/output/test_export_pdf_to_jpg/output_001.jpg and b/tests/output/test_export_pdf_to_jpg/output_001.jpg differ diff --git a/tests/output/test_export_pdf_to_jpg/output_002.jpg b/tests/output/test_export_pdf_to_jpg/output_002.jpg index 90439eec3..4f8bf4df7 100644 Binary files a/tests/output/test_export_pdf_to_jpg/output_002.jpg and b/tests/output/test_export_pdf_to_jpg/output_002.jpg differ diff --git a/tests/output/test_extract_colors/output_001.pdf b/tests/output/test_extract_colors/output_001.pdf index 66f8a1e5d..c49b038ad 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 6de8b5c25..9babcb8c7 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_courier_text/output_001.pdf b/tests/output/test_extract_courier_text/output_001.pdf index 5d8b598d8..ee3af75ec 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 82126ec64..c64a87b58 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 55af34dd7..5f0a9948d 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 f87f392ef..294601c0d 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 aea946e4a..9da185a58 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 101ddc7d2..f4b899696 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 deff0ec30..92f2e469b 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 98de6b18e..b3571dbb8 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 1b8629f8a..ed672dbd6 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 e2bbc677b..b4761cc78 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_expect_ground_truth/output.pdf b/tests/output/test_extract_text_expect_ground_truth/output.pdf index 3c8ede35b..08c9e3972 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 6585087a9..ef54b0bd1 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_extract_text_using_ocr/output_001.pdf b/tests/output/test_extract_text_using_ocr/output_001.pdf index 4e23bc4a1..69870ea9e 100644 Binary files a/tests/output/test_extract_text_using_ocr/output_001.pdf and b/tests/output/test_extract_text_using_ocr/output_001.pdf differ diff --git a/tests/output/test_line_height_parameter/output_001.pdf b/tests/output/test_line_height_parameter/output_001.pdf index c3cb595db..e1e23c114 100644 Binary files a/tests/output/test_line_height_parameter/output_001.pdf and b/tests/output/test_line_height_parameter/output_001.pdf differ diff --git a/tests/output/test_line_height_parameter/output_002.pdf b/tests/output/test_line_height_parameter/output_002.pdf index d041beb80..38dffa94f 100644 Binary files a/tests/output/test_line_height_parameter/output_002.pdf and b/tests/output/test_line_height_parameter/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 fc0e334ea..025956b61 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 45e9d8ac9..e28fffd02 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 9c15ab124..435f0641f 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_optimize_images/output_001.pdf b/tests/output/test_optimize_images/output_001.pdf index c4ed8bf72..1efdc5541 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_redact_common_regular_expressions/output_001.pdf b/tests/output/test_redact_common_regular_expressions/output_001.pdf index 29948c0f7..06170c84f 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 b15d12d78..c67efb037 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 f813172aa..67e3abd60 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 08730b17e..b980a4c68 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 2297d000e..41e3cb62b 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 5329bef6f..9971de540 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 c5b03bd1b..297f4d0a5 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 74d9fea0b..6afefc723 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 86bd45c7b..9924c91ce 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 f62c4cb8a..5b6bda648 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 b7182212e..3286e48c4 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 bca893943..99552d709 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 e4093e955..2f8e47a36 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 306682b45..8205a8df2 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 e103dd71b..ab1d07931 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 a8d0a4a0e..9a5e2e9a2 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 762b6f7d4..dfad93623 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 b15770926..086d6c78b 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 145baed04..a6a7ffe12 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 03784324e..ba5665d37 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_barcode/output.pdf b/tests/output/test_write_all_types_barcode/output.pdf index 3da1c1bb2..de0fa7b49 100644 Binary files a/tests/output/test_write_all_types_barcode/output.pdf and b/tests/output/test_write_all_types_barcode/output.pdf differ diff --git a/tests/output/test_write_battleship/output.pdf b/tests/output/test_write_battleship/output.pdf index 20840b1e5..816f3e0a0 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 641af707a..927b3d345 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 d9073e22f..dee704cb1 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 d96fb47f5..805cc9427 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 586f43aab..a32a1c08c 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 a832c27b6..433e8d79e 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 c1b184e9f..df1ee9bfe 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 ffa82884e..41d1cc3ea 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 a66daec37..4bbbe3d80 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 0c3d6c1be..234ca64ef 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 ee818c624..d4453ddfd 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 5e17c3e49..3ee77f97c 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 2e92231d1..7ecf899b8 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 5c5698ac6..f566d5550 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 57bf1b0a6..111eb4d67 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 496cd1fb4..143427a6e 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 a5e4369da..caea58bfd 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 1e7dfc29b..1295ea629 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 0258c3394..95d729225 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 539ef5694..0024f747e 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 ad65b272f..f4dfd154a 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 6766ba4fe..82c8e7271 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 03ea4e52e..6658db41e 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 2183fb061..42cbb94ee 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 da28e95a5..0bf3a440d 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 733300280..64ffbc546 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 8bb24d652..a7ae99423 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 f48525850..7d5937582 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 99ab738f3..5098f39ad 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 227302ec5..aa4f99ce9 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 08d0a49ff..bd7028a9d 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 24ba9b0f3..886bca1ea 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 454dc7cd6..ce801a6d3 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_grayscale_image/output.pdf b/tests/output/test_write_grayscale_image/output.pdf index 933e82bc1..02626deee 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_hyphenated_paragraph/output.pdf b/tests/output/test_write_hyphenated_paragraph/output.pdf index 84414a5bb..995937423 100644 Binary files a/tests/output/test_write_hyphenated_paragraph/output.pdf and b/tests/output/test_write_hyphenated_paragraph/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 8f239a1bf..8d9f99dc2 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_image_justified_center/output.pdf b/tests/output/test_write_image_justified_center/output.pdf index 89be19a12..d5610c0ce 100644 Binary files a/tests/output/test_write_image_justified_center/output.pdf and b/tests/output/test_write_image_justified_center/output.pdf differ diff --git a/tests/output/test_write_incomplete_table/output.pdf b/tests/output/test_write_incomplete_table/output.pdf index 7c1b1957e..1d25361c8 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 385bcb622..0adcaf79b 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 901d6e250..55315d248 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.pdf b/tests/output/test_write_line_of_text_justified_right/output.pdf index ddf0da722..022b80c5d 100644 Binary files a/tests/output/test_write_line_of_text_justified_right/output.pdf and b/tests/output/test_write_line_of_text_justified_right/output.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 1b207c087..28019bb7c 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 461d4bbf0..32577b552 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 86475dcfa..114e5ab90 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 87a77eeb3..c06b9025e 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 85dd50803..ca3de6caa 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_ordered_list/output_001.pdf b/tests/output/test_write_ordered_list/output_001.pdf index bd722524f..36785bf2c 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 c3c594489..547a96d78 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 705361a5d..238db7caa 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 443663913..145fa545e 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 c34cb996a..7e67fe869 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 e4161a294..eec89117c 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 ea03e830c..bb621df5c 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 d169c3286..5544a554f 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 4047c1813..bae8e01ff 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 47b32bf8a..78d65ce87 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 090189b3d..d88485219 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 c3c9b57ff..8b83e5aa2 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 c7d834c28..2dcdf4419 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 faef34b65..c4514ff4f 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 1bc0d23e8..0efd812dc 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 7a5258b3d..5c2cce628 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 73c97e3be..e0162d8ba 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 df72c6aa5..4893db50a 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_multi_column_layout/output.png b/tests/output/test_write_paragraphs_using_multi_column_layout/output.png index db8aa28d7..da4d2293e 100644 Binary files a/tests/output/test_write_paragraphs_using_multi_column_layout/output.png and b/tests/output/test_write_paragraphs_using_multi_column_layout/output.png 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 146376a60..176c454b1 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 65c83613a..0ad37f7cb 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_pil_image/output.pdf b/tests/output/test_write_pil_image/output.pdf index 0ec2d2c2a..be3d40930 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 efe416ef2..e3155bad9 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_radar_plot/output.pdf b/tests/output/test_write_radar_plot/output.pdf index 3e34cb981..2924da821 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_table_with_col_span/output.pdf b/tests/output/test_write_table_with_col_span/output.pdf index 020028cae..46cb06abc 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 a76384533..96c4e7ba8 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 c8a7f6a3f..b8a479e16 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 c5d3f0e19..13d0c4c2a 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 a1b813cb4..1336a1282 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 81ba428d5..b61de5553 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 a560ed173..92fe5f2d4 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 dcdba4be3..2ae06ee7e 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 c2db7ac01..52927c0f6 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 0d20e4f4f..fb48d0bdc 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 345f66063..1fbb6a025 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 d497f869e..8eba2a18c 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 80d916eb2..974c918ac 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 af1139be2..c6f649dbb 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 b9c5b4b32..6fa382f7b 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 5e3cd196f..45f0d38d4 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 355a53920..a1d190f7c 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_xl_image/output.pdf b/tests/output/test_write_xl_image/output.pdf index 9be52998b..dcaca8c79 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/toolkit/image/test_optimize_images.py b/tests/toolkit/image/test_optimize_images.py index 3b633ff3d..767b96646 100644 --- a/tests/toolkit/image/test_optimize_images.py +++ b/tests/toolkit/image/test_optimize_images.py @@ -2,7 +2,7 @@ import unittest from pathlib import Path -from borb.io.write.write_base_transformer import WriteTransformerState +from borb.io.write.transformer import WriteTransformerState from borb.pdf.pdf import PDF from borb.toolkit.image.image_format_optimization import ImageFormatOptimization diff --git a/tests/toolkit/text/test_extract_text_from_self_made_invoice.py b/tests/toolkit/text/test_extract_text_from_self_made_invoice.py index 438facd90..c7837a32e 100644 --- a/tests/toolkit/text/test_extract_text_from_self_made_invoice.py +++ b/tests/toolkit/text/test_extract_text_from_self_made_invoice.py @@ -252,7 +252,7 @@ def test_generate_invoice(self): # add corporate logo page_layout.add( Image( - "https://github.com/jorisschellekens/borb/blob/master/readme_img/logo/borb_64.png?raw=true", + "https://github.com/jorisschellekens/borb/blob/master/logo/borb_64.png?raw=true", width=Decimal(64), height=Decimal(64), )