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

allow to use customized pdf library #266

Conversation

SailorMax
Copy link
Contributor

@SailorMax SailorMax commented Oct 30, 2017

This is:

  • a bugfix
  • a new feature

Checklist:

What does it change?
Allow to use customized PDF library without rewriting save() method.
Customized PDF libray sample: https://tcpdf.org/examples/example_003/

Copy link
Member

@PowerKiKi PowerKiKi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call that method createExternalWriterInstance instead of getExternalWriter.

The documentation should be updated to mentions this new feature, somewhere near docs/topics/reading-and-writing-to-file.md:830. As well as the CHANGELOG.md

And there are few minor comments above that should be fixed before merging.

@@ -9,6 +9,18 @@
class Dompdf extends Pdf implements IWriter
{
/**
* Gets the implementation of external PDF library that should be used.
*
* @param array $config Configuration array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no parameter named $config.

*
* @param array $config Configuration array
*
* @return Dompdf implementation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be \Dompdf\Dompdf, not Dompdf

*
* @param array $config Configuration array
*
* @return Mpdf implementation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be \Mpdf\Mpdf not Mpdf

@SailorMax
Copy link
Contributor Author

done.

But can you review my changes in docs/ and CHANGELOG.md? My English is not good for this kind of stuff :)

@PowerKiKi PowerKiKi closed this in 442e612 Nov 4, 2017
@PowerKiKi
Copy link
Member

Thanks !

Dfred pushed a commit to Dfred/PhpSpreadsheet that referenced this pull request Nov 20, 2018
This allow to create and configure the standard instance of the
external PDF libary, before returning it to the standard writer.

Or, more powerful, this allow to provide a custom implementation
of the external PDF library, allowing for custom behaviors. An
example of that would something like: https://tcpdf.org/examples/example_003/

Closes PHPOffice#266
@SailorMax SailorMax deleted the allow_to_use_customized_pdf_libraries branch March 1, 2019 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants