Menu Close

How to Convert TXT to PDF in Landscape Orientation and 1:1 Scale without Text Rotation

The task is to convert the original TXT file into a landscape PDF with a 1:1 scale. It is important that the text must not be rotated.

The expected output should resemble the following layout:

Converting TXT to PDF in Landscape Orientation and 1:1 Scale without Text Rotation

Solution

Using the following command would seem like the right solution:

2PDF.exe -src "C:\In\." -dst "C:\Out" -oper autorotate orientation:landscape direction:ccw

However, in this case, the text will not be placed correctly. It will be rotated either left or right (depending on the direction:ccw or direction:cw) as shown below.

Incorrect text rotation after converting TXT to PDF

To solve this issue, you will need to:

  • change the document conversion engine;
  • set a custom page width and height for processing TXT files.

Follow the steps below for detailed instructions.

Configuring 2PDF for this task step by step

  1. Open Command Prompt (cmd.exe) and execute the following command:

    2PDF.exe -ini

  2. Navigate to the Advanced tab and locate the Document converting settings section.
  3. Add the following line next to Convert engine(s):
    SetHelper_Text_Pdf="AsposeWords"
    Change document converting engine in 2PDF
    This will change the default conversion component for TXT files.
  4. Change the value of File loading settingsTEXTPaper size to 297 × 210 mm for Width and Height. This size corresponds to A4, but you can use a different paper size if needed.
    Change document converting engine in 2PDF
    This will set a custom width and height for the TXT format.
    Note: You can use more precise values for A4 format: 296.93 mm and 210.06 mm.
  5. Click OK and try converting your TXT files using a standard 2PDF command. For example:

    2PDF.exe -src "C:\In\*.*" -dst "C:\Out"

This will convert the original TXT files into landscape PDFs with a 1:1 scale and text aligned vertically, as shown in the very beginning of this article.

If you encounter any issues or have a specific conversion task that you need assistance with, please reach out to our customer support.