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

not adding header and footer on pdf:(dompdf and mpdf) #2602

Open
hamedzare1397 opened this issue Apr 3, 2024 · 3 comments
Open

not adding header and footer on pdf:(dompdf and mpdf) #2602

hamedzare1397 opened this issue Apr 3, 2024 · 3 comments

Comments

@hamedzare1397
Copy link

Describe the Bug

i want convert docx to pdf that docx file contains header and footer

Steps to Reproduce

sample code with file docx sample
sample.docx

<?php
require __DIR__ . '/vendor/autoload.php';
$address='sample.docx';
$savePath='sample.pdf';
$word = IOFactory::load($address);  // load file word(docx)
Settings::setPdfRenderer(Settings::PDF_RENDERER_MPDF, __DIR__ . '/../../../vendor/mpdf');
$pdf = new PDF($word);
$render = $pdf->getRenderer();
$render->setPaperSize('A4');
$render->save($savePath);



Expected Behavior

exported file pdf with header

Current Behavior

exported file with out header and footer
exorted pdf.pdf

Context

Please fill in your environment information:

  • PHP Version:8.1
  • PHPWord Version: ^1.2
@hamedzare1397
Copy link
Author

this problem because WORD to PDF
but for this job first exported WORD to HTML then HTML to PDF but WORD to HTML not header and footer supported

@robertnicjoo
Copy link

@hamedzare1397 any solution for adding header and footer?

@Maybe-U
Copy link

Maybe-U commented Apr 17, 2024

@hamedzare1397 any solution for adding header and footer?
try this project https://github.com/gotenberg/gotenberg

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

No branches or pull requests

3 participants