You can also use jawin. For example:

(ns reports.pdf
  (:import org.jawin.DispatchPtr org.jawin.win32.Ole32))

(defn merge-pdfs
  "Combines all the input-files into a single output-file."
  [input-files output-file]
  (Ole32/CoInitialize)
  (let [app (DispatchPtr. "AcroExch.App")
            doc1 (DispatchPtr. "AcroExch.PDDoc")
            doc2 (DispatchPtr. "AcroExch.PDDoc")]
    (.invoke doc1 "Open" (first input-files))
    (doseq [input (rest input-files)]
      (.invoke doc2 "Open" input)
      (let [pages1 (.invoke doc1 "GetNumPages")
                pages2 (.invoke doc2 "GetNumPages")]
            (.invokeN doc1 "InsertPages" (to-array [(- pages1 1) doc2
0 pages2 true])))
      (.invoke doc2 "Close"))
    (.invoke doc1 "Save" 1 output-file) ;;PDSaveFull=1
    (.invoke doc1 "Close")
    (.invoke app "Exit")
    (.close app))
  (Ole32/CoUninitialize))


On Feb 22, 12:53 am, octopusgrabbus <octopusgrab...@gmail.com> wrote:
> Does Clojure have a module that allows initializing, passing data to, and
> finalizing COM objects? I am asking, because I need to write a Clojure
> program to communicate with a COM toolkit. Thanks.

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to