rare_print 0.1.2 copy "rare_print: ^0.1.2" to clipboard
rare_print: ^0.1.2 copied to clipboard

Print Lib

中文移步这里

Some documents are not translated into English, welcome to submit RP

RarePrint pub package #

This is a rendering library for printing.
Support preview, use pure instruction printing, avoid the problem of excessive instruction caused by picture printing

Currently supported instruction set:
    CPCL
    TSCL

Document

Print Demo #

    final demoXml = '<page width="880">...</page>'
    var control = ControlBase.createForXml(demoXml);

    var jsonData = json.decode(dataSource);

    control.setDataSource(DataSource(jsonData));

    control.performLayout(BoxConstraints(maxWidth: 837));
    CPCLCanvas canvas = CPCLCanvas();
    canvas.pageSize = control.actualSize;
    canvas.reset();

    control.paint(canvas, Offset.zero);

    canvas.end();

    io.send(canvas.buffer); // canvas.buffer is instruction

Preview Demo #

    ControlBase control;
    @override
    void initState() {
        super.initState();
        final demoXml = '<page width="880">...</page>'
        control = ControlBase.createForXml(demoXml);
    }

    @override
    Widget build(BuildContext context) {
        return PreviewWidget(
            control: control
        );
    }

2
likes
120
pub points
0%
popularity

Publisher

unverified uploader

Print Lib

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

decimal, enough_convert, expressions, flutter, intl, qr, xml

More

Packages that depend on rare_print