Skip to content

problem with appendBitmap (print from local storage) #72

Description

@joansolabasetis

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions