Can be used Microsoft Word Viewer as alternative of MS OFFCE for convert to PDF a office document ?

To convert a RTF file to PDF using ToPDF() function need to be installed MS OFFICE. So the question is if can be used Microsoft Word Viewer to render office document ?
Is there a solution to convert RTF file to PDF without hawing MS OFFICE installed ?
Thanks.

So the question is if can be used Microsoft Word Viewer to render office document?

Possibly. First you would have to register Microsoft Word Viewer as the default print application for the RTF file extension. Once that was done, you would have to disable our Office Interop.

PDF.Convert.Printer.Install(); // need to do once per machine, with elevated permission
PDF.Convert.Printer.SetMode(Convert.Printer.Mode.e_printer_only) // this needs to be done for every process instance

To setup Microsoft Word Viewer as default RTF printer, see the end of this forum post.
https://groups.google.com/d/msg/pdfnet-sdk/LhrCDu6eFhE/jdENOwGBi2wJ

Is there a solution to convert RTF file to PDF without hawing MS OFFICE installed ?

We do have some text to PDF conversion currently supported for .txt, .xml, .monotext and .plaintext, but it does not currently handle .rtf.

If you would like to post here, or email to support, an example of a RTF file you would like to convert to PDF we can evaluate further.

It is not about RTF but further to Ryan’s reply, did you try DIRECT Word (DOCX or DOC ) to PDF conversion in PDFNet (e.g. see Word2PDf sample https://www.pdftron.com/pdfnet/samplecode.html#Word2PDF)? It does not require either MS Office nor a print driver and there are some huge feature improvements planned for January.

If you need support for RTF specifically please disregard my comment.

Hi Ryan,
Thanks for the quick answer.
RTF files that we want to convert to PDF are generated by our programs and can contain tables, images, graphics. It's not just a simple text file.

I tried your solution but the MS WORD VIEWER does not allow printing from the command line (WORDVIEW.EXE /p %1), so it can not be manipulated from the outside.

Would generating HTML or MD files be an option for you? Or perhaps you could generate a XAML/XPS flow document?

We internally support direct conversion of a number of file types to PDF, but currently not RTF, I believe due to lack of standardization of RTF.

If you cannot change your output to something else that is similar to RTF, then there are other ways to generate XPS files on Windows, and once you have a XPS file, PDFNet can create a PDF.