{"id":16416086,"url":"https://github.com/phax/ph-pdf-layout","last_synced_at":"2025-04-06T16:11:05.418Z","repository":{"id":20080203,"uuid":"23349225","full_name":"phax/ph-pdf-layout","owner":"phax","description":"Java library for creating fluid page layouts with Apache PDFBox. Supporting multi-page tables, different page layouts etc.","archived":false,"fork":false,"pushed_at":"2025-03-19T13:54:18.000Z","size":4254,"stargazers_count":70,"open_issues_count":7,"forks_count":14,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-30T15:07:42.242Z","etag":null,"topics":["java","layout-engine","pdf","pdf-generation","pdfbox","rendering"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-08-26T11:29:35.000Z","updated_at":"2025-03-25T19:00:36.000Z","dependencies_parsed_at":"2023-01-13T20:45:50.691Z","dependency_job_id":"4f590bf1-34b1-443f-a4bf-1a77720caa66","html_url":"https://github.com/phax/ph-pdf-layout","commit_stats":{"total_commits":951,"total_committers":5,"mean_commits":190.2,"dds":0.01682439537329128,"last_synced_commit":"a8a571ed1d6bd9c4334de56e4dc8e139bfd162e6"},"previous_names":[],"tags_count":60,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-pdf-layout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-pdf-layout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-pdf-layout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-pdf-layout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phax","download_url":"https://codeload.github.com/phax/ph-pdf-layout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509221,"owners_count":20950232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","layout-engine","pdf","pdf-generation","pdfbox","rendering"],"created_at":"2024-10-11T07:08:22.665Z","updated_at":"2025-04-06T16:11:05.404Z","avatar_url":"https://github.com/phax.png","language":"Java","readme":"# ph-pdf-layout\n\n[![javadoc](https://javadoc.io/badge2/com.helger/ph-pdf-layout/javadoc.svg)](https://javadoc.io/doc/com.helger/ph-pdf-layout)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.helger/ph-pdf-layout/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.helger/ph-pdf-layout) \n\nJava library for creating fluid page layouts with Apache PDFBox 3.x.\n\nPlease check the [examples files](https://github.com/phax/ph-pdf-layout/tree/master/example-files) to see what kind of PDFs may be created.\nPlease see the [unit tests](https://github.com/phax/ph-pdf-layout/tree/master/ph-pdf-layout/src/test/java/com/helger/pdflayout/element) on how to create and use the different elements.\n\nSystem requirements:\n* At least Java 11 - newer versions should work as well\n* GitHub actions test with all LTS version (currently 11, 17 and 21)\n\nThe basic elements provided are:\n* `PageLayoutPDF` - the entry class, having a list of page sets\n* `PLPageSet` - a set of pages that share the same size and orientation and contain a set of elements. The assignments to pages happens dynamically.\n* *PL elements* - basic or complex layout elements (\"PL\" is short for \"PDF Layout\")\n  * Basic (inline) elements are\n     * plain text in class `PLText` (Unicode of course)\n       * For custom Open Source fonts to be used see the https://github.com/phax/ph-fonts project\n       * Note: the available characters heavily depend on the used font. So if you get a \"?\" character, try loading a different font\n     * and image in classes `PLImage` and `PLStreamImage` (whatever ImageIO can load).\n  * Basic (block) element is box (class `PLBox`)\n  * Layout elements are\n    * horizontal box or h-box in class `PLHBox` - like a row of a table\n    * vertical box or v-box in class `PLVBox` - like a column of a table\n    * spacer-x in class `PLSpacerX` - a horizontal spacer - just in case you need explicit distance to a certain element\n    * spacer-y in class `PLSpacerY` - a vertical spacer - just in case you need explicit distance to a certain element\n    * page break in class `PLPageBreak` - an explicit page break that starts a new page\n  * The most complex element is a table, which consists of a number of \"h-boxes\" (rows) which itself consist of a number of \"v-boxes\" (columns) plus comes with repeating headlines etc.\n    * See classes `PLTable`, `PLTableRow` and `PLTableCell` for details\n  * Elements can have the following properties - if you know CSS you should be familiar with it:\n    * \"min-size\" - the minimum element size\n    * \"max-size\" - the maximum element size\n    * \"margin\" - a transparent outer border (outside of the border)\n    * \"border\" - a visible border with different styles (between padding and margin) \n    * \"padding\" - a transparent inner border (inside of the border)\n    * \"fill-color\" - the background or fill color of an element\n\nA set of example files as created from the unit test can be found in folder [example-files](https://github.com/phax/ph-pdf-layout/tree/master/example-files). The source code for these examples is https://github.com/phax/ph-pdf-layout/tree/master/src/test/java/com/helger/pdflayout\n\nSimilar libraries in this context:\n* https://github.com/ralfstuckert/pdfbox-layout - seems to focus more on text layouting; PDFBox 1.x and 2.x only; MIT license\n* https://github.com/TIBCOSoftware/jasperreports - the \"big one\" - large scale, complex, heavy-weight, declarative approach; LGPL license\n* https://github.com/LibrePDF/OpenPDF/ - an iText 4.x clone; no PDFBox; LGPL / MPL license\n* https://github.com/dhorions/boxable - a library to create tables based on PDFBox; Apache 2.0 license\n\n# Maven usage\n\nAdd the following to your pom.xml to use this artifact, replacing `x.y.z` with the real version number:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.helger\u003c/groupId\u003e\n  \u003cartifactId\u003eph-pdf-layout4\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nBetween v4.0.0 and v5.2.2 the `artifactId` was called `ph-pdf-layout4`\n\n# News and Noteworthy\n\n* v7.3.6 - 2025-03-31\n    * Updated to PDFBox 3.0.4\n    * Made PDF/A property \"document language\" customizable in `PageLayoutPDF`\n    * Added new interface `IXMPMetadataCustomizer` to be able to customize the `XMPMetadata`. See [pr #44](https://github.com/phax/ph-pdf-layout/pull/44) - thx @stmuecke\n* v7.3.5 - 2024-10-09\n    * Updated to PDFBox 3.0.3\n    * Updated tests to ph-fonts 5.0.3\n    * Added a setter of `PLFontSpec` into `AbstractPLText`\n* v7.3.4 - 2024-05-30\n    * Fixed an issue with `BLOCK` horizontal alignment in case of a page break. See [issue #36](https://github.com/phax/ph-pdf-layout/issues/36)\n* v7.3.3 - 2024-05-29\n    * Updated to PDFBox 3.0.2\n    * Added new horizontal alignment type `BLOCK` as a mixture of `LEFT` and `JUSTIFY`. See [issue #36](https://github.com/phax/ph-pdf-layout/issues/36) - thx @istvangaal\n* v7.3.2 - 2024-03-27\n    * Updated to ph-commons 11.1.5\n    * Created Java 21 compatibility\n    * Extracted a parent POM and prepared a submodule structure\n    * Using https://github.com/red6/pdfcompare to test created PDFs against the stored ones. See [issue #35](https://github.com/phax/ph-pdf-layout/issues/35) - thx @Lolf1010\n* v7.3.1 - 2024-01-24\n    * Updated to PDFBox 3.0.1\n    * Added support for clipping content of block elements via `.setClipContent(boolean)`. See [issue #34](https://github.com/phax/ph-pdf-layout/issues/34) - thx @terrason\n* v7.3.0 - 2023-10-30\n    * Completely removed usage of `java.awt.Color`. Backwards incompatible change. This finalizes [issue #32](https://github.com/phax/ph-pdf-layout/issues/32).\n* v7.2.0 - 2023-10-30\n    * Added new class `PLColor` and deprecated all methods using `java.awt.Color`. Backwards incompatible change. See [issue #32](https://github.com/phax/ph-pdf-layout/issues/32) - thx @AndroidDeveloperLB\n* v7.1.0 - 2023-08-20\n    * Updated to PDFBox 3.0.0\n* v7.0.1 - 2023-07-31\n    * Updated to PDFBox 2.0.29\n    * Updated to ph-commons 11.1.0\n    * Improved API to create an empty cell. See [issue #29](https://github.com/phax/ph-pdf-layout/issues/29) - thx @fheldt\n* v7.0.0 - 2022-09-14\n    * Using Java 11 as the baseline\n    * Updated to ph-commons 11\n* v6.0.3 - 2022-08-17\n    * Added support for PDF/A creation in `PageLayoutPDF` - thx @robertholfeld for publishing this in his branch\n* v6.0.2 - 2022-05-25\n    * Extended `PDPageContentStreamWithCache` API. See [issue #23](https://github.com/phax/ph-pdf-layout/issues/23) - thx @schneidh\n* v6.0.1 - 2022-05-07\n    * Updated to jbig2-imageio 3.0.4\n    * Updated to PDFBox 2.0.26\n    * Added support for creating external links via new class `PLExternalLink`. See [issue #14](https://github.com/phax/ph-pdf-layout/issues/14) - thx @rgarg-atheer and @martin19\n* v6.0.0 - 2022-01-05\n    * Changed artifactId from `ph-pdf-layout4` to `ph-pdf-layout`\n    * Changed Java namespaces `com.helger.pdflayout4.*` to `com.helger.pdflayout.*`\n* v5.2.2 - 2021-12-29\n    * Updated to PDFBox 2.0.25\n    * Extended `IPLHasMargin` with `(set|add)Margin(X|Y)` to set or add to vertical or horizontal margin at once\n    * Extended `IPLHasPadding` with `(set|add)Padding(X|Y)` to set or add to vertical or horizontal padding at once\n* v5.2.1 - 2021-03-22\n    * Updated to PDFBox 2.0.23\n* v5.2.0 - 2021-03-21\n    * Updated to ph-commons 10\n    * Updated to PDFBox 2.0.22\n    * Add syntactic sugar method `PLTableCell.createEmptyCell()`\n* v5.1.2 - 2020-06-15\n    * Updated to PDFBox 2.0.20\n    * Allow different page content height if the first page header and footer have different heights. See [issue #14](https://github.com/phax/ph-pdf-layout/issues/14).\n* v5.1.1 - 2020-05-29\n    * Updated to ph-fonts 4.1.0 (changed Maven groupId)\n* v5.1.0 - 2020-03-29\n    * Updated to PDFBox 2.0.19\n    * Updated to jbig2-imageio 3.0.3\n    * Fixed line spacing on page break (see [issue #10](https://github.com/phax/ph-pdf-layout/issues/10))\n    * Allow table columns with different `WidthSpec` types, as long as colspan is `1`.\n    * Added another generic parameter to `IPLSplittableObject`\n    * Made `PageLayoutPDF` API more chainable\n    * New class `PLBulletPointList` can be used to create regular bullet point lists (see [issue #9](https://github.com/phax/ph-pdf-layout/issues/9))\n    * Updated to ph-commons 9.4.0\n* v5.0.9 - 2019-04-29\n    * Updated to PDFBox 2.0.15 (security update)\n* v5.0.8 - 2018-11-22\n    * Updated to PDFBox 2.0.12\n    * Updated to ph-commons 9.2.0\n* v5.0.7 - 2018-07-10\n    * Updated to PDFBox 2.0.11\n* v5.0.6 - 2018-06-21\n    * Updated to org.apache.pdfbox:jbig2-imageio for JPEG handling\n    * Fixed OSGI ServiceProvider configuration\n    * Updated to ph-commons 9.1.2\n* v5.0.5 - 2018-04-16\n    * Something went wrong when publishing to Maven Central - next try\n* v5.0.4 - 2018-04-16\n    * Do not justify the last line of multiline text\n* v5.0.3 - 2018-04-16\n    * Added `ph-collection` dependency for issue #4\n    * Updated to PDFBox 2.0.9\n    * Added possibility to justify text\n* v5.0.2 - 2018-02-21\n    * Added possibility to use special page header and footer on the first page of a PLPageSet\n* v5.0.1 - 2018-02-12\n    * Added image type support (issue #3)\n    * Updated to BouncyCastle 1.59\n    * Added new table grid types\n* v5.0.0 - 2017-11-09\n    * Updated to PDFBox 2.0.8\n    * Updated to ph-commons 9.0.0\n    * Updated to BouncyCastle 1.58\n* v4.0.1 - 2017-05-16\n    * Updated to PDFBox 2.0.6\n    * Slight API extensions\n* v4.0.0 - 2017-02-22\n    * No change compared to 4.0.0 Beta 5\n* v4.0.0 Beta 5 - 2017-01-19\n    * Improved XML serialization slightly\n    * Fixed an NPE with PLBox without a contained element\n* v4.0.0 Beta 4 - 2017-01-10\n    * Block elements use full width now by default\n    * Improved placeholder handling in text preparation\n* v4.0.0 Beta 3 - 2017-01-10\n    * Binds to ph-commons 8.6.x\n    * Fixed a height problem with vertical split HBoxes\n    * Simplified class hierarchy for table rows\n    * Made font fallback code point more flexible\n    * Changed font rendering to use descent from font instead of heuristics\n    * Fixed different border color rendering\n    * Made debug rendering customizable\n    * Added support for line spacing in PLText\n* v4.0.0 Beta 2 - 2017-01-03\n    * The Maven artifact name was changed to 'ph-pdf-layout4' so that it can be used side-by-side with version 3.\n    * The global package name was changed from `com.helger.pdflayout` to `com.helger.pdflayout4` so that both 3.x and 4.x can run side-by-side\n    * This is major rewrite to be closer to the CSS box model\n    * VBox and HBox have no more layout information assigned to them\n    * Added a new element \"Box\" that allows for easy alignment etc.\n    * Separation between renderable objects, block element (box) and inline elements (text and image)\n    * New class design for tables, so that each table cell is automatically represented by a box, each table row is a separate object\n    * Added a simple grid system for tables to build the default grids easily\n    * Added new \"auto\" width/height for columns/rows\n    * Updated to PDFBox 2.0.4\n* v3.5.3 - 2017-11-07\n    * Binds to ph-commons 9.0.0\n    * Updated to PDFBox 2.0.8\n    * Updated to BouncyCastle 1.58\n* v3.5.2 - 2017-01-10\n    * Binds to ph-commons 8.6.x\n    * Updated to PDFBox 2.0.4\n* v3.5.1 - 2016-10-07\n    * Fixed a rendering flaw with borders\n* v3.5.0 - 2016-09-21\n    * Changed internal class hierarchy to prepare for future changes\n    * Changed package assignments for better grouping\n* v3.0.3 - 2016-09-19\n    * Updated to PDFBox 2.0.3\n    * Performance improvement by using optimized writer\n    * Included optional MicroTypeConverters\n* v3.0.2 - 2016-09-06\n    * API extensions for the classes in the \"spec\" package\n* v3.0.1 - never released because of issues with the release script :(   \n* v3.0.0 - 2016-08-21\n    * Requires JDK 8\n    * Still on PDFBox 2.0.0 because of problems with 2.0.1 and 2.0.2\n\nNote: Versions starting with 2.1.0 uses PDFBox 2.x, previous versions (up to and including 2.0.0) use PDFBox 1.8.x.\n\nNote: version 4.0.0 has troubles building with JDK 1.8.0_92 - updating to 1.8.0_112 or later should work.\n\n---\n\nMy personal [Coding Styleguide](https://github.com/phax/meta/blob/master/CodingStyleguide.md) |\nIt is appreciated if you star the GitHub project if you like it.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fph-pdf-layout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphax%2Fph-pdf-layout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fph-pdf-layout/lists"}