You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Xavier Ottolini <xa...@adelis.com> on 2007/01/12 16:10:40 UTC

Blank PDF file

Hi,

After deploying my application with FOP I have got a curious problem. A 
PDF is generated but without any text. The file is completely white. 
There is no text inside. No error is displayed.

The terminal shows ordinary messages. With the system prompt, I saw that 
the request returns normal results.

Has anybody any idea ?

Best regards

Xavier

-- 
Pour préservez l’environnement n’imprimez cet e-mail qu’en cas de nécessité.

Xavier Ottolini
Développeur multimédia

Adelis
37 rue d'Engwiller
67350 La Walck
France
Téléphone : +33 (0) 3 69 20 29 02
Télécopie : +33 (0) 3 88 72 29 19
http://www.adelis.com



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Blank PDF file

Posted by Xavier Ottolini <xa...@adelis.com>.
Hi,

The problem is solved.

There was some added parameters in OpenCms to set the Title and the 
Content-type. I removed them and now it works :-)

Thank you Jeremias and Chris. You helped me to know that the problem was 
not in FOP but in the JSP file.

Best regards,

Xavier

Xavier Ottolini a écrit :
> Thank you Jeremias and Chris.
>
> Well I run fop embeded in a JSP file (because I need to keep the 
> session with the OpenCms content management system).
> The URL ends with ".pdf".
> The problem occures in Internet Explorer and Firefox 1.5.
>
> I tried to save the ByteArrayOutputStream to a file. The file is correct.
>
> Here is the code
>
>     File pdfFile = new File("D:/temp/ResultXML2PDF.pdf");
>    java.io.FileOutputStream outFile = new 
> java.io.FileOutputStream(pdfFile);
>    decompteSante.setDecomptesStyleSheetUri("D:/decomptes.xsl");
>   // Transform the XSL and the XMF to get the PDF data
>    ByteArrayOutputStream outPDF = decompteSante.getDecomptes();
>
>    //Prepare response
>    response.setHeader("Content-Disposition", "attachment; filename=" + 
> fileName );
>    response.setContentLength(outPDF.size());
>                  //Send content to Browser
>    response.getOutputStream().write(outPDF.toByteArray());
>    // the file is blank
>
>    // create a dump file
>   try {
>        outFile.write(outPDF.toByteArray());
>        // the dump file is OK
>    } finally {
>                outFile.close();
>    }
>    response.getOutputStream().flush();
>
> I send you the attached blank file  :
>
> Best regards,
>
> Xavier
>
> Jeremias Maerki a écrit :
>> Write the byte array with the PDF to a file for debugging and check if
>> it is still blank when opened outside the browser. If it is not, at
>> least you will know that it's a browser problem. If it is blank, please
>> post the PDF so we can take a look what could be wrong.
>>
>> Make sure the URL used to generate the PDF ends with ".pdf" as described
>> here:
>> http://xmlgraphics.apache.org/fop/0.93/servlets.html#ie
>>
>> And don't forget to go through all the replies of the thread Chris
>> pointed you to. I'm pretty sure that you haven't hit a new problem.
>>
>> On 12.01.2007 17:23:23 Xavier Ottolini wrote:
>>  
>>> Hi,
>>>
>>> My problem is really serious.
>>> I checked that the XML source normaly buid OK. The XSL has not changed.
>>>
>>> If I print
>>> out.size();
>>> It returns  207658.
>>>
>>> I do not know why is my page white.
>>>
>>> Has anybody already meet such problem ?
>>>
>>> Best Regards
>>>
>>> Xavier
>>>
>>> Xavier Ottolini a écrit :
>>>    
>>>> Hi,
>>>>
>>>> After deploying my application with FOP I have got a curious 
>>>> problem. A PDF is generated but without any text. The file is 
>>>> completely white. There is no text inside. No error is displayed.
>>>>
>>>> The terminal shows ordinary messages. With the system prompt, I saw 
>>>> that the request returns normal results.
>>>>
>>>> Has anybody any idea ?
>>>>
>>>> Best regards
>>>>
>>>> Xavier
>>>>
>>>>       
>>> -- 
>>> Pour préservez l’environnement n’imprimez cet e-mail qu’en cas de 
>>> nécessité.
>>>
>>> Xavier Ottolini
>>> Développeur multimédia
>>>
>>> Adelis
>>> 37 rue d'Engwiller
>>> 67350 La Walck
>>> France
>>> Téléphone : +33 (0) 3 69 20 29 02
>>> Télécopie : +33 (0) 3 88 72 29 19
>>> http://www.adelis.com
>>>     
>>
>>
>> Jeremias Maerki
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
>> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>>
>>   
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org

-- 
Pour préservez l’environnement n’imprimez cet e-mail qu’en cas de nécessité.

Xavier Ottolini
Développeur multimédia

Adelis
37 rue d'Engwiller
67350 La Walck
France
Téléphone : +33 (0) 3 69 20 29 02
Télécopie : +33 (0) 3 88 72 29 19
http://www.adelis.com



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Blank PDF file

Posted by Xavier Ottolini <xa...@adelis.com>.
Thank you Jeremias and Chris.

Well I run fop embeded in a JSP file (because I need to keep the session 
with the OpenCms content management system).
The URL ends with ".pdf".
The problem occures in Internet Explorer and Firefox 1.5.

I tried to save the ByteArrayOutputStream to a file. The file is correct.

Here is the code

     File pdfFile = new File("D:/temp/ResultXML2PDF.pdf");
    java.io.FileOutputStream outFile = new 
