将横向格式添加到保存为 RTF 的 RichTextBox 内容

Add landscape format to RichTextBox content saved as RTF

我将 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 添加到我的输出字符串中,但仍然无法正常工作。

自己加上\landscape是不行的,还需要设置纸张的宽高为横向:

\landscape\paperw15840\paperh12240