Author Topic: Manipulating AdobeReader using Visual LISP Possible?  (Read 11701 times)

0 Members and 1 Guest are viewing this topic.

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #15 on: August 19, 2010, 05:36:48 PM »
I should probably be clearer (need to reread 'How to ask questions...')

To clarify: I am looking for a way to print a PDF file (to paper) programmatically so that I may print multiple PDF files automatically. I felt the easiest way to do this would be through something I already know: Visual LISP. However, having hit a few obstacles I'm open to ideas.

Lee

LE3

  • Guest
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #16 on: August 19, 2010, 05:44:53 PM »
However, having hit a few obstacles I'm open to ideas.

Get out of vlisp (forgood)(donotstayinthereandsomehowwasteallthetalentyouhaveandhaveshownonallyourposts) - jump into another language - C# can be good for you.

My two pesos - HTH

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #17 on: August 19, 2010, 05:53:25 PM »
I completely agree - and I've dabbled... but its just so easy to slip back into the nice and easy world of LISP/VLISP... :-(

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9268
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #18 on: August 19, 2010, 08:40:36 PM »
have you tried: "xcopy /B mypdf.pdf //<some port>"  or "xcopy /B LPT1" ?

Open a command prompt and type: "net help use"
...
get LPT1 pointed at some printer.
...
you're done.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

Vali

  • Mosquito
  • Posts: 9
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #19 on: August 20, 2010, 09:28:54 AM »
How about a spooler. A folder where files should be dropped and then sent immediately to printer? Checkout http://www.lerup.com/printfile/ it's interesting.

v.

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9268
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #20 on: August 20, 2010, 09:46:47 AM »
How about a spooler. A folder where files should be dropped and then sent immediately to printer? Checkout http://www.lerup.com/printfile/ it's interesting.

v.

Welcome to theSwamp.

That looks like a fancy version of Redmon. Cool find.
I would imagine that the type of file will still lead to problems -i.e. file of not type: Text, PS, EPS, etc. but may be a viable solution non the less.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

LE3

  • Guest
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #21 on: August 20, 2010, 09:47:39 AM »
I completely agree - and I've dabbled... but its just so easy to slip back into the nice and easy world of LISP/VLISP... :-(
I did some code in C++/ATL some time ago for a comercial product using this: PDF-XChange PRO 3 SDK by Traker Software - www.docu-track.com.

Also, found some info for you:
http://www.codeproject.com/KB/cpp/ReaderWrapper.aspx

(John have commented already about the unstable COM access)
http://vidmar.net/weblog/archive/2008/04/14/printing-pdf-documents-in-c.aspx

And this one:
http://aspalliance.com/514_CodeSnip_Printing_PDF_from_NET.all
« Last Edit: August 20, 2010, 10:01:37 AM by LE »

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #22 on: August 20, 2010, 01:57:47 PM »
have you tried: "xcopy /B mypdf.pdf //<some port>"  or "xcopy /B LPT1" ?

Open a command prompt and type: "net help use"
...
get LPT1 pointed at some printer.
...
you're done.

Would this be run through the command prompt? (Sorry for obvious questions).

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #23 on: August 20, 2010, 01:58:52 PM »
I did some code in C++/ATL some time ago for a comercial product using this: PDF-XChange PRO 3 SDK by Traker Software - www.docu-track.com.

Also, found some info for you

Thanks Luis, I'll be sure to have a look around :-)

John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9268
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #24 on: August 20, 2010, 03:33:20 PM »
have you tried: "xcopy /B mypdf.pdf //<some port>"  or "xcopy /B LPT1" ?

Open a command prompt and type: "net help use"
...
get LPT1 pointed at some printer.
...
you're done.

Would this be run through the command prompt? (Sorry for obvious questions).

I dont understand?
if the xcopy method works...
(startapp (strcat "xcopy /B " (getfile) " //LPT1"))

Why dont you explain what you have and what you want to do.
-e.g. I would like to send the PDFs created in this office to a HP laser jet 8150 Plotter.
The PDFs we make are made through a program called: PDF995.


This would give us much more information then we are getting (right now your not really telling us anything). Those two sentences would tell us:
1. the PDFs are created in house (no surprises) with the same standards.
2. the PDFs are a Postscript type of PDF (PDF995 uses Ghostscript).
3. the Plotter has both a PS and an HPGL driver (I can look it up on the HP website).