java.io.FileOutputStream(pdfFile);
    decompteSante.setDecomptesStyleSheetUri("D:/decomptes.xsl");
   // Transform the XSL and the XMF to get the PDF data
    ByteArrayOutputStream outPDF = decompteSante.getDecomptes();

    //Prepare response
    response.setHeader("Content-Disposition", "attachment; filename=" + 
fileName );
    response.setContentLength(outPDF.size());
               
    //Send content to Browser
    response.getOutputStream().write(outPDF.toByteArray());
    // the file is blank

    // create a dump file
   try {
        outFile.write(outPDF.toByteArray());
        // the dump file is OK
    } finally {
                outFile.close();
    }
    response.getOutputStream().flush();

I send you the attached blank file  :

Best regards,

Xavier

Jeremias Maerki a écrit :
> Write the byte array with the PDF to a file for debugging and check if
> it is still blank when opened outside the browser. If it is not, at
> least you will know that it's a browser problem. If it is blank, please
> post the PDF so we can take a look what could be wrong.
>
> Make sure the URL used to generate the PDF ends with ".pdf" as described
> here:
> http://xmlgraphics.apache.org/fop/0.93/servlets.html#ie
>
> And don't forget to go through all the replies of the thread Chris
> pointed you to. I'm pretty sure that you haven't hit a new problem.
>
> On 12.01.2007 17:23:23 Xavier Ottolini wrote:
>   
>> Hi,
>>
>> My problem is really serious.
>> I checked that the XML source normaly buid OK. The XSL has not changed.
>>
>> If I print
>> out.size();
>> It returns  207658.
>>
>> I do not know why is my page white.
>>
>> Has anybody already meet such problem ?
>>
>> Best Regards
>>
>> Xavier
>>
>> Xavier Ottolini a écrit :
>>     
>>> Hi,
>>>
>>> After deploying my application with FOP I have got a curious problem. 
>>> A PDF is generated but without any text. The file is completely white. 
>>> There is no text inside. No error is displayed.
>>>
>>> The terminal shows ordinary messages. With the system prompt, I saw 
>>> that the request returns normal results.
>>>
>>> Has anybody any idea ?
>>>
>>> Best regards
>>>
>>> Xavier
>>>
>>>       
>> -- 
>> Pour préservez l’environnement n’imprimez cet e-mail qu’en cas de nécessité.
>>
>> Xavier Ottolini
>> Développeur multimédia
>>
>> Adelis
>> 37 rue d'Engwiller
>> 67350 La Walck
>> France
>> Téléphone : +33 (0) 3 69 20 29 02
>> Télécopie : +33 (0) 3 88 72 29 19
>> http://www.adelis.com
>>     
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>   

-- 
Pour préservez l’environnement n’imprimez cet e-mail qu’en cas de nécessité.

Xavier Ottolini
Développeur multimédia

Adelis
37 rue d'Engwiller
67350 La Walck
France
Téléphone : +33 (0) 3 69 20 29 02
Télécopie : +33 (0) 3 88 72 29 19
http://www.adelis.com



Re: Blank PDF file

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Write the byte array with the PDF to a file for debugging and check if
it is still blank when opened outside the browser. If it is not, at
least you will know that it's a browser problem. If it is blank, please
post the PDF so we can take a look what could be wrong.

Make sure the URL used to generate the PDF ends with ".pdf" as described
here:
http://xmlgraphics.apache.org/fop/0.93/servlets.html#ie

And don't forget to go through all the replies of the thread Chris
pointed you to. I'm pretty sure that you haven't hit a new problem.

On 12.01.2007 17:23:23 Xavier Ottolini wrote:
> Hi,
> 
> My problem is really serious.
> I checked that the XML source normaly buid OK. The XSL has not changed.
> 
> If I print
> out.size();
> It returns  207658.
> 
> I do not know why is my page white.
> 
> Has anybody already meet such problem ?
> 
> Best Regards
> 
> Xavier
> 
> Xavier Ottolini a écrit :
> > Hi,
> >
> > After deploying my application with FOP I have got a curious problem. 
> > A PDF is generated but without any text. The file is completely white. 
> > There is no text inside. No error is displayed.
> >
> > The terminal shows ordinary messages. With the system prompt, I saw 
> > that the request returns normal results.
> >
> > Has anybody any idea ?
> >
> > Best regards
> >
> > Xavier
> >
> 
> -- 
> Pour préservez l’environnement n’imprimez cet e-mail qu’en cas de nécessité.
> 
> Xavier Ottolini
> Développeur multimédia
> 
> Adelis
> 37 rue d'Engwiller
> 67350 La Walck
> France
> Téléphone : +33 (0) 3 69 20 29 02
> Télécopie : +33 (0) 3 88 72 29 19
> http://www.adelis.com


Jeremias Maerki


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Blank PDF file

Posted by Xavier Ottolini <xa...@adelis.com>.
Hi,

My problem is really serious.
I checked that the XML source normaly buid OK. The XSL has not changed.

If I print
out.size();
It returns  207658.

I do not know why is my page white.

Has anybody already meet such problem ?

Best Regards

Xavier

Xavier Ottolini a écrit :
> Hi,
>
> After deploying my application with FOP I have got a curious problem. 
> A PDF is generated but without any text. The file is completely white. 
> There is no text inside. No error is displayed.
>
> The terminal shows ordinary messages. With the system prompt, I saw 
> that the request returns normal results.
>
> Has anybody any idea ?
>
> Best regards
>
> Xavier
>

-- 
Pour préservez l’environnement n’imprimez cet e-mail qu’en cas de nécessité.

Xavier Ottolini
Développeur multimédia

Adelis
37 rue d'Engwiller
67350 La Walck
France
Téléphone : +33 (0) 3 69 20 29 02
Télécopie : +33 (0) 3 88 72 29 19
http://www.adelis.com



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org