Skip to content

setTextRotation on PDF-Writers #1747

Closed
@FabianKoestring

Description

@FabianKoestring

This is:

- [x] a bug report
- [ ] a feature request
- [ ] **not** a usage question (ask them on https://stackoverflow.com/questions/tagged/phpspreadsheet or https://gitter.im/PHPOffice/PhpSpreadsheet)

What is the expected behavior?

setTextRotation() should change the text orientation on PDF-Writers.

What is the current behavior?

If i use setTextRotation(90), the text will be vertically on .xlsx but when i use a PDF-Writer like MPDF or Dompdf the text will be horizontally.

What are the steps to reproduce?

<?php

require __DIR__ . '/vendor/autoload.php';

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
$worksheet = $spreadsheet->getActiveSheet();
$worksheet->getStyle('A7')->getAlignment()->setTextRotation(90);
$worksheet->setCellValue('A7', 'Lorem Ipsum');

header('Content-Type: application/pdf');
header('Content-Disposition: attachment;filename="01simple.pdf"');
header('Cache-Control: max-age=0');

$writer = new Dompdf($spreadsheet);
#$writer = new Mpdf($spreadsheet);
$writer->writeAllSheets();
$writer->save('php://output');

Which versions of PhpSpreadsheet and PHP are affected?

"phpoffice/phpspreadsheet": "~1.15.0",
"mpdf/mpdf": "~8.0.0",
"dompdf/dompdf": "~0.8.6"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions