module Kramdown::Converter::Pdf::PrawnDocumentExtension::CustomBox

Extension for the formatted box class to recognize images and move text around them.

Public Instance Methods

available_width() click to toggle source
Calls superclass method
    # File lib/kramdown/converter/pdf.rb
457 def available_width
458   return super unless @document.respond_to?(:converter) && @document.converter
459 
460   @document.image_floats.each do |pn, x, y, w, h|
461     next if @document.page_number != pn
462     if @at[1] + @baseline_y <= y - @document.bounds.absolute_bottom &&
463         (@at[1] + @baseline_y + @arranger.max_line_height + @leading >= y - h - @document.bounds.absolute_bottom)
464       return @width - w
465     end
466   end
467 
468   return super
469 end