in reply to Re: DOC TO PRN
in thread DOC TO PRN

A PRN file is a file produced in a Microsoft DOS or Windows application when the option "Print to File" is used. Note that this isn't the same thing as using the normal print functionality with a "fake printer" like Adobe Acrobat or PDF Creator define. It's meant to be a printer ready dump that can be copied to a printer:
COPY myfile.prn LPT1

As you might guess from this syntax, this idea has been around for quite a long time (and only works on directly connected devices). One alternative I saw was to try in MS Windows to drag and drop a PRN file onto the printer icon. A quick Googling showed me a free tool that will let you print various kinds of files: PrintFile

None of this background information helps the OP, but you've already pointed to the use of Win32::OLE to automate the application needed to produce the PRN file. Even in Office 2007, you can use the Print to File option, it's just a matter of picking the right OLE print setting to specify it.

Oooh, another quick look gave me this: source file of Docserver which has a doc_convert function that looks just like what the doctor ordered.

Final Answer: get Docserver

Replies are listed 'Best First'.
Re^3: DOC TO PRN
by Corion (Patriarch) on Mar 17, 2010 at 12:35 UTC

    I've seen other files named with the .prn extension, but even if it were as you described, the OP didn't mention for what printer the .prn file should be created, which makes the question even less answerable :)

      I believe you're right, the resulting PRN files are device dependent. If you produced a PRN file for a PostScript printer, it would be normal PostScript (which if I remember right is a trick "back in the day" to get MS Windows apps to produce PostScript files), if it's a PCL printer it would be that, and so forth.

      I am assuming that the OP has a machine running Windows with at least one printer attached, or Win32::OLE won't be able to produce PRN file output. Wouldn't be able to print anything to hard copy, either.

      Huh, now that I think about it, I wonder what would happen if you did a print to file to a printer that produces files, such as PDF Creator or Adobe Acrobat? Ugh, don't want to ponder that