Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not added inches unit for Gotenberg compatbility (<8.3) #106

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Builder/Pdf/AbstractChromiumPdfBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,14 @@ public function paperStandardSize(PaperSizeInterface $paperSize): static

public function paperWidth(float $width, Unit $unit = Unit::Inches): static
{
$this->formFields['paperWidth'] = $width.$unit->value;
$this->formFields['paperWidth'] = $width.(Unit::Inches !== $unit ? $unit->value : '');

return $this;
}

public function paperHeight(float $height, Unit $unit = Unit::Inches): static
{
$this->formFields['paperHeight'] = $height.$unit->value;
$this->formFields['paperHeight'] = $height.(Unit::Inches !== $unit ? $unit->value : '');

return $this;
}
Expand All @@ -171,28 +171,28 @@ public function margins(float $top, float $bottom, float $left, float $right, Un

public function marginTop(float $top, Unit $unit = Unit::Inches): static
{
$this->formFields['marginTop'] = $top.$unit->value;
$this->formFields['marginTop'] = $top.(Unit::Inches !== $unit ? $unit->value : '');

return $this;
}

public function marginBottom(float $bottom, Unit $unit = Unit::Inches): static
{
$this->formFields['marginBottom'] = $bottom.$unit->value;
$this->formFields['marginBottom'] = $bottom.(Unit::Inches !== $unit ? $unit->value : '');

return $this;
}

public function marginLeft(float $left, Unit $unit = Unit::Inches): static
{
$this->formFields['marginLeft'] = $left.$unit->value;
$this->formFields['marginLeft'] = $left.(Unit::Inches !== $unit ? $unit->value : '');

return $this;
}

public function marginRight(float $right, Unit $unit = Unit::Inches): static
{
$this->formFields['marginRight'] = $right.$unit->value;
$this->formFields['marginRight'] = $right.(Unit::Inches !== $unit ? $unit->value : '');

return $this;
}
Expand Down