print_labels.pdf.erb 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <style>
  2. .column {
  3. float: left;
  4. }
  5. .left {
  6. width: 60%;
  7. font-size: 12px;
  8. min-height:5px;
  9. }
  10. .right {
  11. width: 40%;
  12. font-size: 14px;
  13. font-weight: bold;
  14. }
  15. </style>
  16. <div class='pdf-body'>
  17. <% @products.each do |obj| %>
  18. <% (1..obj['print']).each do |i| %>
  19. <div class="text-center" style="padding-top:5px;margin-bottom:5px">
  20. <%= wicked_pdf_barcode_image("#{obj['product'].barcode}.png", options = { width: 150, height: 50 }) %>
  21. </div>
  22. <p style="margin-left:0px;margin-right:0px;margin-top:0px;margin-bottom:10px"><%= obj['product'].name %></p>
  23. <div class="row">
  24. <div class="column left">
  25. <ul style="list-style: none; margin:0px; padding:0px">
  26. <% obj['product'].attrs_array.each do |attribute| %>
  27. <li><%= attribute %></li>
  28. <% end %>
  29. </ul>
  30. </div>
  31. <div class="column right">
  32. <span style="margin:auto"><%= number_to_currency(obj['price'], precision: 2) %></span>
  33. </div>
  34. </div>
  35. <br>
  36. <br>
  37. <% end %>
  38. <% end %>
  39. </div>