Sha256: ed112242a6cfa6047b44892ba4db229f469373dfd5c2c2359e3b45dd492ca518

Contents?: true

Size: 562 Bytes

Versions: 28

Compression:

Stored size: 562 Bytes

Contents

module BrDanfe
  class Cce
    def initialize(xml)
      @xml = xml
      @pdf = CceLib::Document.new
    end

    def save_pdf(filename)
      generate
      @pdf.render_file filename
    end

    def render_pdf
      generate
      @pdf.render
    end

    private

    def generate
      CceLib::Header.new(@pdf).render
      CceLib::Barcode.new(@pdf, @xml).render
      CceLib::NfeKey.new(@pdf, @xml).render
      CceLib::Protocol.new(@pdf, @xml).render
      CceLib::Correction.new(@pdf, @xml).render
      CceLib::Footer.new(@pdf).render
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
br_danfe-1.0.0 lib/br_danfe/cce.rb
br_danfe-0.20.0 lib/br_danfe/cce.rb
br_danfe-0.19.0 lib/br_danfe/cce.rb
br_danfe-0.18.0 lib/br_danfe/cce.rb
br_danfe-0.17.8 lib/br_danfe/cce.rb
br_danfe-0.17.7 lib/br_danfe/cce.rb
br_danfe-0.17.6 lib/br_danfe/cce.rb
br_danfe-0.17.5 lib/br_danfe/cce.rb
br_danfe-0.17.4 lib/br_danfe/cce.rb
br_danfe-0.17.3 lib/br_danfe/cce.rb
br_danfe-0.17.2 lib/br_danfe/cce.rb
br_danfe-0.17.1 lib/br_danfe/cce.rb
br_danfe-0.17.0 lib/br_danfe/cce.rb
br_danfe-0.16.0 lib/br_danfe/cce.rb
br_danfe-0.15.1 lib/br_danfe/cce.rb
br_danfe-0.15.0 lib/br_danfe/cce.rb
br_danfe-0.14.5 lib/br_danfe/cce.rb
br_danfe-0.14.4 lib/br_danfe/cce.rb
br_danfe-0.14.3 lib/br_danfe/cce.rb
br_danfe-0.14.2 lib/br_danfe/cce.rb