Calci.inCalculate Today for a Better Tomorrow

Text to PDF Converter

Type or paste text, download a PDF

The guide

Turning plain text into a PDF that prints properly

Exact A4, Letter and Legal sizes, how margins, font size and line spacing set the page count, why the font is embedded, and why Indian scripts are refused for now.

Last reviewed · 1,827 words

In short

  • Choose the page size of the paper it will be printed on. A Legal page shrunk to fit A4 without stretching prints at 83.5% at most, so 12 pt text comes out at about 10 pt or smaller.
  • To pull a spill-over line back onto the page, change the line spacing or font size first. Lines per page = the text block's height divided by font size × 1.2 × line spacing, rounded down.
  • A one-line printed title takes about two body lines of space on page 1 at single spacing, and less at wider spacing. If a one-page document spills once the title is on, narrow the margins a little rather than shrinking the text again.
  • Text in Hindi, Tamil, Urdu and the other Indian scripts is refused, not drawn broken. Make those documents in a word processor or browser and print to PDF from there.
  • Check a new PDF by looking at the page, not by copying its text. The text layer can be perfect while the letters on the page are blank.

You have plain text, such as a leave application or a list of names, and need a PDF that prints without lines running off the edge or one stray line spilling onto a second page. The converter above measures every line with the same font it embeds, so the lines break in the same places on every device and the page count it shows is the page count of the file you download.

A PDF measures its pages in points, 72 to the inch. Converting from millimetres is pt = mm × 72 ÷ 25.4, so one millimetre is about 2.83 pt.

Page sizeMillimetresInchesPDF points
A4210 × 2978.27 × 11.69595.28 × 841.89
US Letter215.9 × 279.48.5 × 11612 × 792
US Legal215.9 × 355.68.5 × 14612 × 1,008

A4 is set in millimetres, so its sizes in points are rounded to two decimals; Letter and Legal are whole inches, so theirs are exact. Letter is 5.9 mm wider than A4 and 17.6 mm shorter. Legal is as wide as Letter and 58.6 mm taller than A4. Landscape swaps width and height.

Printing on the other paper

Make the PDF the size of the paper it will be printed on. A page shrunk to fit other paper without being stretched can be scaled by no more than the smaller of two ratios: scale = min(paper width ÷ page width, paper height ÷ page height).

PDF pagePaperLargest scale12 pt text prints at, at most
LetterA497.3%11.7 pt
A4Letter94.1%11.3 pt
LegalA483.5%10.0 pt
LegalLetter78.6%9.4 pt

Printed at actual size and centred, a Letter page on A4 loses 2.95 mm from each side, inside the 20 mm margin. A Legal page on A4 loses 29.3 mm at top and bottom, more than the default 20 mm margin, so on a full page the top and bottom lines fall off the paper.

Margins and the text block

The margin is the same on all four sides, 5 to 50 mm, with 20 mm as the default. What is left is the text block: text width = page width − 2 × margin, and the same for the height.

Margin (A4 portrait)Text blockLines per page at 12 pt, 1.15 spacing
5 mm200 × 287 mm49
10 mm190 × 277 mm47
20 mm170 × 257 mm43
30 mm150 × 237 mm40
50 mm110 × 197 mm33

Each line is centred in its own line box, so even the first and last lines keep their ink inside the margins. Page numbers are drawn in the bottom margin, so at margins of 7 mm or more switching them on never costs a line of text. Their baseline is never less than 10 pt (about 3.5 mm) from the bottom edge. Below 7 mm the margin is too thin to hold the number clear of the text, so the text stops up to about 5 pt higher to leave room, which can move a line to the next page. At 5 mm the text itself is very near the paper's edge, so print one test page first.

Font size, line spacing and the page count

Every line takes the same height, line height = font size × 1.2 × line spacing, where single spacing is 1.2 times the font size from one baseline to the next. A page holds as many whole lines as fit: lines per page = floor(text block height ÷ line height).

