Skip to content

⚠️ You are viewing documentation for v10. View the latest documentation →

Attachments

WeasyPrint has the ability to add attachments to output PDFs.

To add an attachment, call the addAttachment method on the service instance:

php
$service = WeasyPrint::prepareSource('<p>WeasyPrint rocks!</p>')
  ->addAttachment('/absolute/path/to/attachment.pdf');
  ->addAttachment('/as/many/as/you/like.png');

Released under the ISC License.