I am trying to convert a RTF stream or a string to PDF using the toPdf() option in Convert class. But it only takes the file path as the input. Is there any other way to send an RTF string or a stream to convert into PDF? I tried using the Filter options as well StreamingPDFConversion(), but it doesn’t support the RTF extension. Any idea on this one?
Please note that we do not currently support direct/internal conversion of RTF files. Instead, a 3rd party application, installed on the Windows computer, is needed, and this communication with the 3rd party application requires the file to be on the filesystem.
So just to clarify this point with what’s in the (nodeJs) docs for toPdf: in_filename: the path to the document to be converted to pdf Note: Internally formats include BMP, EMF, JPEG, PNG, TIF, XPS. Note: Formats that require external applications for conversion use the Convert::Printer class and the PDFNet printer to be installed. This is only supported on Windows platforms. Document formats in this category include RTF(MS Word or Wordpad), TXT (Notepad or Wordpad), DOC and DOCX (MS Word), PPT and PPTX (MS PowerPoint), XLS and XLSX (MS Excel), OpenOffice documents, HTML and MHT (Internet Explorer), PUB (MS Publisher), MSG (MS Outlook).
But then there’s Convert.office2PDF: <static> office2PDF(input [, options]) Convert the an office document (in .docx, .xlsx, pptx, or .doc format) to pdf.
Which just leaves ‘unconvertable’ when not running Windows:
RTF, OpenOffice documents, HTML/MHT, PUB, and MGS.