import aspose.words as aw

# Load the license
wordToHtml = aw.License()
wordToHtml.set_license("Aspose.Total.lic")

# Load the RTF file
inputRtfFile = aw.Document("SampleFile.rtf")

# Instantiate the PdfSaveOptions object
pdfSaveOptions = aw.saving.PdfSaveOptions()

# Set color mode
pdfSaveOptions.color_mode = aw.saving.ColorMode.GRAYSCALE

# Save the output PDF
inputRtfFile.save("OutputRtfAsPdf.pdf", pdfSaveOptions)

print ("RTF to PDF converted successfully")