|
|
|
|
|
|
|
| Give the template as much guidance as possible |
|
Windward tries to make the output report pixel for pixel identical with the created template. However, it will never be perfect. Some (not all) of the reasons for this difference are:
- Office itself will format slightly differently based on the graphics and printer drivers on a system.
- Office lays out documents slightly differently from what their spec says it should do. As these differences are not documented and Microsoft itself generally does not know exactly how Word/Excel is calculating the placement of text.
- Most measurement comes from the textmetrics provided by the True Type fonts on a system. Different fonts provide different numbers for the same font. The same font file provides different numbers on different operating systems (no idea how this works). If these differ, the output will differ.
- PDF output is not rendered as documented. In a PDF file if you tell it to render a square 1" x 1" we have seen it do everything from 0.9" x 0.9" to 1.05" x 1.05". Again, it appears to depend on the graphics card and printer driver.
- PDF output has no concept of a border, just a polyline. A polyline is a continuous line of constant width and color that is composed of several line segments. PDF output will join all segments smoothly. And if the line ends where it starts, it will join the ends. But if a border changes width, color, style as it is being drawn, one polyline ends and another starts. Even though they end/start at the same location, they are not joined. Also internal borders between cells are not joined to the outer border.
In almost all cases you can easily work with these constraints if you follow these guidelines:
- When you need a page break, put in a hard page break. Do not depend on the page layout to put a soft page break. The same for line breaks, column breaks, etc.
- Avoid absolutely positioned objects whenever possible. Positioning relative to the paragraph, column, (margin for X position) are all fine. Positioning relative to the page or margin on the Y axis is strongly discouraged.
- Set column widths in tables using set values (inches, centimeters, points) or percentages. If you use autofit it will not match because Microsoft is not sure how Word does that. (And Excel column widths will always be a little off because of how Ecel calculates them.)
- For PDF table borders Windward draws a polyline for the outer border, a polyline for each internal row border and a polyline for each internal column border. Whenever possible, keep each individual polyline to a single width, color, and style.
- If you can avoid RTF for templates, do so. The RTF format is very poorly defined and Word does not follow it in many cases. WordML and DOCX are well defined and Word mostly follows them. So a template in RTF is more likely to have something problematic in it.
- Minimize the use of nested tables. If you want a border around a page, do not create a table for the entire page containing the page contents - use the page border. Nested tables are very useful and well supported, so this is a matter of appropiate use, not trying to avoid them. But when you have two approaches and one does not use an additional nested table, use that approach.
- Leave a little room on each page. If you cram everything you can onto a page and it barely holds it all before the hard page break, you will sooner or later run on a system where the fonts are a little larger and your 1 page is now 2 pages.
The best way to approach your template is that it is a document, not a painting. With a painting you say I want this item right here on the page. With a document it is a flowing stream of paragraphs, images, tables, one after the other. Each has proerties that say how it follows the preceeding item and how the next should follow it.
|
View Topic History
|
|
|
 |
Membership: |
 |
Latest:
louisedean |
 |
New Today:
0 |
 |
New Yesterday:
0 |
 |
Overall:
55 |
 |
People Online: |
 |
Visitors:
58 |
 |
Members:
0 |
 |
Total:
58 |
Online Now:
|
|
|
 |
|
 |
|
|
|
|
|