Attach (recommended) or Link to PDF file here:
https://web.archive.org/web/20210607145115/https://www.hsbc.fr/content/dam/hsbc/fr/docs/pib/Contestation-Transaction-Carte-Bancaire.pdf
(in the test corpus)

What is the expected behavior? (add screenshot)
<img width="175" alt="image" src="https://user-images.githubusercontent.com/942640/121593583-f8e4a480-c9f0-11eb-8901-2b3b63bb34c0.png">

What went wrong? (add screenshot)
<img width="124" alt="image" src="https://user-images.githubusercontent.com/942640/121593765-1a459080-c9f1-11eb-8695-461ef4e65c3d.png">

if (!pageArea) {
      pageArea = pageAreas[0];
    }
    const pageAreaParent = pageArea[$getParent]();
    pageAreaParent[$extra] = {
      numberOfUse: 1,
      currentIndex: pageAreaParent.pageArea.children.indexOf(pageArea),
    };
    let targetPageArea;
    let leader = null;
    let trailer = null;
    while (true) {
      targetPageArea = null;
      const page = pageArea[$toHTML]().html;
      mainHtml.children.push(page);
      if (leader) {
        page.children.push(leader[$toHTML](page[$extra].space).html);
        leader = null;
      }
      if (trailer) {
        page.children.push(trailer[$toHTML](page[$extra].space).html);
        trailer = null;
      }
      const contentAreas = pageArea.contentArea.children;
      const htmlContentAreas = page.children.filter(node =>
        node.attributes.class.includes("xfaContentarea")
      );
      for (let i = 0, ii = contentAreas.length; i < ii; i++) {
        const contentArea = (this[$extra].currentContentArea = contentAreas[i]);
        const space = { width: contentArea.w, height: contentArea.h };