Re: Module For COM Objects

2013-02-22 Thread Carlos Ungil
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  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.




Re: Module For COM Objects

2013-02-21 Thread David Powell
There is an example here of using JACOB:
http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Talking_to_Excel

(I think this only works for IDispatch stuff?)


On Fri, Feb 22, 2013 at 1:02 AM, Kevin Downey  wrote:

> The are a few tools for doing interop with COM from the JVM. They all kind
> of suck. We use com4j at work with Clojure. Com4j generates JVM stubs for
> COM libraries.
> On Feb 21, 2013 3:53 PM, "octopusgrabbus" 
> 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.
>>
>>
>>
>  --
> --
> 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.
>
>
>

-- 
-- 
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.




Re: Module For COM Objects

2013-02-21 Thread Kevin Downey
The are a few tools for doing interop with COM from the JVM. They all kind
of suck. We use com4j at work with Clojure. Com4j generates JVM stubs for
COM libraries.
On Feb 21, 2013 3:53 PM, "octopusgrabbus"  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.
>
>
>

-- 
-- 
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.




Module For COM Objects

2013-02-21 Thread octopusgrabbus
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.