Two invoices in one A4 page

Hi all,

I would like to know if there is a way to print or create a PDF, with two copies of the same invoice but in one single A4 page, is this possible?

Thanks in advance.

This shouldn’t be too difficult.

Create a custom format with the two invoices on one page, and use the same jinja tags twice. You’ll probably have to turn off Header and Footer as they will appear at the top and bottom of the page, but not for each invoice.

2 Likes

Thanks for the reply Kieran, any chance you have an example of code doing this? or maybe a template perhaps? Thanks in advance

Interesting concept of trying to put 2 copies of an invoice on a single page.

This is something very much outside the scope of what we normally do, but as @Kieran indicated it should not be very difficult for someone familiar with writing report formats.

If this is outside your own abilities, then you might try a local college for a student that might do it for the extra beer money. I know I have had success with that local to me when I needed something simple like print formats made up.

I am not good at that stuff, but there are a bunch of college students that don’t mind doing it just for the extra money. I have had a pretty good success rate with that in the recent past.

BKM :nerd_face:

Thanks bkm, unfortunatelly Im from Argentina and recently starting in the world of free source ERP’s, I have a litle experience with html and PHP, I will of course try to create my own customized PDF but maybe seeing some with examples could gave me an idea, that’s why im asking for a hint.

The print formats use HTML, CSS and Jinja templating to achieve their layout. If you have even a fairly basic understanding of these it’s actually relatively easy to build custom print formats. The guide to getting started is here Printing

The bit that is often the unknown for new developers is the Jinja templating system, But it’s not really hard to learn. A good starting point is Template Designer Documentation — Jinja Documentation (3.1.x) (palletsprojects.com) and for Frappe specific Jinja documentation Jinja API (frappeframework.com)

As a very simple example of how to achieve what you want - the code below will create a Title and customer name, it will produce this twice, with a line between, as you want to achieve.

<div>
    <h1>INVOICE - {{doc.name}}</h1>
    <p><strong>Customer Name : </strong> {{doc.company}}</p>
</div>
<hr>
<div>
    <h1>INVOICE - {{doc.name}}</h1>
    <p><strong>Customer Name : </strong> {{doc.company}}</p>
</div>

Jinja variables are always contained between {{ … }} twin curly brackets and Jinja statements such as IF etc between {% … %}

Hope that helps to get you started.

1 Like

Thank you for the long detailed response Kieran, I will look into it and see If I can achieve what I want. If I can I will be sharing the solution or at least the code in this forum.

Thank you!

Paper saving is the idea, I understand. What if you print 2 copies on A5 pages?

Several users I know do this.