It is for this reason that some users look for alternative PDF readers. However, over time, it has made a reputation for being resource-demanding and lags. This app has been known to help open PDF files. PrinterSettings printerSettings = new PrinterSettings() įoreach ( string printer in PrinterSettings.Adobe Reader DC is one of the software that many users download after installing a fresh copy of Windows. If ( string.equalsIgnoreCase(printer, " Foxit Reader PDF Printer") = 0) Info.WindowStyle = ProcessWindowStyle.Hidden įoreach ( string printer in .InstalledPrinters) ProcessStartInfo info = new ProcessStartInfo(documentPath) Public void PrintReportAsAProcess( string documentPath) || String.IsNullOrWhiteSpace(currentPrinter)) This.PrintReportAsAProcess(documentPath) SetDefaultPrinter( " Foxit Reader PDF Printer") String currentPrinter = this.GetDefaultPrinter() If( String.IsNullOrWhiteSpace(documentPath)) Public void ConvertDocxToPdfWithFoxitReader( string documentPath) Public static extern bool SetDefaultPrinter( string Name) Just Foxit Reader (Free) must be installed on the client. In addition, one will have a few more options to configure your pdf output if you're going to hack some Windows Registry values at application runtime.ĭepending on registy manipulating, full silent conversation, showing a FileSaveDialog as well asĪutomatically open up converted document is possible. There are many great (commercial) document libraries which support a doc/docx to pdf conversation and a few other scopes to do this, but I just needed a conversation so I was a bit scared of using a whole library for that.Īlso the other scopes like using Word interop or SharePoint has not been an option for me because a licensed Word/Sharepoint installation is needed for that task.Ī quick look into foxit's printer settings revealed that this could be an option so I had a try and I was really happy that it works for my requirements. Seems easy, like a standard task and pdfs are a standard document format. I stumbled over a requirement to convert (and print) *.doc, *.docx.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |