alfianlensundev / tauri-plugin-printer

Plugin Printer For Tauri
MIT License
44 stars 19 forks source link

any chance of adding ESC/POS support? #14

Open Alii-isk opened 7 months ago

Alii-isk commented 7 months ago

i am building a POS system and i want to print the receipt using Thermal printer 80mm

but i see that this plugin only support the following paper size: "A4" | "A2" | "A3" | "A4" | "A5" | "A6" | "letter" | "legal" | "tabloid"

alfianlensundev commented 7 months ago

i am building a POS system and i want to print the receipt using Thermal printer 80mm

but i see that this plugin only support the following paper size: "A4" | "A2" | "A3" | "A4" | "A5" | "A6" | "letter" | "legal" | "tabloid"

can you try this ?

await print(data, { preview: false, print_setting: { orientation: "portrait", paper: "A4", scale: "shrink" } })

For now, this library is indeed designed for 80mm paper; other paper sizes are still under development

bright-coder commented 7 months ago

nothing happen. i set my esc/pos to default printer.


  // print pdf file
  await print(data, {
    remove_temp: true,
    preview: false, // Set to true if you want to display the preview
    // page_size: {
    //   width: 300, // unit px
    //   heigth: 400, // unit px
    // },
    print_setting: {
      orientation: "portrait", // portrait | landscape
      //method: "simplex", // duplex | simplex | duplexshort
      paper: "A4", // "A2" | "A3" | "A4" | "A5" | "A6" | "letter" | "legal" | "tabloid"
      scale: "shrink", //"noscale" | "shrink" | "fit"
      //repeat: 1, // total copies,
      // range: "1,2,3"    // print page 1,2,3
      // range: {
      //   // print page 1 - 3
      //   from: 1,
      //   to: 3,
      // },
    },
  });
`