revosystems/product-label

此软件包最新版本(v1.1.1)没有可用的许可信息。

v1.1.1 2022-08-02 11:57 UTC

README

RevoSystems软件包,用于从Revo Retail管理员打印标签。

安装

修改composer json以包含productLabel仓库

"repositories": [
    {
        "type": "vcs",
        "url": "git@github.com:revosystems/productLabel.git"
    }
],

使用composer安装productLabel。

composer require revosystems/productLabel

推荐用法

// Pass a json decoded label and products list to de LabelPage renderer.
$html = ProductLabelPage::make($label)->render($products);

// Now we can use any HtmlToPDF library to render it.
$pdf = SnappyPdf::loadHtml($html)
    ->setOption('zoom', 1.5636)    // Avoid html resize when printing.
    ->setOption('margin-top', 0)->setOption('margin-bottom', 0)
    ->setOption('margin-left', 0)->setOption('margin-right', 0);
return $pdf->inline('invoice.pdf');

可用的纸张

[
    "1274"  => ["width" => 105.0,   "height" => 37.130 ],  //Default label size 105  37.0
    "1284"  => ["width" => 52.5,    "height" => 21.216 ],  //Default label size 52.5 21.2
    "1286"  => ["width" => 52.5,    "height" => 29.706 ],  //Default label size 52.5 29.7
];