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

problem with appendBitmap (print from local storage) #72

Open
joansolabasetis opened this issue Mar 11, 2021 · 0 comments
Open

problem with appendBitmap (print from local storage) #72

joansolabasetis opened this issue Mar 11, 2021 · 0 comments

Comments

@joansolabasetis
Copy link

Hi,
I'm printing a ticket from my printer (sm-s230i) and everything works fine with the exception that I can't print an image from the local storage of my device.
I use appendBitmap. My code is as follow:

const commandsArray = [];
  commandsArray.push({ appendCodePage: StarPRNT.CodePageType.CP858 });
  commandsArray.push({ appendEncoding: StarPRNT.Encoding.Windows1252 });
  commandsArray.push({ appendInternational: StarPRNT.InternationalType.Spain });
  commandsArray.push({ appendAlignment: StarPRNT.AlignmentPosition.Center });

  commandsArray.push({ appendLogo: 1 }); //printed
  commandsArray.push({ append: '\n\n' }); //printed
  commandsArray.push({ appendFontStyle: 'A' }); //printed
  commandsArray.push({ appendEmphasis: 'Firma Cliente\n\n' }); //printed
  uri= 'file:///storage/emulated/0/Pictures/imageBitmap.bmp'
  commandsArray.push({ appendBitmap: uri, width:30, height:30 }); //not printed

I've passed the uri without 'file://', and data image directly, among other solutions but nothing seems to be working.

Is there any possibility that this functionality is not compatible with this printer? Is there any error in my code?

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant