mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -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();
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
|
|
|
@ -54,7 +54,7 @@ class Label implements View
|
|||
$pdf = new TCPDF(
|
||||
$template->getOrientation(),
|
||||
$template->getUnit(),
|
||||
[ $template->getWidth(), $template->getHeight() ]
|
||||
[0 => $template->getWidth(), 1 => $template->getHeight(), 'Rotate' => $template->getRotation()]
|
||||
);
|
||||
|
||||
// Reset parameters
|
||||
|
|
Loading…
Reference in a new issue