Text lines become pages with a chosen reading width
A TXT file stores characters and line breaks, not margins, fonts, page numbers, or headings as formatted objects. The PDF export must choose a typeface and page layout. Long lines may wrap differently from the original editor, and a line break may be meaningful in a poem or data file.
Review how blank lines, indentation, and columns appear. If the text is code or tabular output, a proportional font can shift alignment. Choose a layout that matches the content rather than treating every plain-text file like a letter.