Sha256: fe8d5d2cfb0e6806f7de5fa92d70e4a3f22ebe44d131d38dccab9189cbb016f1

Contents?: true

Size: 568 Bytes

Versions: 1

Compression:

Stored size: 568 Bytes

Contents

# frozen_string_literal: true

require "zip"
require "nokogiri"

module Consolidate
  module Docx
    class Image < SimpleDelegator
      # Path to use when referencing this image from other documents
      def media_path = "media/#{name}"

      # Path to use when storing this image within the docx
      def storage_path = "word/#{media_path}"

      # Convert width from pixels to EMU
      def width = super * EMU_PER_PIXEL

      # Convert height from pixels to EMU
      def height = super * EMU_PER_PIXEL

      EMU_PER_PIXEL = (914400 / 72)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
standard-procedure-consolidate-0.3.9 lib/consolidate/docx/image.rb