Large institutions such as banks and hospitals often produce text-based reports from older mainframe applications and have a need to convert these reports to PDF or TIFF.
As many of these text documents are not the standard Letter, Legal or A4 paper sizes we normally see, a few custom settings are often need to be added to the conversion profile to convert these documents.
Document Conversion Service uses Microsoft Word to convert text documents. We will show you how to take your text report into Word and change its layout so that it displays properly, and then map those changes into settings to add to a conversion profile suitable for processing all your text reports.
As an example, here is our sample text file opened in Notepad. You can see that it is a very wide text document. This sample text file and two sample conversion profiles can be downloaded at the end of this article.
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
- Set the document orientation
- Set the document margins
- Set the document paper size
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 reports is very wide and you can see how much it wraps.
Select File and then Print to 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 layout the text file. Click the back arrow in the upper left corner or on the File tab to return to your document.
The next step is to set the page orientation. As our example document is very wide, we need to set the orientation to Landscape. Use the Orientation drop down menu on the Page Layout tab to do this.
After setting the orientation, we then need to adjust the margins. Changing the margins allows each line of text to be wider or narrower as needed to get each line to match the original layout. Change the margins to one of the predefined margin settings available from the Margins drop down list on the Page Layout tab or set your own custom margins.
You can also set all the margins to 0 to have Word automatically determine the smallest margins.
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.
When the report is not correct at this point this is often because the font used by Word 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 21 inches.
Creating the Conversion Profile
Once the layout has been determined in Word, you have all of the information needed to create a custom conversion profile that you can use to convert your text reports.
Above, we determined we needed an orientation of Landscape, a custom paper size of 21 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 21 x 11.69 --> <add Name="Microsoft.Word.PageSetup.PageWidth" Value="1512" /> <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
A zip file containing the sample document used above and two sample profiles – one for PDF and one for TIFF, can be downloaded below.
Need help getting your layout correct? Have a question? Contact us and we’ll be glad to help.