From 29bf216dcf91f67fe9dd1922db851acadc4e03cb Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 17 May 2019 08:48:53 -0400 Subject: [PATCH] Make print labels send file as download. Forcing download file for the uptra print labels. This might solve the issue with the print labels not printing correctly. --- lib/GlmPDFLabel.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/GlmPDFLabel.php b/lib/GlmPDFLabel.php index 884edef..b50ae79 100644 --- a/lib/GlmPDFLabel.php +++ b/lib/GlmPDFLabel.php @@ -132,9 +132,21 @@ class GlmPDFLabel extends Cezpdf $this->ezNewPage(); } } - + $out = $this->ezOutput( true ); + $len = strlen( $out ); + header("Content-type: application/force-download\n"); + header("Content-type: application/pdf"); + header("Content-Length: $len"); + /* Correction for the stupid MSIE thing */ + $pdfName = 'MemberLabel' . date('U') . '.pdf'; + if (strstr(getenv('HTTP_USER_AGENT'), 'MSIE')) { + header("Content-Disposition: inline; filename=\"$pdfName\""); + } else { + header("Content-Disposition: attachment; filename=\"$pdfName\""); + } // Output PDF - $this->ezStream(); + print $out; + // $this->ezStream(); } -- 2.17.1