tabs.PageSettings 编辑
The type tabs.PageSettings
is used to control how a tab is rendered as a PDF by the tabs.saveAsPDF()
method.
All its properties are optional.
For setting headers and footers, you can include certain special characters in the strings you supply. These will be replaced in the rendered output as follows:
- "&P": the page number, like "2"
- "&PT": the page number and the total number of pages, like "2 of 3"
- "&D": the current date/time
- "&T": the page title
- "&U": the page URL
Type
Values of this type are objects. They contain the following properties:
edgeBottom
Optionalnumber
. The spacing between the bottom of the footers and the bottom edge of the paper (inches). Default: 0.edgeLeft
Optionalnumber
. The spacing between the left header/footer and the left edge of the paper (inches). Default: 0.edgeRight
Optionalnumber
. The spacing between the right header/footer and the left edge of the paper (inches). Default: 0.edgeTop
Optionalnumber
. The spacing between the top of the headers and the top edge of the paper (inches). Default: 0footerCenter
Optionalstring
. The text for the page's center footer. Default: ''.footerLeft
Optionalstring
. The text for the page's left footer. Default: '&PT'.footerRight
Optionalstring
. The text for the page's right footer. Default: '&D'.headerCenter
Optionalstring
. The text for the page's center header. Default: ''.headerLeft
Optionalstring
. The text for the page's left header. Default: '&T'.headerRight
Optionalstring
. The text for the page's right header. Default: '&U'.marginBottom
Optionalnumber
. The margin between the page content and the bottom edge of the paper (inches). Default: 0.5.marginLeft
Optionalnumber
. The margin between the page content and the left edge of the paper (inches). Default: 0.5.marginRight
Optionalnumber
. The margin between the page content and the right edge of the paper (inches). Default: 0.5.marginTop
Optionalnumber
. The margin between the page content and the top edge of the paper (inches). Default: 0.5.orientation
Optionalinteger
. Page orientation: 0 means "portrait", 1 means "landscape". Default: 0.paperHeight
Optionalnumber
. The paper height in paper size units. Default: 11.0.paperSizeUnit
Optionalinteger
. The paper size unit: 0 = inches, 1 = millimeters. Default: 0.paperWidth
Optionalnumber
. The paper width in paper size units. Default: 8.5.scaling
Optionalnumber
. Page content scaling factor. 1 means 100% or normal size. Default: 1.showBackgroundColors
Optionalboolean
. Whether the page background colors should be shown. Default: false.showBackgroundImages
Optionalboolean
. Whether the page background images should be shown. Default: false.shrinkToFit
Optionalboolean
. Whether the page content should shrink to fit the page width (overrides scaling). Default: true.toFileName
Optionalstring
. The name of the file the PDF is saved in, with or without the.pdf
extension.
Browser compatibility
BCD tables only load in the browser
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论