ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

Custom paper size and printing layout - HELP!

Greetings!

How can I generate a printout from a custom layout i made? The preview generated by ERPNext is correct but when i generate PDF or try to Print it puts it in a letter size layout. Any suggestions as to what i should do? Thanks!

++Aaron

1 Like

You can set pdf size from setting
go to: Setup -> Printing -> Print Settings

Select
PDF Page Size as Letter

1 Like

Thanks! But is it possible to print on a 8.5" x 6.5" paper?

Also, can i use class=row to create spacing layout in printing?

You can print on any size:
refer/add this code in your print format.(POS Invoice Print Format)

<style>
	.print-format table, .print-format tr, 
	.print-format td, .print-format div, .print-format p {
		font-family: Monospace;
		line-height: 200%;
		vertical-align: middle;
	}
	@media screen {
		.print-format {
			width: 4in;
			padding: 0.25in;
			min-height: 8in;
		}
	}
</style>
5 Likes

Hi all,

I know this is an old post, but this seems to come up again and again. When applying the above code snippet and creating a pdf, the pdf still is of the default format (letter or A4; tested in ERPNext/Frappe v10.1). Is there a code snippet that creates a pdf that has the defined dimensions?

Up. Anyone in 2021 having this issue?

Suggestion (not full tested): Try printing using the Print button instead of the PDF button?

This is still the case as far as I know. There is a different implementation in the label printer module of ERPNextSwiss:

Check out

With this you can define any format you like. Maybe this helps…

Have you tried setting CSS inside HTML. I did it for getting font style and size smaller in print. No matter how many variations of CSS I inserted in CSS section I could never get the font size to reduce.

By inserting directly into HTML I was able to make everything work as I wanted. Maybe CSS section does not talk to HTML.

I am having the same issue

can u please help advise where to insert above code

Since v12 this has been merged into core (maybe no longer working in v13?). You can change borders by adding this to your Print Format > Custom > CSS:

.print-format {
 margin-top: 0mm;
 margin-left: 10mm;
 margin-right: 0mm;
}