An alternative to using XLIFF format
Instead of XLIFF, TransPDF can generate bi-lingual CSV-format files. These are simple, 3-column text files in which rows and columns are separated by tab characters.
Unlike XLIFF you can edit CSV files using a text editor or spreadsheet tool such as OpenOffice, Google Sheets or Microsoft Excel - you don't need professional CAT tools.
CSV is also easier to use programmatically than XLIFF. Using the free TransPDF API, you could automate changes to text in PDF files by reading / writing the contents in CSV format.
When importing into your spreadsheet program (Excel, OpenOffice etc.) you must tell it that the CSV file is tab-delimited. If you don't tell it, it may guess the wrong format which means your text will be impossible to edit.
The screen-shot above shows the import dialog from Google Sheets.
The screen-shot above shows the import dialog from OpenOffice. The circled items are important - please ensure you replicate these settings when you import.
When you first open the CSV with your spreadsheet program it will probably look a bit of a mess as all the text overflows outside of the cells.
Select columns B and C then change the text wrap setting to 'wrap'. This will ensure the text all stays in its own cells.
Next, resize the columns to make the text more readable. You typically do this by selecting both columns again, then dragging the right-hand edge of column C to make it wider.
The CSV file starts with 5 rows for information only - they should not be edited in any way. If they are edited, you may not be able to load your translation back into TranPDF.
The bi-lingual part of the CSV is spread over column B - the original text and C - the translation. When translating, edit the text in column C - do not alter any other columns.
Each row contains one paragraph from the original document. Each paragraph may have multiple sentences within it.
When a change in text size, colour or font occurs, the CSV will contain an in-line tag. You must carefully copy this tag to your translation to maintain the change in style.
The example above shows a style change just before the web address.
The style tag is switched on by:
<g ctype="x-cstyle" id="3-1">.
and switched off again by:
Any text between the on and off will be affected by the style change. Style changes like this never occur inside one-another. They always start and stop before the next one starts.
When you save your changes make sure you specify .csv, tab-delimited as the format to use for saving. If you use Google Sheets, choose the '.tsv' format file (Tab Separated Values). If you don't, TransPDF may not be able to understand the file and your translation will be unusable.