mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
Add rotation attribute to Label class to allow rotation of the generated label PDF.
This is necessary when printing labels with width = label width.
This commit is contained in:
parent
7dbcedad40
commit
2fd357c346
|
@ -25,6 +25,17 @@ abstract class Label
|
||||||
*/
|
*/
|
||||||
public abstract function getUnit();
|
public abstract function getUnit();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the PDF rotation.
|
||||||
|
* 0, 90, 180, 270
|
||||||
|
* 0 is a sane default. Override when necessary.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getRotation() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the label's width in getUnit() units
|
* Returns the label's width in getUnit() units
|
||||||
*
|
*
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Label implements View
|
||||||
$pdf = new TCPDF(
|
$pdf = new TCPDF(
|
||||||
$template->getOrientation(),
|
$template->getOrientation(),
|
||||||
$template->getUnit(),
|
$template->getUnit(),
|
||||||
[ $template->getWidth(), $template->getHeight() ]
|
[0 => $template->getWidth(), 1 => $template->getHeight(), 'Rotate' => $template->getRotation()]
|
||||||
);
|
);
|
||||||
|
|
||||||
// Reset parameters
|
// Reset parameters
|
||||||
|
|
Loading…
Reference in a new issue