Why convert DO to PDF?
A Stata do-file is stored as plain text - the same format as .txt - containing only lines of Stata statistical commands. There is no binary structure, no embedded graphics, and no data table; producing a PDF only prints the source code, which any text editor can do directly.
How to convert DO to PDF
Notepad++ FREE
Open the .do file in Notepad++, choose File > Print, and select Microsoft Print to PDF (or your system's PDF printer) as the destination.
Visual Studio Code FREE
Open the .do file in Visual Studio Code, use the print command, and select a PDF printer to save the source code as a PDF.
About these formats
A .do file is a Stata do-file: a plain-text script of statistical commands used to reproduce an analysis. To view the code, open it in any text editor. To execute it, you need Stata (or a…
Open .DO details →A PDF (Portable Document Format) is a fixed-layout document that looks identical on every device - fonts, images, and layout are all embedded. Open it in any browser or the built-in viewer…
Open .PDF details →Quality & what to watch
- The PDF will contain the full script text - the only thing missing is the Stata output, which is produced at run time and not stored in the
.dofile itself. - If you need to share the analysis results (tables, figures, output logs), run the do-file in Stata and export from there rather than converting the script.
- Renaming the
.dofile to.txtfirst will allow most online text-to-PDF converters to accept it if you prefer that route.
Frequently asked questions
Why do PDF converters online not accept `.do` files?
.do file is plain text and behaves identically to .txt; renaming it to .txt first will allow most online converters to accept it.Is there any information lost if I print a do-file to PDF?
.do file does not store.