Tableau Server Client (TSC)
中PDFRequestOptions
的用法。
用法
PDFRequestOptions(page_type=None, orientation=None, maxage=-1)
使用此类指定为视图返回的 PDF 格式。或者,您可以通过提供 maxage
值来指定缓存在服务器上的渲染 PDF 的最长期限。请参阅views.populate_pdf
。
属性
名字 | 说明 |
---|---|
page_type |
以 PDF 格式为视图返回的页面类型。 page_type 使用PageType 类:PageType.A3 PageType.A4 PageType.A5 PageType.B5 PageType.Executive PageType.Folio PageType.Ledger PageType.Legal PageType.Letter PageType.Note PageType.Quarto PageType.Tabloid |
orientation |
页面的方向。选项是纵向和横向。选项是使用Orientation 类:Orientation.Portrait Orientation.Landscape |
maxage |
可选的。在刷新之前,渲染的 PDF 将在服务器上缓存的最大分钟数。该值必须是介于 1 和 240 分钟之间的整数。 0 在服务器上将被解释为 1 分钟,因为这是允许的最短间隔。默认情况下,maxage 设置为 -1 ,表示服务器设置中配置的默认行为。 |
查看过滤器您可以使用vf('filter_name', 'filter_value')
添加视图过滤器的方法。生成 PDF 时,指定的过滤器将应用于视图。
示例
# import tableauserverclient as TSC
# server = TSC.Server('https://MY-SERVER')
# sign in, get a specific view, etc.
# set the PDF request options
pdf_req_option = TSC.PDFRequestOptions(page_type=TSC.PDFRequestOptions.PageType.A4,
orientation=TSC.PDFRequestOptions.Orientation.Landscape,
maxage=1)
# (optional) set a view filter
pdf_req_option.vf('Region', 'West')
# retrieve the PDF for a view
server.views.populate_pdf(view_item, pdf_req_option)
相关用法
- Python PDF转CSV用法及代码示例
- Python PDF转Image用法及代码示例
- Python Sympy Permutation.list()用法及代码示例
- Python Pandas Panel.add()用法及代码示例
- Python Pgmagick edge()用法及代码示例
- Python Pandas TimedeltaIndex.memory_usage用法及代码示例
- Python Pandas DatetimeIndex.day用法及代码示例
- Python PyTorch cos()用法及代码示例
- Python Pytorch logspace()用法及代码示例
- Python PyTorch is_storage()用法及代码示例
- Python Pandas Series.ne()用法及代码示例
- Python Pandas Series.dt.days_in_month用法及代码示例
- Python Pandas DataFrame.nsmallest()用法及代码示例
- Python Pandas Index.argmax()用法及代码示例
- Python Pandas Series.shift()用法及代码示例
- Python Pandas Series.str.wrap()用法及代码示例
- Python Pandas TimedeltaIndex.get_level_values用法及代码示例
- Python Pandas.to_datetime()用法及代码示例
- Python Pandas PeriodIndex.start_time用法及代码示例
- Python Pandas TimedeltaIndex.slice_indexer用法及代码示例
- Python Pandas.Categorical()用法及代码示例
- Python Sympy Permutation.rank_nonlex()用法及代码示例
- Python Pandas Series.as_blocks()用法及代码示例
- Python Sympy Partition.next_lex()用法及代码示例
- Python Pandas DatetimeIndex.second用法及代码示例
注:本文由纯净天空筛选整理自tableau.github.io大神的英文原创作品 PDFRequestOptions class。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。