   setTextContent: (pageNumber, textContent) =>
     @_pages[pageNumber - 1].textContent = textContent
 
-  _dy: (pageNumber, i, j) =>
-    j ?= i + 1
-    page = @_pages[pageNumber - 1]
-    page.textSegments[j].top - page.textSegments[i].top
+  _dy: (pageNumber, i) =>
+    page = @_pages[pageNumber - 1]
+    page.textSegments[i + 1].top - page.textSegments[i].top
 
   _computeLineHeight: (pageNumber) =>
     page = @_pages[pageNumber - 1]

      left = Math.min left, segment.left
      right = Math.max right, (segment.left + segment.width)

    left + (right - left) * SECTION_INDENT_THRESHOLD

  _splitParagraphs: (pageNumber, segmentsIndices, sectionIndentThreshold) =>
    page = @_pages[pageNumber - 1]

    s = 0
    paragraphs = []
    for j in [1...segmentsIndices.length]
      segment = page.textSegments[segmentsIndices[j]]

      if @_dy(pageNumber, segmentsIndices[j - 1], segmentsIndices[j]) > page.lineHeight * SPLIT_PARAGRAPH_THRESHOLD and segment.left > sectionIndentThreshold
        paragraphs.push segmentsIndices[s...j]
        s = j

    paragraphs.push segmentsIndices[s..segmentsIndices.length]
    console.log paragraphs
    paragraphs

  _processParagraph: (pageNumber, segmentsIndices) =>
    page = @_pages[pageNumber - 1]

    page.paragraphs.push @_boundingBox pageNumber, segmentsIndices

  _processSection: (pageNumber, segmentsIndices) =>
    sectionIndentThreshold = @_sectionIndentThreshold pageNumber, segmentsIndices

    for segsIs in @_splitParagraphs pageNumber, segmentsIndices, sectionIndentThreshold
      @_processParagraph pageNumber, segsIs

  _roundArea: (area) =>
    areaRounded = _.clone area


    left: left
    top: top
    right: right
    bottom: bottom
    width: right - left
    height: bottom - top

