Converting Landscape Text Files with DCS

While not an every day task, converting landscape text files to TIFF or PDF using using Document Conversion Service is easy to set up. Large institutions such as banks and hospitals often produce text-based reports from older mainframe applications. These older reports were often designed for wide dot-matrix fanfold printers no longer in use and they now have a need to convert these reports to PDF or TIFF.

Many of these text documents are not the standard Letter, Legal or A4 paper sizes that you normally work with. We will add custom settings for paper size and margins to a conversion profile to convert these documents.

Document Conversion Service uses Microsoft Word to convert text files. We will show you how to take your text report into Word and change its layout so that it displays properly. We then then map those changes into settings to add to a conversion profile suitable for processing these text reports.

Here, we have our sample text file open in Notepad. You can see that it is a very wide text document. You can download this sample text file and two sample conversion profiles from the link at the end of this article.

Sample Landscape Text Report

Determining the Page Layout in Word

Open your text file in Word. If it is very wide, it will look wrong at first. Our sample report is very wide and you can see how much it wraps.

With our text document open in Microsoft Word, we need to do the following to determine the document layout.

  • Select the Document Conversion Service 3.0 printer
  • Pick the document orientation
  • Set the document margins
  • Choose the document paper size
Landscape Text File Open in Word

Select the Printer

Select File-Print, then choose Document Conversion Service 3.0 as the printer for this document. This allows us to use all of the pre-set paper sizes available in the printer to help us with the layout the text file.

Click the back arrow in the upper left corner or on the File tab to return to your document.

Landscape Text Select Printer

Page Orientation

Next, we have to set the page orientation. Word defaults to Portrait but as our example document is very wide, we need to change this to Landscape. Use the Orientation drop down menu on the Page Layout tab to do this.

Landscape Text Select Page Orientation

Adjusting the Page Margins

After setting the orientation, we now need to adjust the margins. Changing the margins allows each line of text to be wider or narrower. Choose from the predefined margins in the Margins drop down list on the Page Layout tab to start. See if one of the preset margins will match the original layout.

If you cannot find a match, go to ‘Custom Margins…’ at the bottom of the margin list. From here you can set your own custom page margin size.

Landscape Text Select Margins

You can also set all the margins to 0 to have Word automatically determine the smallest margins.

Landscape Text Auto Margins

Setting and Adjusting the Page Size

Setting the paper size is the last step. If you know the paper size used to design the report, start with that. In our sample, we know it was A3. This changes the layout but is still not quite correct as the text lines are still wrapping when they shouldn’t be.

Landscape Text Wrapped Text

When the report is not correct at this point this is often because the font Word is using is not the original font used when the report was designed, causing the lines of text to wrap or not wrap. To fix this, select a larger or smaller paper size, or set a custom paper size by adjusting the width and height until the text wraps correctly and the report breaks on the correct pages. In our case, we had to increase the A3 paper width from 16.59 inches to 20 inches.

Landscape Text Final Size

Creating the Conversion Profile

Once the layout has been determined in Word, you have all of the information you need to create a custom conversion profile that you can use for converting the landscape text files.

Above, we determined we needed an orientation of Landscape, a custom paper size of 20 x 11.69 inches, and margins of 0.15 inches. Because we are using a specific custom paper size, we do not need to specify the orientation in the profile.

In conversion profiles, Word paper sizes and margins are set in points, with 1 inch being equal to 72 points. These settings in the conversion profile would be as follows:

<!—Margins set as points 1 inch = 72 points -->

<!-- Print custom paper size 20 x 11.69 -->
<add Name="Microsoft.Word.PageSetup.PageWidth" Value="1440" />
<add Name="Microsoft.Word.PageSetup.PageHeight" Value="842"/>

<!-- Print custom margins 0.15 inch left/right/top/bottom -->
<add Name="Microsoft.Word.PageSetup.LeftMargin" Value="11" />
<add Name="Microsoft.Word.PageSetup.TopMargin" Value="11" />
<add Name="Microsoft.Word.PageSetup.RightMargin" Value="11" />
<add Name="Microsoft.Word.PageSetup.BottomMargin" Value="11" />

If we were using one of Word’s standard paper sizes in our profile, we would then need to add the orientation line to the profile.

<!-- Print using standard paper size A3 -->
<add Name="Microsoft.Word.PageSetup.PaperSize" Value="PaperA3" />
<add Name="Microsoft.Word.PageSetup.Orientation" Value="Landscape"/>

Using the setting above will create a larger version of the original report. What if we want the final report to be at the original paper size of A3 instead of the larger size we just created, how would we do that?

To do this we can tell Document Conversion Service to scale the output back down to the original size before creating the final output file.

<!— Copy larger paper size to A3 (297 mm x 420 mm) paper size -->
<add Name="Processing;Copy" Value="1" />
<add Name="Processing;Units" Value=".1 Millimeters" />
<add Name="Processing;Copy to width" Value="2970" />
<add Name="Processing;Copy to height" Value="4200" />

Try it for Yourself

Download to try this for yourself. The zip file contains the sample document used above and two sample profiles – one for PDF and one for TIFF.

Need help getting your layout correct? Have a question? Contact us and we’ll be glad to help.

Watch Document Conversion Service Tutorials