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

Jody Cummings 0 Reputation points
2023-11-14T15:15:32.0333333+00:00

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 out a ton of 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.

	public void Print(WebView viewToPrint)
	{
        var appleViewToPrint = Platform.CreateRenderer(viewToPrint).NativeView;
        appleViewToPrint.MaximumContentSizeCategory = UIContentSizeCategory.Small;

        var printInfo = UIPrintInfo.PrintInfo;

        printInfo.OutputType = UIPrintInfoOutputType.General;
        printInfo.JobName = "Testing Printing";
        printInfo.Orientation = 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) => { });
   }
Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.