Skip to content

Styling issue using PHPWord #2534

@site2021

Description

@site2021

Describe the Bug

I'm uploading a word document to my Laravel server using PHPWord and converting it to PDF using (PhpOffice\PhpWord\IOFactory, PhpOffice\PhpWord\Settings) but i'm getting issues with it. PHPWord is not styling the document correctly. Any idea how to solve it?

Steps to Reproduce

public function copyDocxFile(Request $request)
{
$originalFilePath = $request->url;
$fullDocxPath = 'app/public/contratos/' . basename($originalFilePath);
$converter = new OfficeConverter($fullDocxPath);
$converter->convertTo('output-file.pdf');
$converter->convertTo('output-file.html');
$pdfFilePath = storage_path('app/public/temp/'.'nuevo.pdf');
$converter = new OfficeConverter('test-file.docx', $pdfFilePath );
}

Expected Behavior

PDF Document with correct styles without breakline

Captura de Pantalla 2023-12-27 a la(s) 5 30 07 p m

Current Behavior

Breakline

Captura de Pantalla 2023-12-27 a la(s) 5 30 43 p m

Context

Please fill in your environment information:

  • PHP Version: 8.0.2
  • PHPWord Version: ^1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions