Skip to content

Word to PDF with MPDF: Missing paragraph/gap #2394

@marcoheine

Description

@marcoheine

I use PHPWord with MPDF to convert Word to PDF.

This is my code:

    `Settings::setPdfRendererName( Settings::PDF_RENDERER_MPDF );
Settings::setPdfRendererPath( '.' );
     $phpWord = IOFactory::load( $_FILES["fileToUpload"]["tmp_name"], 'Word2007' );
$phpWord->save( 'document.pdf', 'PDF' );

header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); 
header("Content-Type: application/pdf");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize('document.pdf'));
@readfile( 'document.pdf' );`

It is working, but there are no gaps between the paragraphs. The gaps are in the original Word-File but in the PDF all lines are directly below each other with no spacing.
Is there a setting for this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions