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

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

Open
marcoheine opened this issue Apr 25, 2023 · 1 comment
Open

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

marcoheine opened this issue Apr 25, 2023 · 1 comment

Comments

@marcoheine
Copy link

marcoheine commented Apr 25, 2023

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?

@allestaire
Copy link

There is an existing issue when converting to PDF, either DomPDF or MPDF, most of it loses their style, still there are no solutions to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants