Sha256: 3f38f91785153dcec3d87110f483fe2fb0e61e787e72d21229568b5b99662c0f

Contents?: true

Size: 900 Bytes

Versions: 2

Compression:

Stored size: 900 Bytes

Contents

module BrDanfe
  module DanfeNfceLib
    class Document
      def initialize(page_width, page_height)
        @document = Prawn::Document.new(
          page_size: [page_width, page_height],
          page_layout: :portrait,
          left_margin: 0.3.cm,
          right_margin: 0.3.cm,
          top_margin: 0.3.cm,
          botton_margin: 0
        )

        @document.font 'Courier'
        @document.line_width = 0.3
      end

      def render_blank_line(font_size = 6)
        @document.text ' ', size: font_size
      end

      def method_missing(method_name, *args, &block)
        if @document.respond_to? method_name
          @document.send method_name, *args, &block
        else
          super
        end
      end

      def respond_to_missing?(method_name, include_private = false)
        @document.respond_to?(method_name, include_private) || super
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
br_danfe-0.12.1 lib/br_danfe/danfe_nfce_lib/document.rb
br_danfe-0.12.0 lib/br_danfe/danfe_nfce_lib/document.rb