将格局格式添加到保存为RTF

时间:2016-11-03 08:37:37

标签: vb.net rtf landscape

我将RichTextBox的内容保存为RTF文件,但我需要在landscape中设置页面。

在网络上寻找RTFLandscape我发现了一些有用但我无法适应我的需求:

我的RTF文件如下所示:

{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}}
\viewkind4\uc1\pard\lang1040\f0\fs24\par
 Amount     Start      End        Rate    Days    Result\par
 \'80 1.000,00 04/11/2015 31/12/2015 0,50%     58    \'80 0,79\par
 \'80 1.000,00 01/01/2016 03/11/2016 0,20%    308    \'80 1,69\par
\par
 Total    \'80 2,48\par
}

我找到了RTF格式为landscape的示例:

{\rtf1\ansi\deff0 {\fonttbl {\f0 Courier;}}
{\colortbl;\red0\green0\blue0;\red255\green0\blue0;}
\landscape
\paperw15840\paperh12240\margl720\margr720\margt720\margb720
\tx720\tx1440\tx2880\tx5760
This line is the default color\line
\tab this line has 1 tab\line
\tab\tab this line has 2 tabs\line
\tab\tab\tab this line has 3 tabs\line
\tab\tab\tab\tab this line has 4 tabs\line
\cf2
\tab This line is red and has a tab before it\line
\cf1
\page This line is the default color and the first line on page 2
}

我已经尝试将\landscape添加到许多不同位置的输出字符串中,但仍然无法使其正常工作。

1 个答案:

答案 0 :(得分:0)

单独添加\landscape是不够的,您还需要将纸张宽度和高度设置为横向:

\landscape\paperw15840\paperh12240