atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

export_page(psgr_id) does not really returns pdf

Open amitkrout opened this issue 4 years ago • 2 comments

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.

amitkrout avatar Nov 30 '21 09:11 amitkrout

Could be related to #891

schubertrod avatar Nov 30 '21 09:11 schubertrod

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 ?

amitkrout avatar Nov 30 '21 11:11 amitkrout