Greets,
I have asked this question previously and had a solution. However, there is problems with the solution, and I'm looking for another.
I have a PHP page open up a new window with the contents being a PDF file fetched from a drive.
The code:
header("Content-type: application/pdf");
$MyFile->PassThru();
$MyFile->Close();
Essentially, it's a passthru of the raw PDF data into a page with a raw header setting the type to PDF.
Now, I would like the title of the contents of the PDF to be shown in the browser title. However, I can't set the <TITLE> tag, because have already stated that it's a PDF file in the raw header.
One workaround (the solution mentioned above) was to create a frameset and load the PDF into the frame. The host page would be pure HTML, complete with <TITLE> and the PDF would live in the frame. This works, but has a side-effect of rendering the printing of the PDF useless from the browser print button. The Acrobat print button behaves normally, but the browser print button will print the web page "holding" the frame. This is a blank sheet of paper.
I would like to provide a solution that allows for the title in the browser, but also allows for printing from any of the print buttons.
Are there any suggestions?
Thanks,
Jason