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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。