Right now i can only assume that you are either creating a fancy routine to post in the show your stuff forum or you are doing this as a request.  Both of those situations are going to be trouble for you because PDFs are not really a "standard" thing (there is a bunch of different programs that create them and they all have their own methods--the PDF file format is very "loose" so to speak) and you will get a bunch of bug fixes.

Look, its this simple: If you have a Postscript type PDF (created with Ghostscript, PDF995, PDFCreator, etc) and your plotter has a PS driver, either send the file via a windows XCOPY or have Ghostscript or Redmon send the file for you.  If you have an HPGL type of PDF then use the software that created it (Kip request, Oce reprodesk).

You can issue the XCOPY command to windows or call Ghostscript like the above example.
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #25 on: August 20, 2010, 03:43:00 PM »
have you tried: "xcopy /B mypdf.pdf //<some port>"  or "xcopy /B LPT1" ?

Open a command prompt and type: "net help use"
...
get LPT1 pointed at some printer.
...
you're done.

Would this be run through the command prompt? (Sorry for obvious questions).

I dont understand?
if the xcopy method works...
(startapp (strcat "xcopy /B " (getfile) " //LPT1"))

I didn't properly understand your post either: I've never used the 'xcopy' method, and your previous post gave little information on how to run it - hence my question.

Why dont you explain what you have and what you want to do.
-e.g. I would like to send the PDFs created in this office to a HP laser jet 8150 Plotter.
The PDFs we make are made through a program called: PDF995.


This would give us much more information then[sic] we are getting (right now your not really telling us anything). Those two sentences would tell us:
1. the PDFs are created in house (no surprises) with the same standards.
2. the PDFs are a Postscript type of PDF (PDF995 uses Ghostscript).
3. the Plotter has both a PS and an HPGL driver (I can look it up on the HP website).

The PDF's are all created using the same PDF creator and are all of Postscript type - I'm not sure of the Plotter, but would assume it has a PS driver.

Right now i can only assume that you are either creating a fancy routine to post in the show your stuff forum

Not the case.

or you are doing this as a request.  Both of those situations are going to be trouble for you because PDFs are not really a "standard" thing (there is a bunch of different programs that create them and they all have their own methods--the PDF file format is very "loose" so to speak) and you will get a bunch of bug fixes.

This is to help in my summer job in which many PDF's are plotted, so I am looking for a quicker way to do it.

Look, its this simple: If you have a Postscript type PDF (created with Ghostscript, PDF995, PDFCreator, etc) and your plotter has a PS driver, either send the file via a windows XCOPY or have Ghostscript or Redmon send the file for you.  If you have an HPGL type of PDF then use the software that created it (Kip request, Oce reprodesk).

You can issue the XCOPY command to windows or call Ghostscript like the above example.

Now that you have demonstrated how to go about using XCopy, I shall have a go at that which you describe.


John Kaul (Se7en)

  • Administrator
  • Needs a day job
  • Posts: 9268
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #26 on: August 20, 2010, 03:51:42 PM »
awesome.

You can call many command line apps that way. Here is just one example:
http://www.theswamp.org/index.php?topic=14793.0

Here are tons of command line apps for you to use.
http://gnuwin32.sourceforge.net/packages.html

HTH
“Common sense is not so common.” ~Voltaire

--> Donate to TheSwamp.org <--

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #27 on: August 20, 2010, 05:44:21 PM »
Many thanks Se7en, you have been a great help :-)

I'll be sure to let you know how I get on  :-)

Lee Mac

  • Seagull
  • Posts: 12270
  • London, England
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #28 on: August 21, 2010, 07:13:37 PM »
As an update on proceedings...

I looked into the XCopy function here:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true

But there doesn't seem to be a "/B" option, as you demonstrate - I haven't as yet tried your suggestion, but upon reading the docs on XCopy: is it not just for copying files?

I also looked into the ShellExecute function, under the iShellDispatch2 object

http://msdn.microsoft.com/en-gb/library/bb774148%28v=VS.85%29.aspx

I have seen a couple of VB examples that use this method to silently print PDF's, but I either cannot get the arguments correct, or I get an error referring to file associations :-(

LE3

  • Guest
Re: Manipulating AdobeReader using Visual LISP Possible?
« Reply #29 on: August 21, 2010, 09:11:08 PM »
Lee,

To bad my printer is not working, so can't really test it... but just tried and appears to (work?):

(startapp "C:\\Program Files\\Adobe\\Reader 9.0\\Reader\\AcroRd32.exe /t /h C:\\Test.pdf")

Do not know if you have something like the above line...