public function getPdfView(Request $request, $id) { $view = $this->getHtmlContent($id); $nombreFact = "factura-{$this->data['row']->serfac}-{$this->data['row']->ejefac}-{$this->data['row']->numfac}.pdf"; $output = \PDF::loadHTML($view)->setPaper('a4')->setOption('margin-right', 0)->setOption('margin-bottom', 0)->setOption('margin-left', 0)->setOption('margin-top', 0)->output(); return Response::make($output, 200, ['Content-Type' => 'application/pdf', 'Content-Disposition' => 'inline; ' . $nombreFact]); }