PHPOffice / PHPWord

A pure PHP library for reading and writing word processing documents
https://phpoffice.github.io/PHPWord/
Other
7.27k stars 2.7k forks source link

Styling issue using PHPWord #2534

Open site2021 opened 10 months ago

site2021 commented 10 months ago

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:

Progi1984 commented 2 months ago

@site2021 Hi, Could you send me a file with error, for analyzing it, please ?