The best way to generate PDF, RTF or other types of files is generally use of ODS destination statements. You surround the code that generates the actual output with an ODS destination statement and close statements.
Pseudo example:
ods rtf file="<path>\name.rtf" ;
ods pdf file= "<path>\name.pdf";
< procedure that generates output>
<other procedure that generates output>
ods pdf close;
ods rtf close;
the <path> you need to replace with where you want the output to go. A fully qualified path from a drive or similar point is recommended. I don't speak MAC so am not sure of the syntax.
You can send output to multiple destinations as above, the same output would go to both an RTF and PDF document. Be aware that each destination you use may have a different ODS Style by default, which controls, fonts, colors and other appearance options. So you may want to specify the specific output style using the STYLE=option on the destination statement. Each destination, RTF, PDF, EXCEL, Powerpoint, Html, Html5 and others have additional options.