Module: ImgToPdf::Unit

Extended by:
Unit
Included in:
Unit
Defined in:
lib/img_to_pdf/unit.rb

Instance Method Summary collapse

Instance Method Details

#convert_mm_to_pt(mm) ⇒ Float

Returns destination length. points.

Parameters:

  • mm (Float)

    source length. millimeters.

Returns:

  • (Float)

    destination length. points.



8
9
10
# File 'lib/img_to_pdf/unit.rb', line 8

def convert_mm_to_pt(mm)
  return mm / 25.4 * 72
end

#convert_pt_to_in(pt) ⇒ Float

Returns destination length. inches.

Parameters:

  • pt (Float)

    source length. points.

Returns:

  • (Float)

    destination length. inches.



14
15
16
# File 'lib/img_to_pdf/unit.rb', line 14

def convert_pt_to_in(pt)
  return pt / 72
end