question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bitmap image not showing in center

See original GitHub issue

When i try to print bitmap image center in EPSON printer its not work when i used Center TAG([C]) then image showing end of horizontal paper without center tag image show start of paper Please help me

` val encodeByte: ByteArray = Base64.decode(bitMapStr, Base64.DEFAULT) val bitmap = BitmapFactory.decodeByteArray(encodeByte, 0, encodeByte.size)

val printer = AsyncEscPosPrinter(printerConnection, 300, 80f, 48)

val img = “[C]${ PrinterTextParserImg.bitmapToHexadecimalString( printer, bitmap )}\n”

return printer.setTextToPrint(img) `

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
DantSucommented, Jun 9, 2021
Method : printFormattedText(String text, float mmFeedPaper)

Print a formatted text and feed paper (mmFeedPaper millimeters). Read the "Formatted Text : Syntax guide" section for more information about text formatting options.

    param String text : Formatted text to be printed.
    param float mmFeedPaper : Millimeter distance feed paper at the end.
    return Printer : Fluent interface

Method : printFormattedTextAndCut(String text, float mmFeedPaper)

Print a formatted text, feed paper (mmFeedPaper millimeters) and cut the paper. Read the "Formatted Text : Syntax guide" section for more information about text formatting options.

    param String text : Formatted text to be printed.
    param float mmFeedPaper : Millimeter distance feed paper at the end.
    return Printer : Fluent interface

Method : printFormattedTextAndOpenCashBox(String text, float mmFeedPaper)

Print a formatted text, feed paper (mmFeedPaper millimeters), cut the paper and open the cash box. Read the "Formatted Text : Syntax guide" section for more information about text formatting options.

    param String text : Formatted text to be printed.
    param float mmFeedPaper : Millimeter distance feed paper at the end.
    return Printer : Fluent interface

printFormattedTextAndCut(yourText, 30f) will put 30mm space at the bottom before cutting paper.

0reactions
iAmAndroidDevelopercommented, Jun 9, 2021

@DantSu Thanks finally resolved alignment issue after given your configuration but need to check other printer as well and also finding anther issues that time i check " Not able to print Chines and Japanese character in receipt"

Read more comments on GitHub >

github_iconTop Results From Across the Web

bitmap image not appearing - Microsoft Community
bitmap image not appearing ; 1) Open Word ; 2) Click on 'Office Button > Word Options > Advanced ; 3) Ensure to...
Read more >
How to align center a bitmap? - android - Stack Overflow
Bitmap myBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.compass); int w = canvas.getWidth(); int h ...
Read more >
Uploading Images into Design Space - Cricut - Help
Design Space gives you the ability to upload your own images and converts them into cuttable shapes. There are two different types of...
Read more >
Vector and Bitmap Image Guide | College of Business
Open Adobe Illustrator and use File -> Open to open your bitmap file. You should see the image appear in the Illustrator window....
Read more >
Read image from graphics file - MATLAB imread - MathWorks
This MATLAB function reads the image from the file specified by filename, inferring the format of the file from its contents.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found