2021-08-10 15:41:18 +02:00
|
|
|
# CHAPTER 12. File Attachments
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def attachFile(filename, pdf):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Attach a file to the pdf. It is attached at document level."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def attachFileToPage(filename, pdf, pagenumber):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Attach a file, given its file name, pdf, and the page number to which
|
|
|
|
it should be attached."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def attachFileFromMemory(data, filename, pdf):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Attach a file from a byte array. It is attached at document level."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def attachFileToPageFromMemory(data, filename, pdf, pagenumber):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Attach a file to a given pag from a byte array. It is attached at
|
|
|
|
document level."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def removeAttachedFiles(pdf):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Remove all page- and document-level attachments from a document."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def getAttachments(pdf):
|
|
|
|
"""List information about attachements. Returns a list of tuples
|
2021-09-01 19:41:10 +02:00
|
|
|
(name, page number, byte array of data). Page 0 = document-level
|
|
|
|
attachment."""
|