Search code examples
.netwpfxps

.NET Library To Convert MS Word Document to XPS Document


Does anyone know of a 3rd party library that will convert a Microsoft Word document to an XPS file?

I know this is possible using MS Word or using Word automation, but I would like to have a library to do the converting that does not rely on the computer to have MS Word installed.

I need to do the converting completely in code using an API. There will be no user interaction in the converting process.

Thanks, Chris.


Solution

  • You may be able to do the conversion directly without any 3rd party dll's using Office Interop. Here's an article demonstrating how to view a Word doc as an XPS using WPF (link to article is now dead and has been removed).

    From the code presented in the article, converting Word to XPS should be fairly straight forward; ignoring the WPF parts, of course.

    EDIT

    The above answer does require Word; my mistake.

    Apose.Word for .NET will convert Word to XPS without Office/Word installed. Though it's probably a bit pricey.