Question How to set page settings on ios app for brother receipt printer (rj-4250wb)

kridak

New member
Joined
Nov 14, 2023
Messages
2
Programming Experience
10+
I am new to Xamarin and i need to print to a brother rj-4250wb receipt printer.

I can get the printer to print but it prints the text i supply and then it line feeds a out a ton of blank pages...it seems like it does not have page settings.

This is the example code i am working with...i have spent a long time and have not been able to figure out how to pass the page size...can someone show me what i am missing please.

Thank you for your help.
C#:
        public void Print(WebView viewToPrint)
        {
            var appleViewToPrint = Platform.CreateRenderer(viewToPrint).NativeView;
            appleViewToPrint.MaximumContentSizeCategory = UIContentSizeCategory.Small;

            var printInfo = UIPrintInfo.PrintInfo;

            printInfoutputType = UIPrintInfoOutputType.General;
            printInfo.JobName = "Testing Printing";
            printInforientation = UIPrintInfoOrientation.Portrait;
            printInfo.Duplex = UIPrintInfoDuplex.None;
           
            var printController = UIPrintInteractionController.SharedPrintController;

            printController.PrintInfo = printInfo;
            printController.ShowsPageRange = true;
            printController.PrintFormatter = appleViewToPrint.ViewPrintFormatter;

            printController.Present(true, (printInteractionController, completed, error) => { });        }
    }
 
Last edited by a moderator:
Xamarin.iOS is just a wrapper around the Apple iOS APIs. My reading of the thread below is that (at least back in 2022) there is no way to set a custom paper size, which is what you need to do so that the OS doesn't think it's printing a full letter size page to a tiny receipt printer.

 

Latest posts

Back
Top Bottom