solidusio-contrib / solidus_print_invoice

Provide your users with printable PDF invoices in Solidus.
BSD 3-Clause "New" or "Revised" License
18 stars 29 forks source link

Readme uncertainty (for Solidus\Rails beginners) #63

Open czepesch opened 2 years ago

czepesch commented 2 years ago

Hi there! Firstly I apologize if Issues is not right place for that. If so point me a right direction and close this issue.

My problem is, as Rails\Solidus beginner I don't fully understand how to customize this extension.

  1. Set the logo path preference to include your store / company logo. - I placed it in spree.rb (is it right place?), logo now in invoice, but it is huge, covering all page (sizing not working).
  2. Add your own own footer texts to the locale. - is it myapp/config/locales/en.yml? I placed some content there but can't see any changes in invoice
  3. Override any of the partial templates. - how can I do this? I've created /app/views/spree/admin/orders/_header.pdf.prawn and changed fill_color to another color, can't see any changes in the header color.

and so on.. I would be grateful for any hints on how and where to do customization.

citin commented 1 year ago

Hi @czepesch ,

1) I suggest you to read the prawn's manual to achieve this. 2) Exactly, here is an example. Remember to add the keys under en: spree: 3) Yes, I created the file app/views/spree/admin/orders/_footer.pdf.prawn with this content and it worked:

t = make_table([
  [I18n.t('spree.footer_left'), I18n.t('spree.footer_left2'), I18n.t('spree.footer_right'), I18n.t('spree.footer_right2')]
])

# footer
bounding_box [bounds.left, bounds.bottom + 50], :width  => bounds.width do
    font "Helvetica"
    stroke_horizontal_rule
    move_down(5)
    t.draw
end