raykolbe / DOMPDFModule

A Zend Framework module for Dompdf
MIT License
61 stars 62 forks source link

Added default PDF file name. #64

Closed raykolbe closed 7 years ago

raykolbe commented 7 years ago

Change Profile

Question Answer
New feature yes
Bug fix no
BC breaks yes
Passing tests yes

Description

Set default file name to "untitled.pdf".

Reason

Having a "null" file name is strange and will cause unexpected side effects when not provided to the PdfModel view model.

[edit] changed "BC breaks no" to "BC breaks yes".

raykolbe commented 7 years ago

Note: This change does in fact break BC. Existing behavior in 0.4.0 treats a "null" file name as a regular PDF resource. That is, Content-Disposition header with attachment disposition type is not presented in the response.

In 0.4.0, by setting a file name we assume, and we trigger, the Content-Disposition response header w/attachment disposition type.

A new change is on the way to handle these cases in a more robust fashion.