mazenrashed / Printooth

A well documented, high-level Android interface that makes printing via bluetooth printers easier
Mozilla Public License 2.0
400 stars 114 forks source link

Adjust Line Spacing #36

Closed FAB123 closed 4 years ago

FAB123 commented 4 years ago

Everything Working Fine but i want reduce less than getLINE_SPACING_30. how i can do it?

hermawanluo commented 4 years ago

Is there any idea, to reduce line spacing value ?

FAB123 commented 4 years ago

i created new class and declared new variable and fixed to me

companion object {
    val LINE_SPACING_15: Byte = 15
    val LINE_SPACING_10: Byte = 10
    val LINE_SPACING_5: Byte = 5
}
hermawanluo commented 4 years ago

Thank you. I make some variabels in java, and used it, and it works like magic.

    ArrayList<Printable> al = new ArrayList<>();

   Byte LINE_SPACING_15= 15;
    Byte LINE_SPACING_10 = 10;
    Byte LINE_SPACING_5 = 5;

    al.add( (new TextPrintable.Builder())
            .setText("0123456780123456789001234567890")
            .setCharacterCode(DefaultPrinter.Companion.getCHARCODE_PC437())
            .setAlignment(DefaultPrinter.Companion.getALIGNMENT_CENTER())
            .setEmphasizedMode(DefaultPrinter.Companion.getEMPHASIZED_MODE_BOLD())
            .setFontSize(DefaultPrinter.Companion.getCHARCODE_PC437())
            .setLineSpacing(LINE_SPACING_10)
            .setNewLinesAfter(1)
            .build());
Chullian commented 4 years ago

this way is not working now, Any idea?