KissPDF

TSX and TypeScript source files to PDF

Convert TypeScript and TSX Files to PDF

Upload a .tsx, .ts, .mts, or .cts file—or paste TypeScript source code—and turn it into a clean, readable PDF. Preserve type annotations, JSX markup, indentation, comments, syntax highlighting, line numbers, and automatic page breaks.

Free · no signup · no watermarkTypeScript and TSX-aware editingExact page preview with selectable text
TypeScript editor17 lines
Updating preview
1234567891011121314151617
interface InvoiceItem {
  description: string;
  quantity: number;
  unitPrice: number;
}

const items: InvoiceItem[] = [
  { description: "Design review", quantity: 2, unitPrice: 125 },
  { description: "Implementation", quantity: 6, unitPrice: 95 },
];

const total = items.reduce(
  (sum, item) => sum + item.quantity * item.unitPrice,
  0,
);

console.log("Invoice total: £" + total.toFixed(2));
Preparing PDF preview…

Readable TypeScript source documents

Convert TSX source code to a paged PDF

KissPDF converts uploaded TypeScript files or pasted TSX source into normal PDF pages—not screenshots and not one tall image. Interfaces, type aliases, generics, imports, decorators, comments, and JSX markup remain easy to scan while the source stays selectable and searchable.

This tool formats source code; it does not run TypeScript, compile a project, resolve modules, render a React component, or capture a website. The exact preview and downloaded PDF use the same document snapshot, with controls for code size, theme, line numbers, title, paper size, margins, and page numbers.

Built and technically reviewed by the KissPDF project maintainers

Three steps

How to convert a TSX file to PDF

01

Upload or paste TypeScript

Open a .tsx, .ts, .mts, or .cts file, or replace the sample with a component, module, type definition, Node.js service, assignment, or review excerpt.

02

Customize the code document

TypeScript highlighting recognizes TSX automatically. Adjust the code size, light or dark theme, line numbers, title, paper format, margins, and page numbering.

03

Preview and download

Inspect the actual paginated PDF, zoom or move around the preview, and download the same layout directly without opening a system print dialog.

Made for typed source code

When a TypeScript code PDF is useful

TypeScript normally belongs in a repository, but a stable paged copy is useful when source must be submitted, reviewed, printed, or attached to documentation without requiring an editor, dependency install, or build toolchain.

React and TSX component reviews

Share components, typed props, hooks, event handlers, and state logic with stable line numbers while preserving embedded JSX markup.

APIs, models, and type contracts

Document interfaces, schemas, generic utilities, service clients, or server handlers as searchable source-code appendices.

Assignments and AI-generated code

Turn TypeScript created in an editor or AI assistant into a conventional document for teaching, assessment, review, or offline reference.

TypeScript-aware formatting

Keep TS and TSX readable on the page

TypeScript combines JavaScript expressions with type syntax, generics, decorators, and sometimes JSX markup. Monospaced formatting preserves that structure while automatic pagination creates conventional PDF pages.

TypeScript syntax highlighting

Keywords, interfaces, type annotations, generics, imports, strings, template literals, numbers, comments, and common expressions receive source-code styling.

TSX-aware editing

Opening a .tsx file uses the same TypeScript option while recognizing JSX tags, attributes, fragments, and expressions embedded in the typed source.

Modern module file support

Open .ts and .tsx files as well as .mts ES modules and .cts CommonJS modules. Original line breaks and indentation remain intact.

Formatting without compilation

The converter does not invoke tsc, read tsconfig.json, install npm packages, resolve imports, execute Node.js, access a browser DOM, or render React.

Common questions

TSX and TypeScript to PDF FAQ

How do I convert a TSX file to PDF?

Click Open file and choose a local .tsx file, or paste the source into the editor. Adjust the document options, inspect the exact page preview, and download the PDF. The source is read locally in your browser.

How do I save a .ts file as a PDF?

Open the local .ts file or paste its TypeScript source into the editor. Choose the page and code settings, inspect the exact preview, and download the PDF with preserved indentation, selectable text, and optional line numbers.

Can I use this as a TSX file viewer?

Yes, for reading and editing TSX source code. Open a .tsx file to inspect its typed JavaScript and JSX markup, then preview the source as paged PDF. The tool does not run the code or render the React component.

Does this render my TSX or React component?

No. It converts the TSX source code itself into a readable PDF. It does not start React, apply CSS, render components, or capture the visual application output.

Does the converter compile or execute TypeScript?

No. It does not run tsc, transpile to JavaScript, load a tsconfig.json file, install dependencies, resolve imports, or execute the source.

Are .mts and .cts TypeScript files supported?

Yes. Both .mts ES module files and .cts CommonJS module files are recognized as TypeScript, alongside .ts and .tsx source files.

Are TypeScript types and generics preserved?

Yes. Interfaces, type aliases, annotations, generics, decorators, optional properties, and the original punctuation remain in the source document.

Will the converter format or rewrite my TypeScript?

It preserves the source text you provide and does not rewrite, transpile, or beautify it. Run a trusted formatter first if you want the code layout changed.

Can I remove the document title or line numbers?

Yes. The title, line numbers, and page numbers are separate settings, and the exact PDF preview updates before download.

Will long TSX files continue across PDF pages?

Yes. Long source files flow across A4 or Letter pages while remaining selectable and searchable instead of being flattened into an image.

Is my TypeScript source uploaded to a server?

The source file and generated PDF are processed in this browser. The code is not sent to a document-conversion API, although normal website and CDN requests can still occur.