Title: Print to File Programmatically using Adobe Acrobat
Tags: c#;vb.net;printing
Question: In the advanced print settings inside adobe acrobat reader, I have noticed that there is a print to file option.  I am currently developing a library of functions in vb.net that prints files of various formats to print language files (postscript).  I can't seem to find however a way to access this functionality programmatically, is there a way to do this without using a third party tool as I need to try and avoid using external libraries if at all possible.

Here is the accepted answer: You can use the PrintDocument class to print to a PostScript printer on the FILE: port. PostScript print drivers are provided with Windows by default.  An example is HP LaserJet 2800 PS, which is provided with Server 2008.  Generally if it has PS in the name the printer will be able to print to file.
https://docs.microsoft.com/en-us/dotnet/api/system.drawing.printing.printersettings.printtofile
...
printDocument1.PrinterSettings.PrintToFile = true
printDocument1.PrinterSettings.PrintFileName = "c:\temp\test.ps"
printDocument1.Print()
Comment for this answer: Is there a way to do this with PowerShell?


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2014:00:03/31/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><vb.net><printing>', 'Title': 'Print to File Programmatically using Adobe Acrobat', 'ViewCount': 858, 'id': 22761716, 'user_AboutMe': '', 'user_AccountId': 4112271.0, 'user_DisplayName': 'Papaya21', 'user_Reputation': 45.0, 'user_Views': 7.0, 'user_id': 3374776.0}}