Convert txt file to PDF using adobe printer

by fazlook at 2012-10-23 05:58:50

Hi there,

First of all , I would like to thank everyone who helped with the website transition.

I have adobe pdf printer installed on my computer and it is my default printer.

How would I convert .txt file to .pdf file using Powershell ?

Thank you
by Makovec at 2012-10-23 06:26:01

You can use Out-Printer cmdlet. My PDF printer is named pdfFactory Pro, so I can use:
Get-Content c:\temp\file.txt | Out-Printer -Name 'pdfFactory Pro’
As you have it as default printer, it’s not necessary to use Name parameter.

by fazlook at 2012-10-23 06:56:21
Thank you for the quick reply, I will test it out. But should I Terminate acrotray.exe first ?
by Makovec at 2012-10-24 01:17:47
I don’t use Adobe so have no idea how this works. Assume that if the PDF printer is installed, you can use it. Looking to the internet I found this:
[quote]“acrotray.exe” is the Adobe Acrobat Distiller helper application. It is used as part of the full Adobe Acrobat product to convert documents into PDF files.[/quote]
So assume it has to be started. But just give it a try and you’ll see.

by fazlook at 2012-10-24 05:49:19
That’s true :slight_smile: I would consider this solved.

Much appreciate your help.