The most common way to convert text to PDF is to use a tool like Microsoft Word, Apple Pages, or Google Docs. All of these programs come with a built-in PDF exporter that can automatically create and save a PDF file from your text document. However, all of these tools have their weaknesses and limitations. For example, some of them cannot handle long documents or complex formatting, which can make it difficult for you to accurately convert your text into a well-organized and easy-to-read PDF file. You would also need these programs installed on your device.
Here is a tool that you can use online to convert TXT to PDF for free