CodeMinion / another_brother

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

[iOS] Print Quality not set on IOS #71

Open alaindeseine opened 10 months ago

alaindeseine commented 10 months ago

Hi @CodeMinion,

Got a quality problem with IOS. In app i fix quality to PrintQuality.HIGH_RESOLUTION, like this:

printInfo.printQuality = PrintQuality.HIGH_RESOLUTION;

With Android everything work as expected, but with IOS, quality is not set to High.

image

I have read on another post that it may be a Brother SDK problem, but the post is old (one year).

Do you have a fix for this?

My test is done on a TD-2125NWB.

Regards, Alain Deseine

CodeMinion commented 10 months ago

Hi @alaindeseine ,

Thanks for reaching out about this. This one has always been strange to me. In the case of Android and iOS we are translating the same field printQuality (https://github.com/CodeMinion/another_brother/blob/main/ios/Classes/Method/BrotherUtils.m#L1249).

After taking a second look I noticed that we are not configuring the print resolution for the TD printers so I'll set some time aside to add it and see if perhaps that solves the issue.

In the meantime, I don't own any TD printers and was wondering if you could help me out by verifying on your end. The only change you would need to perform is to add the following line printerSettings.resolution = [BrotherUtils printResolutionFromMapWithValue:dartPrintQuality2]; under this https://github.com/CodeMinion/another_brother/blob/main/ios/Classes/Method/BrotherUtils.m#L1249 and try printing.

Thanks again for reaching out about this,

alaindeseine commented 10 months ago

Hi @CodeMinion

I will give it a try as soon as possible.

regards.

alaindeseine commented 10 months ago

Hi @CodeMinion

I have add the line as you ask me to do:

` NSDictionary<NSString, NSObject> dartPrintQuality2 = (NSDictionary<NSString, NSObject> )[map objectForKey:@"printQuality"];

    printerSettings.printQuality = [BrotherUtils printQualityFromMapWithValue:dartPrintQuality2];
    printerSettings.resolution = [BrotherUtils printResolutionFromMapWithValue:dartPrintQuality2]; 

`

But, i get a compilation error from xcode :

image

Anything else to update?

Alain

CodeMinion commented 10 months ago

Thanks for giving it a try @alaindeseine . It seems that printer settings object does not include the resolution field. Looking at the docs I don't even see some of the existing fields so not sure how up to date they are https://support.brother.co.jp/j/s/support/html/mobilesdk/reference/ios_v4/brlmtdprintsettings.html

I'll have to set some time aside to dig a bit and see why it's failing.

Have you tried modifying the density setting the density field to see if it affects the quality?

Let me dig a bit more later tonight and see if I can find anything else,

alaindeseine commented 10 months ago

Hi @CodeMinion

You right!

With:

printInfo.rjDensity = 8;

I get same print density as the android one.

For me, this does the trick.

Regards. Alain.