{"id":20902628,"url":"https://github.com/dotemacs/pdfboxing","last_synced_at":"2025-05-15T08:05:31.806Z","repository":{"id":12478604,"uuid":"15147177","full_name":"dotemacs/pdfboxing","owner":"dotemacs","description":"Nice wrapper of PDFBox in Clojure","archived":false,"fork":false,"pushed_at":"2024-12-16T15:11:02.000Z","size":2806,"stargazers_count":182,"open_issues_count":6,"forks_count":38,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-13T05:07:45.903Z","etag":null,"topics":["clojure","pdf","pdf-forms","pdfbox"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotemacs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2013-12-12T20:54:17.000Z","updated_at":"2025-01-17T09:04:14.000Z","dependencies_parsed_at":"2024-04-16T17:46:08.027Z","dependency_job_id":"2caf13fd-b069-4df2-8828-8c60a7408cdf","html_url":"https://github.com/dotemacs/pdfboxing","commit_stats":{"total_commits":201,"total_committers":20,"mean_commits":10.05,"dds":0.4925373134328358,"last_synced_commit":"b0a578f390b972fba2731847b7eda2233020a625"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotemacs%2Fpdfboxing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotemacs%2Fpdfboxing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotemacs%2Fpdfboxing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotemacs%2Fpdfboxing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotemacs","download_url":"https://codeload.github.com/dotemacs/pdfboxing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665747,"owners_count":21142123,"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":["clojure","pdf","pdf-forms","pdfbox"],"created_at":"2024-11-18T12:23:07.196Z","updated_at":"2025-04-13T05:07:49.757Z","avatar_url":"https://github.com/dotemacs.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `pdfboxing`\n\nClojure PDF manipulation library \u0026 wrapper for [PDFBox](http://pdfbox.apache.org/).\n\n* [![\"Clojure CLI\"](https://img.shields.io/badge/dynamic/json?color=informational\u0026label=Clojure%20CLI\u0026prefix=pdfboxing%2Fpdfboxing%20%7B%3Amvn%2Fversion%20%22\u0026query=%24%5B0%5D.latest_version\u0026suffix=%22%7D\u0026url=https%3A%2F%2Fclojars.org%2Fapi%2Fgroups%2Fpdfboxing)](https://clojars.org/pdfboxing)\n* [![\"Leiningen version\"](https://img.shields.io/badge/dynamic/json?color=informational\u0026label=Leiningen\u0026prefix=%5Bpdfboxing%20%22\u0026query=%24%5B0%5D.latest_version\u0026suffix=%22%5D\u0026url=https%3A%2F%2Fclojars.org%2Fapi%2Fgroups%2Fpdfboxing)](https://clojars.org/pdfboxing)\n* [![\"Continuous Integration status\"](https://github.com/dotemacs/pdfboxing/workflows/Tests/badge.svg)](https://github.com/dotemacs/pdfboxing/actions?query=workflow%3A%22Tests%22)\n* [![License](http://img.shields.io/badge/license-BSD-brightgreen.svg?style=flat-square)](LICENSE)\n* [![Dependencies Status](https://github.com/dotemacs/pdfboxing/actions/workflows/outdated-dependencies.yaml/badge.svg)](https://github.com/dotemacs/pdfboxing/actions?query=workflow%3A%22Outdated%20dependencies%22)\n* [![Downloads](https://versions.deps.co/dotemacs/pdfboxing/downloads.svg)](https://versions.deps.co/dotemacs/pdfboxing)\n\n## Usage\n\n### Extract text\n\n```clojure\n(require '[pdfboxing.text :as text])\n(text/extract \"test/pdfs/hello.pdf\")\n```\n\n### Merge multiple PDFs\n\n```clojure\n(require '[pdfboxing.merge :as pdf])\n(pdf/merge-pdfs :input [\"test/pdfs/clojure-1.pdf\" \"test/pdfs/clojure-2.pdf\"] :output \"foo.pdf\")\n```\n\n### Merge multiple images into single PDF\n\nYou can use either `merge-images-from-path` for providing images in\nform of vector of string paths or `merge-images-from-byte-array` to\nprovide them as a vector of byte arrays. Each image will be inserted\ninto its own page.\n\n\n```clojure\n(require '[pdfboxing.merge :as pdf])\n(pdf/merge-images-from-path [\"image1.png\" \"image2.png\"] \"output.pdf\")\n```\n\n### Split a PDF into mutliple PDDocuments\n```clojure\n (require '[pdfboxing.split :as pdf])\n```\nList of PDDocument pages 1 through 8\n```clojure\n (pdf/split-pdf :input \"test/pdfs/multi-page.pdf\" :start 1 :end 8)\n```\nSplits the PDF into single pages as a list of PDDocument\n```clojure\n (pdf/split-pdf :input \"test/pdfs/multi-page.pdf\")\n```\nSplits the PDF in half and writes them to disk as multi-page-1.pdf and multi-page-2.pdf\n```clojure\n (pdf/split-pdf-at :input \"test/pdfs/multi-page.pdf\")\n```\nSplits into two PDFs, the first having 5 pages and second has rest\n```clojure\n (pdf/split-pdf-at :input \"test/pdfs/multi-page.pdf\" :split 5)\n```\n\n### List form fields of a PDF\n\nTo list fields and values:\n\n```clojure\n(require '[pdfboxing.form :as form])\n(form/get-fields \"test/pdfs/interactiveform.pdf\")\n{\"Emergency_Phone\" \"\", \"ZIP\" \"\", \"COLLEGE NO DEGREE\" \"\", ...}\n```\n### Fill in PDF forms\n\nTo fill in form's field supply a hash map with field names and desired\nvalues. It will create a copy of **fillable.pdf** as **new.pdf** with\nthe fields filled in:\n\n```clojure\n(require '[pdfboxing.form :as form])\n(form/set-fields \"test/pdfs/fillable.pdf\" \"test/pdfs/new.pdf\" {\"Text10\" \"My first name\"})\n```\n\n### Rename form fields of a PDF\n\nTo rename PDF form fields, supply a hash map where the keys are the\ncurrent names and the values new names:\n\n```clojure\n(require '[pdfboxing.form :as form])\n(form/rename-fields \"test/pdfs/interactiveform.pdf\" \"test/pdfs/addr1.pdf\" {\"Address_1\" \"NewAddr\"})\n```\n### Get page count of a PDF document\n\n```clojure\n(require '[pdfboxing.info :as info])\n(info/page-number \"test/pdfs/interactiveform.pdf\")\n```\n### Get info about a PDF document\n\nSuch as title, author, subject, keywords, creator \u0026 producer\n\n```clojure\n(require '[pdfboxing.info :as info])\n(info/about-doc \"test/pdfs/interactiveform.pdf\")\n```\n\n### Draw lines on a PDF document\n\nSupply a PDF document, a name for the output PDF document, the\ncoordinates where the line should be drawn along with the page number\non which the line should be drawn\n\n```clojure\n(require '[pdfboxing.draw :as draw])\n(draw/draw-line :input-pdf \"test/pdfs/clojure-1.pdf\"\n                :output-pdf \"ninja.pdf\"\n                :coordinates {:page-number 0\n                              :x 0\n                              :y 160\n                              :x1 650\n                              :y1 160})\n```\n\n### Convert a PDF document to a very simple HTML document\n\nSupply a PDF document's name, a simple HTML is created in the root folder\n\n```clojure\n(require '[pdfboxing.tools :as tools])\n(tools/pdf-to-html \"myFile.pdf\")\n```\n\n## Compatibility with PDFBox's PDDocuments\n\nThe following functions referenced above have direct compatibility\nwith PDFBox's internal PDDocument type:\n\n- `text/extract`\n- `pdf/split-pdf`\n- `form/get-fields`\n- `form/set-fields`\n- `form/rename-fields`\n- `info/page-number`\n- `draw/draw-line`\n\nThis allows you to substitute each filepath (of each function's input)\nreferenced above with a PDDocument type.  This is helpful for example\nin the case that you were to want to split a PDF up by pages and then\nextract the text from *only* the 3rd page:\n\n```clojure\n(require '[pdfboxing.text :as text])\n(require '[pdfboxing.split :as split])\n(-\u003e (split/split-pdf :input \"test/pdfs/multi-page.pdf\")\n    (nth 2)\n    text/extract)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotemacs%2Fpdfboxing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotemacs%2Fpdfboxing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotemacs%2Fpdfboxing/lists"}