File Output
Posted: Tue Jul 17, 2007 9:25 am
I am currently using HTML2PDF to generate dynamic PDFs on the fly.
Everything works smooth as far generating the PDF goes.
The only problem I am having is when I want to output that PDF file name it cannot have any spaces in the file name. So like if I needed to have "Joe Smith; CPP45746545" as the file name it would not work. But if I used "Joe_Smith_CPP45746545" the file would output successfully.
Here is the output code that I am using:
That output generates a unusable file. Not a valid PDF file because of the spaces. I am wondering why this won't work with spaces because you can put files on your server like "Joe Smith.mp3" and the file is accessible.
The "I" means open the file and if I replaced that "I" with a "D" it would mean download the file. I don't think that has anything to do with my problem here. Either way it does not work.
Everything works smooth as far generating the PDF goes.
The only problem I am having is when I want to output that PDF file name it cannot have any spaces in the file name. So like if I needed to have "Joe Smith; CPP45746545" as the file name it would not work. But if I used "Joe_Smith_CPP45746545" the file would output successfully.
Here is the output code that I am using:
Code: Select all
<?php
$filename = $row["name_of_insured"] . "; " . $row["policy_number"];
$pdf->Output("$filename.pdf", "I");
?>The "I" means open the file and if I replaced that "I" with a "D" it would mean download the file. I don't think that has anything to do with my problem here. Either way it does not work.