A4, 20 mm marginsSingle1.151.5Double
10 pt60524030
11 pt55473627
12 pt50433325
14 pt43372821
16 pt37322518

At the default 12 pt and 1.15 spacing, Letter holds 40 lines and Legal 54.

Font size moves the page count twice. A bigger size means fewer lines per page, and because letter widths grow with the size, each line holds fewer words. A list of short lines feels only the first effect; long paragraphs feel both. In the builder's long test, 6,27,692 characters made 205 pages at 11 pt and 224 at 12 pt.

Worked example: a 60-line list on one page

Sixty names, one per line, on A4:

SettingsLines on page 1Pages
12 pt, 1.15 spacing, 20 mm (the defaults)432 (43 + 17)
12 pt, single502 (50 + 10)
10 pt, single601
10 pt, single, with a printed title582 (58 + 2)
10 pt, single, with a title, 15 mm margins601

The title is bold at 1.5 times the body size, rounded to a whole point (15 pt here), in a line box 1.25 times its size, with half a body line of space beneath. That takes 24.75 pt, just over two body lines of 12 pt each, so two names spill. Margins of 15 mm win the space back without shrinking the text.

How plain text is laid out

  • Line breaks, blank lines, indents and runs of spaces are kept. To strip unwanted doubled spaces first, use Remove Extra Spaces.
  • Wrapping works like a word processor's: words fill the line until the next would pass the margin. A word longer than a line, such as a long web address, is broken at the margin.
  • Tabs jump to stops every eight digit widths, about 55 pt (under 2 cm) at 12 pt, so eight stops fit across the 170 mm line of an A4 page with 20 mm margins. A tab moves at least one space past the text, so an entry wider than its column pushes the rest of the row to a later stop.
  • A form-feed character starts a new page.
  • Accents typed as separate marks, such as an e followed by a combining accent, are joined into the single accented letter; zero-width spaces and soft hyphens are removed rather than printed as boxes.
  • A .txt file up to 5 MB can be opened instead: UTF-8, the UTF-16 Notepad calls "Unicode", or Windows-1252. A file that is not plain text, such as a renamed picture, is refused.

Why the font travels inside the PDF

The fourteen standard fonts built into PDF cannot draw the rupee sign. So the converter embeds Noto Sans, which covers ₹, €, £, accented Latin, Greek, Cyrillic and Vietnamese, and the file looks the same on every device.

The regular font file is just over 600 KB (629 KB), but only the letters you used are embedded, so the builder's one-page note came to 3,646 bytes, less than a 170th of the font file. The bold font is fetched only when a title is printed. Characters the font lacks, such as emoji and Chinese, Japanese, Korean or Thai, are written as "?", and the tool says how many.

Look at the page, not only the text

Building this tool exposed a fault in its font-subsetting library. The subset's glyph index uses a short format that works only when every glyph's data has an even length, and Noto Sans stores 1,323 of its 4,503 glyphs with odd lengths. Most letters came out blank, yet the text copied out of the page still looked correct. The converter now pads each glyph before embedding, and a test compares the page pixel by pixel with one made from the whole font. A PDF whose text copies correctly can still print blank letters, so look at any new PDF before sending it.

Why Hindi and other Indian scripts are refused for now

In Devanagari and the other Indian scripts, letters join into conjuncts and vowel signs move around the consonants they belong to, so the order the letters are typed in is not always the order they are drawn. Arranging them is the job of a text-shaping engine. The PDF library used here draws one character after another, so vowel signs would land in the wrong place and conjuncts would fall apart. A line as ordinary as मुझे छुट्टी चाहिए, the sample the converter's own tests use, would come out broken.

So the converter stops instead. It checks by Unicode range, not by whether the font has the letters, because the letters also have to be arranged.

