[TYPO3-english] Integration lumophpinclude & fpdf

Peter Klein pmk at io.dk
Thu Oct 8 21:46:42 CEST 2009


Hi Klaus.

Your code looks pretty much identical to mine (except for the order of the 
lines)

Dunno if this changes anything, but before I do the Header stuff, I have 
this:

   ob_end_clean();

BTW: Then there's a FPDF lib for TYPO3, so you don't need to run it though 
lumophpinclude. (I have used it myself for several projects)
http://typo3.org/extensions/repository/view/fpdf/current/

--
Peter Klein

"Klaus Fuchs" <klaus at kofuchs.com> wrote in message 
news:mailman.6539.1255029948.16651.typo3-english at lists.netfielders.de...
> Hi Peter,
>
> That was my first guess too, but it doesn't seem to be the issue.
> Here is the code where I prepare the header. This is in the FPDF  library, 
> but I had to modify it a little bit.
>
> header('Content-Type: application/pdf');
> header('Content-Length: '.strlen($this->buffer));
> header('Content-Disposition: attachment; filename="'.$name.'"');
> header('Pragma: public');
> header('Expires: 0');
> header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
> header('Cache-Control: private', false);
> header('Content-Transfer-Encoding: binary');
> ini_set('zlib.output_compression','0');
>
> One thing I noticed is that if I save the PDF in the server, the 
> lumophpinclude doesn't include anything inside the file. But if I send 
> the file as an attachment/download, the extension includes some code  at 
> the end of the file. I don't know if the problem is related to this  or 
> not.
>
> I can't have static links for the PDF files because they are generated 
> dynamically.
>
> I appreciate your help,
>
> Klaus Fuchs
>
>
> On Oct 8, 2009, at 1:30 AM, Peter Klein wrote:
>
>> Hi Klaus.
>>
>> It sounds/looks like you are sending the wrong mimetype in the header.
>> I recently made an extension for pushing content via the Header. It
>> includes a function for extracting and setting the corect mimetype.
>>
>> You can take a look at my extension PMK Forced Download here (More
>> recent version than the one on TER):
>> http://forge.typo3.org/projects/show/extension-pmkfdl
>>
>> --
>> Peter Klein
>>
>>
>> On Wed, 7 Oct 2009 21:22:16 -0700, Klaus Fuchs <klaus at kofuchs.com>
>> wrote:
>>
>>> Hi,
>>>
>>> I'm having problems while integrating lumophpinclude and the fpdf
>>> extensions.
>>>
>>> I have a PHP script that generates a PDF file the header is set to
>>> send the file as an attachment. The problem is that for some browsers
>>> the PDF file is correctly saved, but for others (Safari, Google  Chrome
>>> and iE) the file is saved as an HTML file. You can see the problem
>>> here: 
>>> http://startzeit.de/60.0.html?infoid=0918A087C13E433EAD4C59E2DCDFC94D
>>> (PDF download at the bottom of the page)
>>>
>>> For Firefox and Camino there are no problems.
>>>
>>> Thanks,
>>>
>>> Klaus Fuchs
>>>
>> _______________________________________________
>> TYPO3-english mailing list
>> TYPO3-english at lists.netfielders.de
>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-english
> 




More information about the TYPO3-english mailing list