PDF Lover

CSV to PDF: garbled accents, semicolons and lost zeros

CSV looks like the simplest format there is. It is also the one where converting the raw file directly goes wrong most often.

Accented and non-Latin text comes out garbled

We converted a UTF-8 CSV containing the names Zoë Müller and José Peña and the city of Athens written in Greek. The PDF showed scrambled characters. Adding a byte order mark to the file did not help.

Table with accented names shown as scrambled characters
Direct CSV conversion: UTF-8 accents and Greek are scrambled.

This is a limitation of our converter, not a fault in your file. Plain English letters and digits are not affected.

Semicolon files are not split into columns

Spreadsheet programs in many European countries export CSV with semicolons, because the comma is the decimal mark there. Our test file in that style was not split correctly: each row stayed as one string, and it broke at the decimal commas instead.

Rows shown with semicolons still in the text and split at decimal commas
Semicolon-separated input: the semicolons stay in the text.

Leading zeros disappear

In the comma-separated test, the identifiers 00123 and 00456 were printed as 123 and 456. The converter reads them as numbers. Postcodes, account numbers and product codes are all at risk.

The reliable route

  1. Open a new, empty workbook and import the CSV (in Excel, Data > From Text/CSV) instead of double-clicking the file.
  2. Choose UTF-8 as the file origin and pick the right delimiter.
  3. Set columns with codes or leading zeros to Text.
  4. Set the page to landscape and fit it to one page wide if the table is broad.
  5. Save as .xlsx and use the Excel converter.

Also expect a header and page number

PDFs made straight from CSV have a header line with an internal file name and a page number at the bottom. Going through .xlsx lets you control headers and footers yourself.

Check before you send

Open the PDF and look at one row with an accent, one with a long number and one with a code that starts with zero. If those three are right, the rest usually is. Very long numbers also deserve a look, since spreadsheets may round digits beyond the fifteenth.

How to tell what your file contains

Open the CSV in a plain text editor, not a spreadsheet. You will see exactly which character separates the values, whether text with commas is wrapped in quotes, and whether codes still have their leading zeros. A spreadsheet program may already have changed what you see.

Do not save the original over itself

Keep the exported CSV untouched. If a spreadsheet opens it and you press Save, dropped zeros and rounded numbers are written back to the file and the original values are gone. Always save the working copy under a new name as .xlsx.

Large exports

A few thousand rows turn into a very long PDF that nobody will read. Filter to the rows that matter, remove columns that only a computer needs, and repeat the header row on each page with Print Titles.

Convert now