README.md in br_danfe-0.15.1 vs README.md in br_danfe-0.16.0
- old
+ new
@@ -86,9 +86,32 @@
send_data cce.render_pdf, filename: "cce.pdf", type: "application/pdf"
end
end
+### DAMDFE - _Documento Auxiliar do Manifesto EletrĂ´nico de Documentos Fiscais_
+
+#### Usage in Ruby
+
+ xml = File.read("mdfe.xml")
+
+ mdfe = BrDanfe::Mdfe.new(xml)
+ mdfe.save_pdf("mdfe.pdf")
+
+#### Usage in Rails Controller
+
+ class MdfeController < ApplicationController
+ def new
+ mdfe = Mdfe.find(params[:id])
+ xml_as_string = mdfe.generate_xml # your method that generates the MDF-e's xml
+
+ mdfe = BrDanfe::Mdfe.new(xml_as_string)
+
+ send_data mdfe.render_pdf, filename: "mdfe.pdf", type: "application/pdf"
+ end
+ end
+
+
## I18n
By default, your rails application must be configured to `pt-Br`.
If you need to customize some message or field label, you can override the content of pt-Br.yml file.