atlassian-python-api
atlassian-python-api copied to clipboard
export_page(psgr_id) does not really returns pdf
I followed atlassian confluence API doc - https://atlassian-python-api.readthedocs.io/confluence.html, but it could not help me to download the confluence page in pdf format. Please refer the below script
from atlassian import Confluence
confluence = Confluence(
url='https://confluence.xxxx/',
username='*****',
password='****',
api_version='cloud'
)
pageID="123456"
file_name = 'test.pdf'
def save_file_to_local(file_name, content):
file_pdf = open(file_name, 'wb')
file_pdf.write(content)
file_pdf.close()
response = confluence.export_page(pageID)
save_file_to_local(file_name=file_name, content=response)
NOTE: It creates a pdf file but i cannot open it because the pdf format is damaged.
Could be related to #891
Looks like Terms and Condition page is captured in a damaged pdf format ignoring pageID when a fresh user account is used. As i am passing the pageID, it should fail with some readable error message rather capturing anything which popup first.
Team WDYT ?