Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ios image #181

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ios/Classes/BluetoothPrintPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ -(NSData *)mapToTscCommand:(NSDictionary *) args {
}else if([@"qrcode" isEqualToString:type]){
[command addQRCode:[x intValue] :[y intValue] :@"L" :5 :@"A" :0 :content];
}else if([@"image" isEqualToString:type]){
NSLog(@"osama test in image mapToTscCommand");
NSData *decodeData = [[NSData alloc] initWithBase64EncodedString:content options:0];
UIImage *image = [UIImage imageWithData:decodeData];
[command addBitmapwithX:[x intValue] withY:[y intValue] withMode:0 withWidth:300 withImage:image];
Expand Down Expand Up @@ -233,9 +234,11 @@ -(NSData *)mapToEscCommand:(NSDictionary *) args {
[command addQRCodeSavewithpL:pl withpH:0 withcn:49 withyfn:80 withm:48 withData:[content dataUsingEncoding:NSASCIIStringEncoding]];
[command addQRCodePrintwithpL:3 withpH:pl+3 withcn:49 withyfn:81 withm:48];
}else if([@"image" isEqualToString:type]){
NSLog(@"osama test in image mapToEscCommand");

NSData *decodeData = [[NSData alloc] initWithBase64EncodedString:content options:0];
UIImage *image = [UIImage imageWithData:decodeData];
[command addOriginrastBitImage:image width:576];
[command addOriginrastBitImage:image width:width height:height ];
}

if([linefeed isEqualToNumber:@1]){
Expand Down