Skip to content

Commit

Permalink
reduce identifier to 10 chars
Browse files Browse the repository at this point in the history
  • Loading branch information
anderson-mj committed Nov 20, 2024
1 parent 4dcd6cb commit 7fc64c8
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions app/helpers/pdf_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,20 +474,18 @@ def simple_pdf_table(pdf, widths, header, data, options = {}, join_header_and_ta
padding: 2
}
) do |table|

table.before_rendering_page do |page|

page.row(0).background_color = "E5E5FF"
page.row(0).borders = [:top, :bottom, :left, :right]
page.row(0).column(0).align = :center
page.row(0).column(-1).align = :center

if page.row_count > 1
page.rows(1 .. -1).text_color = "000000"
page.row(-1).borders = [:bottom, :left, :right]
end
end

yield table unless block.nil?
end
pdf.fill_color "000080"
Expand All @@ -496,7 +494,6 @@ def simple_pdf_table(pdf, widths, header, data, options = {}, join_header_and_ta
end
end
end

end
def qrcode_signature(pdf, options = {})
@qrcode_identifier ||= generate_qr_code_key
Expand All @@ -517,8 +514,8 @@ def setup_pdf_config(pdf_type, options)
end

def generate_qr_code_key
12.times.map { "2346789BCDFGHJKMPQRTVWXY".split("").sample }
.insert(4, "-").insert(9, "-").join("")
10.times.map { "2346789BCDFGHJKMPQRTVWXY".split("").sample }
.insert(5, "-").join("")
end
end

Expand Down

0 comments on commit 7fc64c8

Please sign in to comment.