📄 wppagesetup.html
字号:
<pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setColumnCount(1); section.setPageSetup(pageSetup); System.out.println("ColumnCount is "+pageSetup.getColumnCount()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getFirstLineNumber()"><!-- --></A><H3>
getFirstLineNumber</H3>
<PRE>
public int <B>getFirstLineNumber</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.setDisplayLine(true,1,0,1,PrintConstants.LINE_NUMBER_RESTART_EACH_SECTION); section.setPageSetup(pageSetup); System.out.println("FirstLineNumber is "+pageSetup.getFirstLineNumber()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getFontAttribute()"><!-- --></A><H3>
getFontAttribute</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/style/font/FontAttribute.html" title="application.workbooks.workbook.style.font 中的类">FontAttribute</A> <B>getFontAttribute</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(); FontAttribute fontAttr = new FontAttribute(); fontAttr.setFontSize(24); fontAttr.setBold(true); fontAttr.setForeground(java.awt.Color.RED); pageSetup.setFontAttribute(fontAttr); section.setPageSetup(pageSetup); System.out.println("fontAttribute is "+pageSetup.getFontAttribute()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getFooterPosition()"><!-- --></A><H3>
getFooterPosition</H3>
<PRE>
public double <B>getFooterPosition</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.setFooterPosition(2.5,UnitConstants.CENTIMETER); section.setPageSetup(pageSetup); System.out.println("FooterPosition is "+pageSetup.getFooterPosition()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getGridCharSpan()"><!-- --></A><H3>
getGridCharSpan</H3>
<PRE>
public float <B>getGridCharSpan</B>()</PRE>
<DL>
<DD>返回网格字符跨度(以磅值为默认单位)。
<P>
<DD><DL>
<DT><B>返回:</B><DD>网格字符跨度,取值范围为9.45~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.setGridCharSpan(25); section.setPageSetup(pageSetup); System.out.println("GridCharSpan is "+pageSetup.getGridCharSpan()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getGridPageLineSpan()"><!-- --></A><H3>
getGridPageLineSpan</H3>
<PRE>
public float <B>getGridPageLineSpan</B>()</PRE>
<DL>
<DD>返回网格行跨度(以磅值为默认单位)。
<P>
<DD><DL>
<DT><B>返回:</B><DD>网格行跨度,取值范围为14.3~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.setGridPageLineSpan(25f); section.setPageSetup(pageSetup); System.out.println("GridPageLineSpan is "+pageSetup.getGridPageLineSpan()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getGridSettings()"><!-- --></A><H3>
getGridSettings</H3>
<PRE>
public <A HREF="../../../../../application/workbooks/workbook/documents/document/GridSettings.html" title="application.workbooks.workbook.documents.document 中的类">GridSettings</A> <B>getGridSettings</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(); GridSettings settings = pageSetup.getGridSettings(); System.out.println("得到的绘图网格对象:" + settings); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getGridType()"><!-- --></A><H3>
getGridType</H3>
<PRE>
public int <B>getGridType</B>()</PRE>
<DL>
<DD>得到网格类型。
<P>
<DD><DL>
<DT><B>返回:</B><DD>网格类型 <pre> GridConstants.GRIDTYPE_NONE = 0 网格类型:无网格 GridConstants.GRIDTYPE_ROW_ONLY = 1 网格类型:只指定行网格 GridConstants.GRIDTYPE_ROW_CHARS = 2 网格类型:指定行和字符网格 GridConstants.GRIDTYPE_TEXT_ALIGNMENT = 3 网格类型:文字对齐字符网格 </pre> <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setGridType(1); section.setPageSetup(pageSetup); System.out.println("GridType is "+pageSetup.getGridType()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getGutterPosition()"><!-- --></A><H3>
getGutterPosition</H3>
<PRE>
public int <B>getGutterPosition</B>()</PRE>
<DL>
<DD>获取本章节的装订线的位置:放在页面的左端还是顶端。
<P>
<DD><DL>
<DT><B>返回:</B><DD>装订线在页面上的位置。0表示左端;1表示上端 <p> <b>例子:</b> <pre> Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments().getActiveDocument(); Section section = doc.getSection(0); WpPageSetup pageSetup = section.getPageSetup(); pageSetup.setGutter(25,0); section.setPageSetup(pageSetup); System.out.println("GutterPosition is "+pageSetup.getGutterPosition()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getGutterValue()"><!-- --></A><H3>
getGutterValue</H3>
<PRE>
public float <B>getGutterValue</B>()</PRE>
<DL>
<DD>获取本章节的装订线与页面最左或最顶端之间的距离(以磅为单位)。
<P>
<DD><DL>
<DT><B>返回:</B><DD>装订线与页面最左端或最顶端之间的距离,最左或最上视position变量而定 说明: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.setGutter(25,0); section.setPageSetup(pageSetup); System.out.println("GutterValue is "+pageSetup.getGutterValue()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getHeaderPosition()"><!-- --></A><H3>
getHeaderPosition</H3>
<PRE>
public double <B>getHeaderPosition</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.setHeaderPosition(2.5,UnitConstants.CENTIMETER); section.setPageSetup(pageSetup); System.out.println("HeaderPosition is "+pageSetup.getHeaderPosition()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getLineNumberSpacing()"><!-- --></A><H3>
getLineNumberSpacing</H3>
<PRE>
public int <B>getLineNumberSpacing</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.setDisplayLine(true,1,0,1,PrintConstants.LINE_NUMBER_RESTART_EACH_SECTION); section.setPageSetup(pageSetup); System.out.println("LineNumberSpacing is "+pageSetup.getLineNumberSpacing()); </pre></DL>
</DD>
</DL>
<HR>
<A NAME="getLineNumberStyle()"><!-- --></A><H3>
getLineNumberStyle</H3>
<PRE>
public int <B>getLineNumberStyle</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.setDisplayLine(true,1,0,1,PrintConstants.LINE_NUMBER_RESTART_EACH_SECTION); section.setPageSetup(pageSetup);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -