You could convert the RTF to plain text without the use of any external jars using something like this:
var docData = qie.doQuery(channelCache.getValue('dbName'),
"select data from docdata where sdid = " + message.getNode('/'));
var rtf = '';
for (var i = 1; i <= docData.getRowCount(); i++) {
rtf += docData.getNode('data', i);
}
rtf = new java.lang.String(rtf);
//Convert to text from RTF
var rtfEditorKit = new javax.swing.text.rtf.RTFEditorKit();
var rtfDocument = rtfEditorKit.createDefaultDocument();
rtfEditorKit.read(new java.io.ByteArrayInputStream(rtf.getBytes()), rtfDocument, 0);
rtf = rtfDocument.getText(0, rtfDocument.getLength());
message.setNode('/', StringUtils.replace(rtf, '\n', '~'));
There are other external jars you could find with a google search for "rtf to pdf jar".
Or
Maybe one of these KB articles would be a good resource:
https://www.qvera.com/kb/index.php/287/how-do-i-create-a-pdf-from-an-oru?show=287#q287
https://www.qvera.com/kb/index.php/683/how-do-i-create-a-pdf-when-obx-5-is-in-rtf-format?show=683#q683