Reputation: 135
I am creating an rtf document. The document should have corporate logo across the top of the page with NO margins. There is another corporate image that should be placed across the bottom of the page again with NO margins.
No matter how I change the code it still puts a left margin in place on both the header and footer.
this is the code I am using to try to turn the margins off for placement of these 2 items as well as the code to display both the header and the footer images.
{\rtf1\ansi
{\fonttbl {\f0\froman\fcharset0 Times New Roman;}
{\f1\fswiss\fcharset0 Arial;}
{\f2\fmodern\fcharset0 Courier New;}}
\margl0 \margr0 \margt0 \margb0
\headery10 {\header {\*\shppict{\pict\jpegblip the binary data }}}
\footery10 {\footer {\*\shppict{\pict\jpegblip the binary data }}}
\margl1800 \margr1800
\par some text
\par
\par some more text
\par
\par some more text
\par
}
Can someone show me an example of what the rtf data should look like so that the images are not moved over 1800 twips from the left edge of the page?
Upvotes: 0
Views: 1290
Reputation: 16095
Although you are setting the margins to 0 before the header and footer are defined, the margins are being reset/overridden to 1800 twips after they are defined. Margins in RTF are applied to a section
, so the solution is to create a new section using {\sect}\sbknone
after the header and footer are defined.
So your final example should look like this, for the header and footer to have a 0 twip margin and the page itself to have an 1800 twip margin:
{\rtf1\ansi
{\fonttbl {\f0\froman\fcharset0 Times New Roman;}
{\f1\fswiss\fcharset0 Arial;}
{\f2\fmodern\fcharset0 Courier New;}}
\margl0 \margr0 \margt0 \margb0
\headery10 {\header {\*\shppict{\pict\jpegblip the binary data }}}
\footery10 {\footer {\*\shppict{\pict\jpegblip the binary data }}}
{\sect}\sbknone\margl1800 \margr1800
\par some text
\par
\par some more text
\par
\par some more text
\par
}
Upvotes: 0