2022-05-18 18:47:31 +02:00
|
|
|
// CHAPTER 12. File Attachments
|
|
|
|
|
|
|
|
/** Attaches a file to the pdf. It is attached at document level. */
|
|
|
|
function attachFile(filename, pdf)
|
|
|
|
|
|
|
|
/** Attaches a file, given its file name, pdf, and the page number
|
|
|
|
to which it should be attached. */
|
|
|
|
function attachFileToPage(filename, pdf, pagenumber)
|
|
|
|
|
|
|
|
/** Attaches data from memory, just like attachFile. */
|
|
|
|
function attachFileFromMemory(data, filename, pdf)
|
|
|
|
|
|
|
|
/** Attaches to a page from memory, just like attachFileToPage. */
|
|
|
|
function attachFileToPageFromMemory(data, filename, pdf, pagenumber)
|
2022-05-12 17:57:13 +02:00
|
|
|
|
|
|
|
/** Removes all page- and document-level attachments from a document. */
|
2022-05-18 18:47:31 +02:00
|
|
|
function removeAttachedFiles(pdf)
|
2022-05-12 17:57:13 +02:00
|
|
|
|
2022-05-18 18:47:31 +02:00
|
|
|
/** Lists information about attachments. Call startGetAttachments(pdf) first,
|
|
|
|
then numberGetAttachments to find out how many there are. Then
|
|
|
|
getAttachmentName etc. to return each one 0...(n - 1). Finally, call
|
|
|
|
endGetAttachments to clean up. */
|
|
|
|
function startGetAttachments(pdf)
|
2022-05-12 17:57:13 +02:00
|
|
|
|
2022-05-18 18:47:31 +02:00
|
|
|
/** Lists information about attachments. Call startGetAttachments(pdf) first,
|
|
|
|
then numberGetAttachments to find out how many there are. Then
|
|
|
|
getAttachmentName etc. to return each one 0...(n - 1). Finally, call
|
|
|
|
endGetAttachments to clean up. */
|
|
|
|
function numberGetAttachments()
|
2022-05-12 17:57:13 +02:00
|
|
|
|
2022-05-18 18:47:31 +02:00
|
|
|
/** Gets the name of an attachment. */
|
|
|
|
function getAttachmentName(n)
|
2022-05-12 17:57:13 +02:00
|
|
|
|
2022-05-18 18:47:31 +02:00
|
|
|
/** Gets the page number. 0 = document level. */
|
|
|
|
function getAttachmentPage(n)
|
2022-05-12 17:57:13 +02:00
|
|
|
|
2022-05-18 18:47:31 +02:00
|
|
|
/** Gets the attachment data itself. */
|
|
|
|
function getAttachmentData(n)
|
2022-05-12 17:57:13 +02:00
|
|
|
|
2022-05-18 18:47:31 +02:00
|
|
|
/** Cleans up after getting attachments. */
|
|
|
|
function endGetAttachments()
|