Clojure wrapper for the PDFBox that converts a page range of a PDF document to images.
Why forked? It seems the maintainer of the original repo is no longer available or not willing to commit new changes.
Add the following dependency to your project.clj
file:
[pdf-2-images "0.1.2"]
Import namespace example:
(ns hello-world.core
(:require [pdf-2-images.core :refer :all]))
Basic usage example:
(let [image-paths (pdf-2-images (clojure.java.io/file "path-to-pdf") image-to-file)]
(prn (str "Images count: " (count image-paths)))
(map prn image-paths))
;; "Images count: n"
;; "path-to-image-0"
;; "path-to-image-1"
;; ...
;; "path-to-image-n-1"
The same with key-value pair parameter - pathname will be used if pdf-file is not specified (= nil):
(let [image-paths (pdf-2-images nil image-to-file :pathname "path-to-pdf")]
(prn (str "Images count: " (count image-paths)))
(map prn image-paths))
;; "Images count: n"
;; "path-to-image-0"
;; "path-to-image-1"
;; ...
;; "path-to-image-n-1"
With-options usage example:
(let [image-paths (pdf-2-images (clojure.java.io/file "path-to-pdf")
image-to-file
:start-page 0
:end-page 1
:dpi 100
:ext "jpg")]
(prn (str "Images count: " (count image-paths)))
(map prn image-paths))
;; "Images count: 1"
;; "path-to-image-0"
Built-in image handlers
image-to-image
image-to-byte-array
image-to-file
Distributed under the Eclipse Public License version 1.0.
Can you improve this documentation? These fine people already did:
Igor & roboliEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close