src/iwork/pages

Search:
Group by:
Source   Edit  

structured pages reading: the document body text as paragraphs, plus the section headers and footers and any floating text boxes. tp.documentarchive holds a direct reference to the body's text storage, so this is a much shorter walk than keynote or numbers.

Procs

proc pagesBodyText(idx: ObjectIndex): seq[string] {.
    ...raises: [KeyError, IworkFormatError, Exception], tags: [RootEffect],
    forbids: [].}
the document body split into non-empty paragraphs, in order

Example: cmd: -r:off

import iwork
let doc = openDocument("report.pages")
for paragraph in doc.index.pagesBodyText:
  echo paragraph
Source   Edit  
proc pagesHeadersFooters(idx: ObjectIndex): tuple[headers, footers: seq[string]] {.
    ...raises: [KeyError, IworkFormatError, Exception], tags: [RootEffect],
    forbids: [].}
the header and footer text of every section, in section order, with repeated wording reported once Source   Edit  
proc pagesTextBoxes(idx: ObjectIndex): seq[string] {.
    ...raises: [KeyError, IworkFormatError, Exception], tags: [RootEffect],
    forbids: [].}
text of every floating text box, in object id order; the body, header and footer storages shapes point back at are left out Source   Edit