You can use the convertAttachmentToPdf method on each file that you want to convert to PDF.
Edit the document, loop through files and fetch the
K_VERSION of the to be converted file. Provide the
editHandle, k_File and version to the method as parameters.
The method returns the
K_FILE of the inserted attachment.
Requirement is that PDF conversion is already configured, of course :-)