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

pagebreak not included in PDF outputs #426

Closed
chc88 opened this issue Nov 14, 2014 · 2 comments
Closed

pagebreak not included in PDF outputs #426

chc88 opened this issue Nov 14, 2014 · 2 comments
Assignees
Milestone

Comments

@chc88
Copy link
Contributor

chc88 commented Nov 14, 2014

domPDF and mpdf both support the certain "pagebreak" constructs to allow html-input to force a pagebreak in the resulting pdf.

http://mpdf1.com/manual/index.php?tid=110
https://code.google.com/p/dompdf/wiki/FAQ (search for "break" its: "Q How do I insert page breaks?")

Unfortunately I am uncertain to where to implement either of the options (I don't have any preferences between mpdf or dompdf).

Is this something which should be included in \PHPWord\Writer\Element\PageBreak.php ?
As this file is empty, it looks like pagebreaks are ignored for the moment?

Hope someone can point me towards the correct location.

@chc88
Copy link
Contributor Author

chc88 commented Nov 14, 2014

Found it, as PageBreak extended TextBreak this was a good startingpoint.

A solution for:

is to change the PageBreak class to:

class PageBreak extends TextBreak
{
    /**
     * Write page break
     *
     * @return string
     */
    public function write()
    {
        return '<pagebreak style="page-break-before: always;" pagebreak="true"></pagebreak>';
    }
}

chc88 added a commit to chc88/PHPWord that referenced this issue Dec 10, 2014
Add new-page function for PDF generation. For multiple PDF-backends - @chc88 PHPOfficeGH-426
@Progi1984
Copy link
Member

Thanks @chc88 for the PR. I close the issue.

@Progi1984 Progi1984 self-assigned this Dec 10, 2014
@Progi1984 Progi1984 added this to the 0.12.0 milestone Dec 10, 2014
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