Reputation: 5144
I am trying to set a name for a pdf file I generated with FPDF. However for some reason the browser changes some characters.
I am sending this:
$pdfTitle = 'Overview: 2017/2018'
$pdf->Output( 'D', $pdfTitle, true );
Yet when I save my pdf it changes some characters and I and the download name becomes: 'Overview_ 2017_2018'.
I am using UTF-8 encoding on my php file.
FPDF-documentation: http://fpdf.org/en/doc/output.htm
I have two questions:
PS: In the real project the string will come from a database, so I can only access the string programatically and not make direct changes to it.
Upvotes: 3
Views: 2837
Reputation: 7662
You are using the special characters :
and /
in your filename in your code. Because of this fpdf
is filtering your outputs filename.
For example:
Overview: 2017/2018
^ ^ are not supported as filename in Windows & some other OS.
Tip:
You may add .pdf
in your name if file is not saving as pdf file.
Upvotes: 1