CodeMinion / another_brother

Another Brother Flutter SDK
BSD 3-Clause "New" or "Revised" License
21 stars 19 forks source link

working with margins. TD2120N #68

Closed byNezah closed 11 months ago

byNezah commented 11 months ago

Hi! First of all I would like to thank you for the package. It is helping me a lot.

I work with the TD2120N. I use W50H30 labels but I am not able to use the maximum area of the label. It always adds the margins you can see in the picture. Could you please help me with the configuration to remove the margins?

https://imgur.com/a/i0LYH81

I currently use BinPaper_TD2120N.RD_W50H30mm. I tried with CustomPaperInfo but it gave me ERROR_WRONG_CUSTOM_INFO.

This is the config:

var printer = new pi.Printer(); var printInfo = pi.PrinterInfo(); printInfo.printerModel = pi.Model.TD_2120N; printInfo.printMode = pi.PrintMode.FIT_TO_PAGE; printInfo.isAutoCut = true; printInfo.port = pi.Port.NET; printInfo.numberOfCopies = 1; //printInfo.binCustomPaper = BinPaper_TD2120N.RD_W50H30mm; printInfo.ipAddress = '192.168.1.144'; CustomPaperInfo customPaper = CustomPaperInfo.newCustomDiaCutPaper( Model.TD_2120N, Unit.Mm, 50, 30, 0, 0, 0, 0, 2); printInfo.customPaperInfo = customPaper; // Set the printer info so we can use the SDK to get the printers. await printer.setPrinterInfo(printInfo);

And this is the output:

E/Brother (11261): PrintInfo: {binCustomPaper=null, isSpecialTape=false, rollPrinterCase={name=PJ_ROLLCASE_OFF, id=1}, customPaperLength=0, align={name=LEFT, id=1}, pjSpeed=2, isCutMark=false, printMode={name=FIT_TO_PAGE, id=2}, isCutAtEnd=true, savePrnPath=, isLabelEndCut=false, mirrorPrint=false, customFeed=0, overwrite=true, margin={top=0, left=0}, pjFeedMode={name=PJ_FEED_MODE_FIXEDPAGE, id=2}, isHalfCut=false, ipAddress=192.168.1.144, rotate180=false, labelMargin=0, valign={name=TOP, id=1}, customPaper=, localName=, useLegacyHalftoneEngine=false, macAddress=, port={name=NET, id=4}, lastConnectedAddress=, printQuality={name=NORMAL, id=2}, pjCarbon=false, customPaperWidth=0, printerModel={name=TD_2120N, id=21}, labelNameIndex=-1, skipStatusCheck=false, paperPosition={name=CENTER, id=2}, mode9=true, workPath=, timeout={connectionWaitMSec=500, receiveTimeoutSec=180, processTimeoutSec=-1, sendTimeoutSec=90, closeWaitMSec=500, closeWaitDisusingStatusCheckSec=3}, pjPaperKind={name=PJ_CUT_PAPER, id=2}, rawMode=false, useCopyCommandInTemplatePrint=false, peelMode=false, thresholdingValue=127, customPaperInfo={paperKind={name=DIE_CUT}, markPosition=0.0, printerModel={name=TD_2120N, id=21}, unit={name=Mm}, leftMargin=0.0, topMargin=0.0, rightMargin=0.0, markHeight=0.0, tapeWidth=50.0, bottomMargin=0.0, tapeLength=30.0, labelPitch=2.0}, numberOfCopies=1, labelName={name=UNSUPPORT, model=QL700, id=255}, orientation={name=PORTRAIT, id=1}, isAutoCut=true, dashLine=false, rjDensity=0, softFocusing=false, scaleValue=1.0, paperSize={name=A4, id=1}, halftone={name=PATTERNDITHER, id=2}, checkPrintEnd={name=CPE_CHECK, id=3}, enabledTethering=false, banishMargin=false, trimTapeAfterData=false, pjDensity=5} E/Brother (11261): Parsed Info: com.brother.ptouch.sdk.PrinterInfo@74da01e I/flutter (11261): Print Result: {isBatteryMounted: {name: Unknown, id: -1}, labelId: -1, maxOfBatteryResidualQuantityLevel: -1, labelType: -1, errorCode: {name: ERROR_WRONG_CUSTOM_INFO, id: -1}, isACConnected: {name: Unknown, id: -1}, batteryLevel: -1, batteryResidualQuantityLevel: -1}

Thank you in advance.

byNezah commented 11 months ago

SOLVED!

I create a bin file with the Printer Setting tool with my custom config. Rename it to "RD_W50H30mm.bin" and added to the assets/custom_paper/ folder in my project.

Now, I can print without margins.