Permalink
Browse files

Return all metadata

Added in missing metadata keys for data that we weren't previously
returning to the user.
  • Loading branch information...
1 parent 96b8ae0 commit 7648a164b7ec09bc6f062bfc784b15e8e56c6076 @KushalP committed May 2, 2012
Showing with 12 additions and 4 deletions.
  1. +6 −2 src/camelot/metadata.clj
  2. +6 −2 test/camelot/test/metadata.clj
View
@@ -11,10 +11,14 @@
(try
{:author (.getAuthor info)
:title (.getTitle info)
+ :subject (.getSubject info)
:keywords (str/split (.getKeywords info) #", ")
- :producer (.getProducer info)
:trapped (.getTrapped info)
- :creator (.getCreator info)}
+ :creator (.getCreator info)
+ :pages (.getNumberOfPages doc)
+ :created (.getCreationDate info)
+ :modified (.getModificationDate info)
+ :producer (.getProducer info)}
(finally (if (not (nil? doc))
(.close doc))))))
@@ -17,10 +17,14 @@
(is (= (get-metadata filename)
{:author "Joe Bloggs"
:title "Hello World"
+ :subject nil
:keywords ["test" "hello" "world"]
- :producer nil
:trapped nil
- :creator nil}))))
+ :creator nil
+ :pages 1
+ :created nil
+ :modified nil
+ :producer nil}))))
(deftest set-metadata-saves-metadata-to-pddocument
(let [metadata {:author "Joe Bloggs"

0 comments on commit 7648a16

Please sign in to comment.