Skip to content

Commit

Permalink
Merge pull request #11 from vsmoraes/fix-download
Browse files Browse the repository at this point in the history
Fix download ignoring the filename
  • Loading branch information
vsmoraes committed Jan 12, 2016
2 parents eff9e52 + c8e0e55 commit a9352d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# pdf-laravel5

DOMPDF module for Laravel 5
DOMPDF module for Laravel 5. Export your views as PDFs - with css support.

[![Build Status](https://api.travis-ci.org/vsmoraes/pdf-laravel5.svg)](https://travis-ci.org/vsmoraes/pdf-laravel5)
[![License](https://poser.pugx.org/vsmoraes/laravel-pdf/license.svg)](https://packagist.org/packages/vsmoraes/laravel-pdf)
[![Build Status](https://api.travis-ci.org/vsmoraes/pdf-laravel5.svg)](https://travis-ci.org/vsmoraes/pdf-laravel5) [![Latest Stable Version](https://poser.pugx.org/vsmoraes/laravel-pdf/v/stable)](https://packagist.org/packages/vsmoraes/laravel-pdf) [![Total Downloads](https://poser.pugx.org/vsmoraes/laravel-pdf/downloads)](https://packagist.org/packages/vsmoraes/laravel-pdf) [![Latest Unstable Version](https://poser.pugx.org/vsmoraes/laravel-pdf/v/unstable)](https://packagist.org/packages/vsmoraes/laravel-pdf) [![License](https://poser.pugx.org/vsmoraes/laravel-pdf/license)](https://packagist.org/packages/vsmoraes/laravel-pdf)

## Instalation
Add:
```
"vsmoraes/laravel-pdf": "1.0.2"
"vsmoraes/laravel-pdf": "^1.0"
```
To your `composer.json`

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vsmoraes/laravel-pdf",
"description": "DOMPDF module for Laravel 5",
"keywords": ["laravel", "dompdf", "pdf"],
"keywords": ["laravel", "dompdf", "pdf", "html", "css", "html2pdf"],
"license": "MIT",
"authors": [
{ "name": "Vinicius Moraes", "email": "vinicius@archlinux.com.br" }
Expand Down
4 changes: 3 additions & 1 deletion src/Dompdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ public function show($options = ['compress' => 1, 'Attachment' => 0])
$this->render();
$this->clear();

return $this->dompdfInstance->stream(static::DOWNLOAD_FILENAME, $options);
$filename = !is_null($this->filename) ? $this->filename : static::DOWNLOAD_FILENAME;

return $this->dompdfInstance->stream($filename, $options);
}

/**
Expand Down

0 comments on commit a9352d3

Please sign in to comment.