⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wppagesetup.html

📁 永中OFFICE二次开发帮助文档
💻 HTML
📖 第 1 页 / 共 5 页
字号:
 System.out.println("LineNumberStyle is "+pageSetup.getLineNumberStyle()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getMulitPages()"><!-- --></A><H3>
getMulitPages</H3>
<PRE>
public int <B>getMulitPages</B>()</PRE>
<DL>
<DD>得到页码范围。
<P>
<DD><DL>

<DT><B>返回:</B><DD>页码范围 <pre> 0     普通 1     对称页边距 2     拼页 3     书籍折页 4     反向书籍折页  </pre> <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setMulitPages(1); section.setPageSetup(pageSetup); System.out.println("MulitPages is "+pageSetup.getMulitPages()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getOrientation()"><!-- --></A><H3>
getOrientation</H3>
<PRE>
public int <B>getOrientation</B>()</PRE>
<DL>
<DD>返回本章节的页面方向为竖排方式还是横排方式(页面方向默认为竖排方式)。 <br> 注:页面方向为竖排还是横排与页面的宽度高度有关,     竖排方式下的页面高度等于横排方式下的页面宽度,反之亦然。
<P>
<DD><DL>
<DT><B>覆盖:</B><DD>类 <CODE>application.workbooks.workbook.print.PageSetup</CODE> 中的 <CODE>getOrientation</CODE></DL>
</DD>
<DD><DL>

<DT><B>返回:</B><DD>本章节的页面方向,其常量和相应的值如下: <pre>      PrintConstants.VERTICAL  (竖排方式)      PrintConstants.HORIZONTAL(横排方式) </pre> <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setOrientation(PrintConstants.VERTICAL); section.setPageSetup(pageSetup); int orientation = pageSetup.getOrientation(); System.out.println("本章节的页面方向为哪一种排列方式:" + orientation); </pre><DT><B>另请参见:</B><DD><A HREF="../../../../../application/workbooks/workbook/documents/document/WpPageSetup.html#setOrientation(int)"><CODE>setOrientation(int)</CODE></A>, 
<A HREF="../../../../../application/workbooks/workbook/documents/document/WpPageSetup.html#setPageHeight(float)"><CODE>setPageHeight(float)</CODE></A>, 
<A HREF="../../../../../application/workbooks/workbook/documents/document/WpPageSetup.html#setPageWidth(float)"><CODE>setPageWidth(float)</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getPageBottomMargin()"><!-- --></A><H3>
getPageBottomMargin</H3>
<PRE>
public float <B>getPageBottomMargin</B>()</PRE>
<DL>
<DD>获取本章节的正文最下端与页面底边的距离 (以磅为单位)。
<P>
<DD><DL>

<DT><B>返回:</B><DD>正文最下端与页面底边的距离(以磅为单位),取值范围为0~1584磅 说明:get方法默认返回为磅值,如果要用其他的度量单位(英寸、厘米、毫米、十二点活字),可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setPageBottomMargin(2.5,UnitConstants.CENTIMETER); section.setPageSetup(pageSetup); System.out.println("PageBottomMargin is "+pageSetup.getPageBottomMargin()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getPageHeight()"><!-- --></A><H3>
getPageHeight</H3>
<PRE>
public float <B>getPageHeight</B>()</PRE>
<DL>
<DD>返回本章节的页面高度(以磅为单位)。
<P>
<DD><DL>

<DT><B>返回:</B><DD>页面高度,取值范围为36~1584磅 说明:get方法默认返回为磅值,如果要用其他的度量单位(英寸、厘米、毫米、十二点活字),可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setPageHeight(500f); section.setPageSetup(pageSetup); System.out.println("pageHeight is "+pageSetup.getPageHeight()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getPageLeftMargin()"><!-- --></A><H3>
getPageLeftMargin</H3>
<PRE>
public float <B>getPageLeftMargin</B>()</PRE>
<DL>
<DD>获取章节的正文最左端与页面左边的距离 (以磅为单位)。
<P>
<DD><DL>

<DT><B>返回:</B><DD>正文最左端与页面左边的距离,取值范围为0~1584磅 说明:get方法默认返回为磅值,如果要用其他的度量单位(英寸、厘米、毫米、十二点活字),可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setPageLeftMargin(2.5,UnitConstants.CENTIMETER); section.setPageSetup(pageSetup); System.out.println("PageLeftMargin is "+pageSetup.getPageLeftMargin()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getPageRightMargin()"><!-- --></A><H3>
getPageRightMargin</H3>
<PRE>
public float <B>getPageRightMargin</B>()</PRE>
<DL>
<DD>获取本章节的正文最右端与页面右边的距离 (以磅为单位)。
<P>
<DD><DL>

<DT><B>返回:</B><DD>正文最右端与页面右边的距离(以磅为单位),取值范围为0~1584磅 说明:get方法默认返回为磅值,如果要用其他的度量单位(英寸、厘米、毫米、十二点活字),可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setPageRightMargin(2.5,UnitConstants.CENTIMETER); section.setPageSetup(pageSetup); System.out.println("PageRightMargin is "+pageSetup.getPageRightMargin()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getPages()"><!-- --></A><H3>
getPages</H3>
<PRE>
public int <B>getPages</B>()</PRE>
<DL>
<DD>得到每册中页数。
<P>
<DD><DL>

<DT><B>返回:</B><DD>页数 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setMulitPages(4); pageSetup.setPages(PrintConstants.PAGES_4); section.setPageSetup(pageSetup); System.out.println("Pages is "+pageSetup.getPages()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getPageTopMargin()"><!-- --></A><H3>
getPageTopMargin</H3>
<PRE>
public float <B>getPageTopMargin</B>()</PRE>
<DL>
<DD>获取本章节的正文最上端与页面顶边的距离 (以磅为单位)。
<P>
<DD><DL>

<DT><B>返回:</B><DD>正文最上端与页面顶边的距离,取值范围为0~1584磅 说明:get方法默认返回为磅值,如果要用其他的度量单位(英寸、厘米、毫米、十二点活字),可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setPageTopMargin(2.5f,UnitConstants.CENTIMETER); section.setPageSetup(pageSetup); System.out.println("PageTopMargin is "+pageSetup.getPageTopMargin()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getPageWidth()"><!-- --></A><H3>
getPageWidth</H3>
<PRE>
public float <B>getPageWidth</B>()</PRE>
<DL>
<DD>获取本章节的页面宽度(以磅为单位)。
<P>
<DD><DL>

<DT><B>返回:</B><DD>页面宽度,取值范围为36~1584磅 说明:get方法默认返回为磅值,如果要用其他的度量单位(英寸、厘米、毫米、十二点活字),可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setPageWidth(600f); section.setPageSetup(pageSetup); System.out.println("pageWidth is "+pageSetup.getPageWidth()); </pre></DL>
</DD>
</DL>
<HR>

<A NAME="getPaper()"><!-- --></A><H3>
getPaper</H3>
<PRE>
public java.lang.String <B>getPaper</B>()</PRE>
<DL>
<DD>获得纸张尺寸。       <p> <b>例子:</b> </pre>  Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument();  WpPageSetup pageSetup = doc.getPageSetup();  System.out.println("当前文档打印纸张的尺寸为" +pageSetup.getPaper()); </pre>
<P>
<DD><DL>
<DT><B>覆盖:</B><DD>类 <CODE>application.workbooks.workbook.print.PageSetup</CODE> 中的 <CODE>getPaper</CODE></DL>
</DD>
<DD><DL>

<DT><B>返回:</B><DD>纸张类型,字符串型值</DL>
</DD>
</DL>
<HR>

<A NAME="getSectionStart()"><!-- --></A><H3>
getSectionStart</H3>
<PRE>
public int <B>getSectionStart</B>()</PRE>
<DL>
<DD>获取节的起始点类型。
<P>
<DD><DL>
<DT><B>覆盖:</B><DD>类 <CODE>application.workbooks.workbook.print.PageSetup</CODE> 中的 <CODE>getSectionStart</CODE></DL>
</DD>
<DD><DL>

<DT><B>返回:</B><DD>节的起始点类型,其常量和相应的值如下: <pre> PrintConstants.SECTION_START_NEXT        节的起始点为接续本页 PrintConstants.SECTION_START_NEW_COLUMN  节的起始点为新建栏 PrintConstants.SECTION_START_NEW_PAGE    节的起始点为新建页 PrintConstants.SECTION_START_EVEN        节的起始点为偶数页 PrintConstants.SECTION_START_ODD         节的起始点为奇数页 </pre> <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); section.getBaseText().insertText(0,"this is a test!\n this is a test!\n this is a test!"); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setSectionStart(PrintConstants.SECTION_START_EVEN); section.setPageSetup(pageSetup); System.out.println("节的起始点类型是:"+pageSetup.getSectionStart()); </pre></DL>
</DD>
</DL>
<HR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -