[TYPO3-mvc] Action with HTML and PDF
Daniel Lorenz
mailinglists at capsicumnet.de
Wed Jan 5 12:18:31 CET 2011
Hello guys,
I have a new question and can't find a answer in the web and on this
list.
I try to deliver a PDF. In the HTML-Template-File of the showAction I
generate two links.
<f:link.action action="card">Scoring Card</f:link.action>
<f:link.action action="card" format="pdf">Card (PDF)</f:link.action>
Later I will generate the PDF dynamic with fpdf or another extension.
Now I will deliver a static Dokument and change the behaviour later.
In the Template directory of the Controller I have two files for these
Action. card.html and card.pdf.
In the TS I write:
pdf = PAGE
pdf {
typeNum = 203
10 < tt_content.list.20.myext_pi1
config {
disableAllHeaderCode = 1
additionalHeaders = Content-type:application/pdf
xhtml_cleaning = 0
admPanel = 0
}
}
This I found in the book from Jochen and Sebastian.
If I click the PDF Link, then parameter
tx_myext_pi1[format]=pdf
was added to the URL, but it has no effect. The content of the PDF-File
was shown in the same template like the HTML. If I add type=203 to the
URL manually, the browser pop up the file-dialog with index.php as the
filename. After saving, I can't open the file with PDF-Reader. The
header of the PDF looks the same, but the downloaded file is bigger than
the original in the Template-Folder.
Later I will add XLS ans XML too.
Has anybody an idea where my fault is?
Thanks a lot.
Daniel
More information about the TYPO3-project-typo3v4mvc
mailing list