Skip to content

Commit 5a25bbc

Browse files
author
Gonchik Tsymzhitov
committed
Confluence: export page as pdf.
1 parent 7d9bc7a commit 5a25bbc

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

atlassian/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.10.2
1+
1.10.3

atlassian/confluence.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,3 +563,21 @@ def cql(self, cql, start=0, limit=None):
563563
if cql is not None:
564564
params['cql'] = cql
565565
return self.get('rest/api/search', params=params)
566+
567+
def get_page_as_pdf(self, page_id):
568+
"""
569+
Export page as standard pdf exporter
570+
:param page_id: Page ID
571+
:return: PDF File
572+
"""
573+
headers = {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Atlassian-Token': 'no-check'}
574+
url = 'spaces/flyingpdf/pdfpageexport.action?pageId={pageId}'.format(pageId=page_id)
575+
return self.get(url, headers=headers, not_json_response=True)
576+
577+
def export_page(self, page_id):
578+
"""
579+
Alias method for export page as pdf
580+
:param page_id: Page ID
581+
:return: PDF File
582+
"""
583+
return self.get_page_as_pdf(page_id)

0 commit comments

Comments
 (0)