hexaPDF 错误 Box didn't fit multiple times, even on empty page (HexaPDF::Error)


0.47.0 

 Box didn't fit multiple times, even on empty page (HexaPDF::Error)
即使在空白页面上,盒子也无法多次装入
错误原因待查,
偶尔出现。
超过某个长度会出现,但是有时候超过了也不出现。。。

错误出现的源代码:
https://github.com/gettalong/hexapdf/blob/e6aa663a77a206365ca940a77ea1c2a064ae1c95/lib/hexapdf/composer.rb#L453

    def draw_box(box)
      drawn_on_page = true
      while true
        result = @frame.fit(box)
        if result.success?
          @frame.draw(@canvas, result)
          break
        elsif @frame.full?
          new_page
          drawn_on_page = false
        else
          draw_box, box = @frame.split(result)
          if draw_box
            @frame.draw(@canvas, result)
            drawn_on_page = true
            (box = draw_box; break) unless box
          elsif !@frame.find_next_region
            unless drawn_on_page
              raise HexaPDF::Error, "Box didn't fit multiple times, even on empty page"
            end
            new_page
            drawn_on_page = false
          end
        end
      end
      box
    end

https://www.rubydoc.info/gems/hexapdf/0.47.0/HexaPDF/Composer

阅读量: 294
发布于:
修改于: