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

79 views
Skip to first unread message

Radion Moraru

unread,
Dec 13, 2017, 4:35:54 PM12/13/17
to PDFTron PDFNet SDK
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.

Ryan

unread,
Dec 14, 2017, 2:01:27 PM12/14/17
to PDFTron PDFNet SDK
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.

Support

unread,
Dec 14, 2017, 3:00:51 PM12/14/17
to PDFTron PDFNet SDK

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.

Radion Moraru

unread,
Dec 15, 2017, 12:27:26 PM12/15/17
to PDFTron PDFNet SDK
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.

Ryan

unread,
Dec 18, 2017, 7:09:28 PM12/18/17
to PDFTron PDFNet SDK
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.

Reply all
Reply to author
Forward
0 new messages