Converting complex text file to PDF

hello,
I have a text file that contains tables, a variable number of rows in each table, as well as some text. I want to convert it into a PDF. The issue is that even when performing a ‘Save As’ manually, the PDF is created but the tables do not display properly. Therefore, when automating the process with UiPath, we end up with the same result: a PDF with tables that are not displayed correctly. Are there any suggestions, please?

What format is that text file?