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

Exporting as pdf

Open Kruttifrutti opened this issue 6 months ago • 5 comments

Hi,

Trying to export as pdf, but only getting an empty pdf.

`def save_file(content, title): file_pdf = open(title + ".pdf", "w") file_pdf.write(content) file_pdf.close() print("Completed")

if name == "main": label = "apitesting" pages = confluence.get_all_pages_by_label(label=label, start=0, limit=10) for page in pages: response = confluence.get_page_as_pdf(page["id"]) save_file(content=response, title=page["title"])`

Error message suggests write() argument must be str, not bytes.

Any clues?

Kruttifrutti avatar Feb 06 '24 20:02 Kruttifrutti