Script refusedLanguages
DevanagariHindi, Marathi, Nepali, Sanskrit
BengaliBengali, Assamese
GurmukhiPunjabi
Gujarati, Odia, Tamil, Telugu, Kannada, Malayalam, Sinhalathe languages of the same names
Ol ChikiSantali
Meetei MayekManipuri
Arabic scriptUrdu

One word in any of these scripts, in the text or the title, stops the whole PDF. The alert names each script with a sample, so you can delete those words. For a document in these languages, print to PDF from a word processor or browser.

Real text against a scanned page

The PDF made here holds characters, not a picture of them. A ToUnicode map ties each drawn letter back to its character, so the text can be selected, copied and searched. A scan or phone photo of a page is an image: nothing on it can be searched until it has been through text recognition.

A picture of a page is usually heavier as well. In the tests for PDF to JPG, which turns finished pages into pictures, a text-only page as a 150 DPI JPEG came to about 30 KB, roughly seven times the 4 KB or so per page of the five-page document below. The two tests used different pages, so treat that as a rough comparison.

How big the file will be

DocumentFile size
A short one-page note3,646 bytes (about 4 KB)
Five pages with a title and page numbers20,969 bytes (about 21 KB)
6,27,692 characters, 205 pages at 11 pt310 KB
The same text, 224 pages at 12 pt341 KB

Long documents work out at about 1.5 KB a page (341 ÷ 224 and 310 ÷ 205). One PDF takes up to 10,00,000 characters, roughly 350 A4 pages at 12 pt. A 6,00,000-character build takes about 3 seconds on a laptop and holds up the page while it runs, so long text waits longer after typing before it rebuilds.

If an upload form sets a minimum size a text PDF falls short of, Increase PDF Size adds padding without changing the pages; whether the form takes the file is up to its own rules.

What this tool assumes

  • One font, Noto Sans, plain and left-aligned: no justification, no bold or italic in the body, no kerning.
  • Indian scripts and Arabic-script Urdu are refused; characters outside the font become "?".
  • The PDF rebuilds a moment after you stop typing; a result from older settings cannot be downloaded.
  • Your text is never uploaded. The only requests the converter makes are for the site's own files, such as the fonts, from calci.in.
  • It cannot know your printer's paper or a form's rules. Match the page size to the paper and check upload rules yourself.

Sources

Frequently asked questions

Is my text uploaded anywhere?

No. The PDF is built in your browser tab with the pdf-lib library. To build it, the page downloads that library and the Noto Sans font from calci.in; your text is never sent. Close the tab and it is gone.

Why can't I make a PDF in Hindi or another Indian language?

Devanagari, Bengali, Tamil, Telugu and the other Indian scripts join letters into conjuncts and move vowel signs around them. That needs a text-shaping engine, and the PDF library used here draws letters one at a time, so words would come out broken. The converter spots these scripts and stops rather than give you a broken PDF. Until it supports them, print to PDF from a word processor or your browser.

Does the rupee sign work?

Yes. ₹, €, £, accented letters such as é, ü and ñ, Greek, Cyrillic and Vietnamese are all in Noto Sans, the font embedded in the PDF, so the file looks the same on every device. Emoji and Chinese, Japanese, Korean or Thai text are not in the font: each such character is written as “?”, and the page tells you how many there were.

Are line breaks, blank lines and tabs kept?

Yes. Every line break and blank line stays, and so do runs of spaces and indents. A tab moves the text to the next tab stop, set every eight digits' width as in Notepad. Long lines wrap between words, measured with the same font that is embedded; a word longer than a whole line, such as a long web address, is broken at the margin instead of running off the page. A form-feed character starts a new page.

How big will the PDF be?

Small, because only the letters you use are embedded, not the whole 600 KB font. In our tests a short one-page note came to about 4 KB and a five-page document with a title and page numbers to about 21 KB. Up to 1,000,000 characters can go in at once.

Can the text in the PDF be copied and searched?

Yes. It is real text, not a picture of text, so it can be selected, copied and searched in any PDF reader. If you give the PDF a title, it is saved as the document title and used for the file name.