Skip to main content

join_page_texts

Function join_page_texts 

Source
pub fn join_page_texts<I>(page_texts: I) -> String
where I: IntoIterator, I::Item: AsRef<str>,
Expand description

Join per-page text the way pdftotext and mutool have for twenty years: a form feed (U+000C) after every page, preceded by a blank line so the last paragraph of a page is not glued to the separator.

After every page and not between them, which is the convention every reader in the #390 comparison emits: a fourteen-page document carries fourteen form feeds in pdftotext, mutool, PyMuPDF and pdfminer.six alike. Splitting on U+000C therefore yields n + 1 fields with an empty one at the end, and every consumer of a form-feed stream already drops it. Separating instead of terminating would save that one field and cost the property the convention exists for: that our text is substitutable for theirs (#449).