Closed otrosien closed 3 years ago
Hi,
A4 vs. US letter placement of recipient and seller address (i.e. for envelopes with window)
There is no US letter version. It did not even cross my mind, but could be a nice feature.
formatting of date value formatting of money values - if there is any...? (the example code is a bit inconsistent, sometimes it includes $ sign, sometimes not)
The README mentions this. It's left to you to do it. This is the most flexible options as supporting any use-case people might have could be problematic. For money outputs I wrote https://github.com/strzibny/formatted-money since in Czech rep. we format money differently than in US.
@strzibny I saw your post about 1.0 on reddit and went poking about. I thought a little about the problem and started playing with a ratio-based system in this commit. Have any thoughts about that vs. something you might have in mind that is different?
For example, I can imagine a different approach wherein a particular document size has a set of methods that conform to the various build_*
methods and one just slots in the correct page size generator when making an invoice.
+1 for a US letter version. This looks great, but almost all US businesses use this paper size.
I guess the important thing to note is that Prawn, and thus invoice_printer, produces U.S. letter size PDFs by default, so this is more about adding A4 than adding letter. :)
@janxious Yep, you are right. I honestly used this for electronic invoices only so far, but definitely want it to work ias expected in print both for A4 and letter version. So since this is a letter version actually what does it need to change to make it usable for everyone in the US?
Otherwise yes I think you could try to work on the ratio system a bit more and report back. It's a sensible start.
I think the thing that would need to change to support see-through US envelopes is adding the ability to change where the To:
address is located on the document, which I think would probably work better with a system wherein each kind of document/size has its own printer. Given it's just one feature, that might be overkill and some very particular conditional logic might be simpler short-term.
@janxious Before we deal with the proper solution for the US envelope can finish the work you started on the ratio system? I think it will work nicely.
I would create private methods width
and height
that would take an argument in size for the default us letter and return correct value based on the ration calculation:
@pdf.text_box(
@labels[:sublabels][:name],
size: 12,
at: [0, top_offset - @push_down - 22],
width: width(320),
align: :left
)
end
This way we can support A4 size for the upcoming point release.
Sure. I haven't had much time to work on OSS stuff the last couple weeks. :|
Since you did not start until now, I am taking over to implement this. I might have something within a week.
This is the PR if anyone is interested: https://github.com/strzibny/invoice_printer/compare/a4-format?expand=1
I am keeping this tracking issue for letter version for envelopes.
I am closing it as stale for now, since nobody tried to tackle it. Maybe it's not as important at this time and age.
Willing to reopen if someone would pick it up.
I have a question that I haven't found answered in the readme. How can I handle the following localization issues with invoice_printer:
Thanks, Oliver