First, you have to install your printer driver. Then go to settings and select Devices.
Then go to Devices and printers.
Set your POS printer as default printer.
Then go to Printing preferences.
Then go to Advanced.
Select 3rd option of paper size and click Ok.
After that go to printer properties.
Go to device settings and select 3rd option of auto.
Please make sure you choose correct paper size(3rd option) when you want to print the invoice.