cpdf-source/javascriptsplits/c07.tex

55 lines
1.8 KiB
TeX
Raw Normal View History

2022-05-18 18:47:31 +02:00
// CHAPTER 6. Bookmarks
2022-05-12 17:57:13 +02:00
/** Starts the bookmark retrieval process for a given PDF. */
2022-05-18 18:47:31 +02:00
function startGetBookmarkInfo(pdf)
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** Gets the number of bookmarks for the PDF given to startGetBookmarkInfo. */
function numberBookmarks()
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** Gets the bookmark level for the given bookmark (0...(n - 1)). */
function getBookmarkLevel(n)
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** Gets the bookmark target page for the given PDF (which must be the same
as the PDF passed to startSetBookmarkInfo) and bookmark (0...(n - 1)). */
function getBookmarkPage(pdf, n)
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** Returns the text of bookmark (0...(n - 1)). */
function getBookmarkText(n)
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** True if the bookmark is open. */
function getBookmarkOpenStatus(n)
2022-05-12 17:57:13 +02:00
/** Ends the bookmark retrieval process, cleaning up. */
2022-05-18 18:47:31 +02:00
function endGetBookmarkInfo()
2022-05-12 17:57:13 +02:00
/** Starts the bookmark setting process for n bookmarks. */
2022-05-18 18:47:31 +02:00
function startSetBookmarkInfo(n)
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** Set bookmark level for the given bookmark (0...(n - 1)). */
function setBookmarkLevel(a, b)
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** Sets the bookmark target page for the given PDF (which must be the same as
the PDF to be passed to endSetBookmarkInfo) and bookmark (0...(n - 1)). */
function setBookmarkPage(pdf, a, b)
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** Sets the open status of bookmark (0...(n - 1)). */
function setBookmarkOpenStatus(a, b)
2022-05-12 17:57:13 +02:00
2022-05-18 18:47:31 +02:00
/** Sets the text of bookmark (0...(n - 1)). */
function setBookmarkText(n, t)
2022-05-12 17:57:13 +02:00
/** Ends the bookmark setting process, writing the bookmarks to the given
PDF. */
2022-05-18 18:47:31 +02:00
function endSetBookmarkInfo(pdf)
2022-05-12 17:57:13 +02:00
/** Returns the bookmark data in JSON format. */
2022-05-18 18:47:31 +02:00
function getBookmarksJSON(pdf)
2022-05-12 17:57:13 +02:00
/** Sets the bookmarks from JSON bookmark data. */
2022-05-18 18:47:31 +02:00
function setBookmarksJSON(pdf, data)
2022-05-12 17:57:13 +02:00
/** Typesets a table of contents from existing bookmarks and prepends it to
2022-05-18 18:47:31 +02:00
the document. If bookmark is set, the table of contents gets its own
2022-05-12 17:57:13 +02:00
bookmark. */
2022-05-18 18:47:31 +02:00
function tableOfContents(pdf, font, fontsize, title, bookmark)