views:

368

answers:

1

I need to use command line switches to execute the 'Save as Text' command. Ideally, I want to:

  1. use a command line switch to open a PDF
  2. use a command line switch to convert the PDF to a text file by mimicking the 'Save as Text' command.
  3. use a command line to close the PDF.

Is this possible? If so, then does anyone know how to do this?

A: 

I don't understand why you'd not want to use free software (not freeware), pdftotext is the ideal solution. However, if you just want to actually open and save the PDF in an automated fashion using the Windows GUI, you could use vbscript and the sendkeys command.

Just use pdftotext though, it would be much more reliable and won't cost you a whole box.

Gaz Davidson
Thanks - I was thinking about doing the 'SENDKEYS' method but wanted to see if there was something quick and dirty. Yes, our environment places tight restrictions on acceptable software. Using Python (which is approved) may also be an option.