Post by Meeker » Fri May 25, 2012 11:22 pm

Hello,

My client has asked me to put a custom invoice on from a company called Integratedlabels.co.uk. However, it prints an extra blank page. I have tried setting heights for each variable, element so it does not run over. No joy.

When I asked them "OpenCart seems to print an additional page when printing orders. So for 3 orders it would print 4 pages. This seems to be a feature of OpenCart."

Anyone else experienced this?
Many thanks...

User avatar
Active Member

Posts

Joined
Thu Sep 16, 2010 5:45 am

Post by Meeker » Mon May 28, 2012 4:16 pm

Bump - anyone experienced this extra blank invoice page situation?

User avatar
Active Member

Posts

Joined
Thu Sep 16, 2010 5:45 am

Post by rukhairy » Wed May 30, 2012 3:58 am

In case this thing happen to anybody else as well. This vqmod should fix the issue
Download: vqmod-fix-extra-blank-invoice-page

This vqmod will modifu this particular file:

Code: Select all

admin\view\template\sale\order_invoice.tpl
and change this:

Code: Select all

<div style="page-break-after: auto;">
into, this:

Code: Select all

<div style="page-break-after: always;">
vqmod content:

Code: Select all

<modification>
	<id><![CDATA[FIX Extra Blank Invoice Page]]></id>
	<version><![CDATA[1.0]]></version>
	<vqmver><![CDATA[]]></vqmver>
	<author><![CDATA[]]></author>
	<file name="admin/view/template/sale/order_invoice.tpl">
		<operation>
			<search position="replace"><![CDATA[<div style="page-break-after: always;">]]></search>
			<add><![CDATA[<div style="page-break-after: auto;">]]></add>
		</operation>
	</file>
</modification>
Good luck!

Newbie

Posts

Joined
Tue Jun 07, 2011 1:21 am

Post by Meeker » Thu May 31, 2012 5:59 pm

In this invoice template, there are 2 DIV tags. The first one I changed to always as you suggested. The second one I changed to avoid which seemed to work. Thanks for your input - Solved!

User avatar
Active Member

Posts

Joined
Thu Sep 16, 2010 5:45 am

Post by andyblackett » Tue Mar 05, 2013 2:10 am

Followed rukhairy's steps and it worked a treat! Thank you!

Andy

Newbie

Posts

Joined
Mon Dec 31, 2012 7:54 am

Post by Andaho » Fri Nov 22, 2013 4:58 am

I'm also interested in this, but can't find an answer...

If I use the above method, the invoices don't print 1 per page, the next invoice starts at the bottom of the first page (an auto page break, rather than a new div to each page).

It's not a big issue, but it's annoying to print a few invoices out, and realise I forgot to change the number of pages to be printed, and waste 1 piece of integrated label paper on a blank page.... The integrated label paper doesn't like being fed twice, due to the laser heating up the glue on the sticker.

I'm using 1.5.6 and Google Chrome. - Is this a chrome only problem?

New member

Posts

Joined
Wed Jul 10, 2013 4:15 am

Post by Andaho » Fri Nov 22, 2013 7:14 am

Ok, even before I posted the above, I was trying to figure it out for an hour before... But I've found the solution!!!!!

The "user agent stylesheet" in chrome (possibly other browsers too) automatically always adds an 8px border on a page...

In "admin/view/stylesheet/invoice.css" add manual values for the top and bottom margins at 0px, which override the "user agent stylesheet" 8px values:

Code: Select all

body {
	background: #FFFFFF;
	margin-top: 0px;
	margin-bottom: 0px;
}
This prevents a 8px margin overflowing on to a blank page!!!

I had googled this problem for the last 3+ hours but found no solution... So I'm pretty impressed that I figured it out myself! (by inspecting the element of the print preview in chrome)
O0

New member

Posts

Joined
Wed Jul 10, 2013 4:15 am
Who is online

Users browsing this forum: No registered users and 34 guests