Skip to content

Commit

Permalink
Fixed margins and zoom level WOMM
Browse files Browse the repository at this point in the history
  • Loading branch information
ceneon committed Nov 9, 2018
1 parent 0d2ca8c commit 28faad5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/afip_bill/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,23 @@ def barcode
@barcode ||= Barby::Code25Interleaved.new(code_numbers)
end

def pdfkit_options
{
zoom: '1.65',
'margin-bottom': '0.05in',
'margin-top': '0.05in',
'margin-left': '0.2in',
'margin-right': '0.2in'
}
end

def generate_pdf_file
tempfile = Tempfile.new("afip_bill.pdf")

PDFKit.new(template).to_file(tempfile.path)
PDFKit.new(template, pdfkit_options).to_file(tempfile.path)
end

def generate_pdf_string
PDFKit.new(template).to_pdf
PDFKit.new(template, pdfkit_options).to_pdf
end

private
Expand Down
2 changes: 2 additions & 0 deletions lib/afip_bill/views/shared/_factura_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
}
body {
line-height: 1;
width: 595px !important;
}
ol, ul {
list-style: none;
Expand All @@ -54,6 +55,7 @@
margin-left: -297px;
top: 0px;
width: 595px;
width: 100%;
height: 842px;
overflow: hidden;
border: 1px solid grey;
Expand Down

1 comment on commit 28faad5

@ceneon
Copy link
Member Author

@ceneon ceneon commented on 28faad5 Nov 9, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nan-apps En mi máquina lo veo bastante mejor con estos cambios, pero tengo dudas si tenemos diferencias entre nuestros wkhtmltopdf que nos generan discrepancias entre los que vemos cada uno.

Please sign in to comment.