cpdf-source/javascriptsplits/c13.tex

64 lines
2.2 KiB
TeX
Raw Normal View History

2022-05-18 18:47:31 +02:00
// CHAPTER 12. File Attachments
2022-08-10 20:07:58 +02:00
/** Attaches a file to the pdf. It is attached at document level.
@arg {string} filename file name
@arg {pdf} pdf PDF document */
function attachFile(filename, pdf) {}
2022-05-18 18:47:31 +02:00
/** Attaches a file, given its file name, pdf, and the page number
2022-08-10 20:07:58 +02:00
to which it should be attached.
@arg {string} filename file name
@arg {pdf} pdf PDF document
@arg {number} pagenumber page number */
function attachFileToPage(filename, pdf, pagenumber) {}
/** Attaches data from memory, just like attachFile.
@arg {Uint8Array} data file as a byte array
@arg {string} filename file name to call it in the PDF
@arg {pdf} pdf PDF document */
function attachFileFromMemory(data, filename, pdf) {}
/** Attaches to a page from memory, just like attachFileToPage.
@arg {Uint8Array} data file as a byte array
@arg {string} filename file name to call it in the PDF
@arg {pdf} pdf PDF document
@arg {number} pagenumber page number */
function attachFileToPageFromMemory(data, filename, pdf, pagenumber) {}
/** Removes all page- and document-level attachments from a document.
@arg {pdf} pdf PDF document */
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
2022-08-10 20:07:58 +02:00
endGetAttachments to clean up.
@arg {pdf} pdf PDF document */
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
2022-08-10 20:07:58 +02:00
endGetAttachments to clean up.
@return {number} number of attachments */
function numberGetAttachments() {}
2022-05-12 17:57:13 +02:00
2022-08-10 20:07:58 +02:00
/** Gets the name of an attachment.
@arg {number} n serial number
@return {string} attachment name */
function getAttachmentName(n) {}
2022-05-12 17:57:13 +02:00
2022-08-10 20:07:58 +02:00
/** Gets the page number. 0 = document level.
@arg {number} n serial number
@return {number} attachment page */
function getAttachmentPage(n) {}
2022-05-12 17:57:13 +02:00
2022-08-10 20:07:58 +02:00
/** Gets the attachment data itself.
@arg {number} n serial number
@return {Uint8Array} attachment data */
function getAttachmentData(n) {}
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** Cleans up after getting attachments. */
2022-08-10 20:07:58 +02:00
function endGetAttachments() {}