File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -44,14 +44,23 @@ def barcode
4444 @barcode ||= Barby ::Code25Interleaved . new ( code_numbers )
4545 end
4646
47+ def pdfkit_options
48+ {
49+ zoom : '1.65' ,
50+ 'margin-bottom' : '0.05in' ,
51+ 'margin-top' : '0.05in' ,
52+ 'margin-left' : '0.2in' ,
53+ 'margin-right' : '0.2in'
54+ }
55+ end
56+
4757 def generate_pdf_file
4858 tempfile = Tempfile . new ( "afip_bill.pdf" )
49-
50- PDFKit . new ( template ) . to_file ( tempfile . path )
59+ PDFKit . new ( template , pdfkit_options ) . to_file ( tempfile . path )
5160 end
5261
5362 def generate_pdf_string
54- PDFKit . new ( template ) . to_pdf
63+ PDFKit . new ( template , pdfkit_options ) . to_pdf
5564 end
5665
5766 private
Original file line number Diff line number Diff line change 2929 }
3030 body {
3131 line-height : 1 ;
32+ width : 595px !important ;
3233 }
3334 ol , ul {
3435 list-style : none;
5455 margin-left : -297px ;
5556 top : 0px ;
5657 width : 595px ;
58+ width : 100% ;
5759 height : 842px ;
5860 overflow : hidden;
5961 border : 1px solid grey;
You can’t perform that action at this time.
0 commit comments