PDF is not rendering properly.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

PDF is not rendering properly.

Sumit Pandit-3
Hello Devs

        In Accounting -> Reports PDF is not rendering properly for numeric  
value. For ex - It printed it like - $116.85
        I have verified it for Income Statement and Trial Balance.

Thanks And Regards
Sumit Pandit
Reply | Threaded
Open this post in threaded view
|

Re: PDF is not rendering properly.

Jacopo Cappellato-4
This is caused by the encoder used for special characters not working  
properly with our FOP framework.
We can fix this by commenting out the following line in  
widget.properties:

screenfop.encoder=xml

but I am worried because we will then have issues with some special  
characters breaking the XML syntax of FO.

The encoder that we are using for FOP (with screenfop.encoder=xml ) is  
(see StringUtil class):

     public static class XmlEncoder implements SimpleEncoder {
         public String encode(String original) {
             return StringUtil.defaultWebEncoder.encodeForXML(original);
         }
     }

where defaultWebEncoder is an object with org.owasp.esapi.Encoder class

Should we use a different approach? Ideas?

Jacopo


On Aug 13, 2009, at 9:03 AM, Sumit Pandit wrote:

> Hello Devs
>
> In Accounting -> Reports PDF is not rendering properly for numeric  
> value. For ex - It printed it like - $116.85
> I have verified it for Income Statement and Trial Balance.
>
> Thanks And Regards
> Sumit Pandit

Reply | Threaded
Open this post in threaded view
|

Re: PDF is not rendering properly.

Scott Gray-2
Hi Jacopo,

I was a bit curious so I took a look, the problem was that the $ sign  
was being encoded twice, both by easpi and by freemarker so when fop  
came to decode it, it was going from &#36: to $

Regards
Scott

On 13/08/2009, at 10:07 PM, Jacopo Cappellato wrote:

> This is caused by the encoder used for special characters not  
> working properly with our FOP framework.
> We can fix this by commenting out the following line in  
> widget.properties:
>
> screenfop.encoder=xml
>
> but I am worried because we will then have issues with some special  
> characters breaking the XML syntax of FO.
>
> The encoder that we are using for FOP (with screenfop.encoder=xml )  
> is (see StringUtil class):
>
>    public static class XmlEncoder implements SimpleEncoder {
>        public String encode(String original) {
>            return StringUtil.defaultWebEncoder.encodeForXML(original);
>        }
>    }
>
> where defaultWebEncoder is an object with org.owasp.esapi.Encoder  
> class
>
> Should we use a different approach? Ideas?
>
> Jacopo
>
>
> On Aug 13, 2009, at 9:03 AM, Sumit Pandit wrote:
>
>> Hello Devs
>>
>> In Accounting -> Reports PDF is not rendering properly for numeric  
>> value. For ex - It printed it like - $116.85
>> I have verified it for Income Statement and Trial Balance.
>>
>> Thanks And Regards
>> Sumit Pandit
>


smime.p7s (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: PDF is not rendering properly.

Jacopo Cappellato-4
wow,

thank you Scott!

Jacopo

On Aug 13, 2009, at 1:39 PM, Scott Gray wrote:

> Hi Jacopo,
>
> I was a bit curious so I took a look, the problem was that the $  
> sign was being encoded twice, both by easpi and by freemarker so  
> when fop came to decode it, it was going from &#36: to $
>
> Regards
> Scott
>
> On 13/08/2009, at 10:07 PM, Jacopo Cappellato wrote:
>
>> This is caused by the encoder used for special characters not  
>> working properly with our FOP framework.
>> We can fix this by commenting out the following line in  
>> widget.properties:
>>
>> screenfop.encoder=xml
>>
>> but I am worried because we will then have issues with some special  
>> characters breaking the XML syntax of FO.
>>
>> The encoder that we are using for FOP (with screenfop.encoder=xml )  
>> is (see StringUtil class):
>>
>>   public static class XmlEncoder implements SimpleEncoder {
>>       public String encode(String original) {
>>           return StringUtil.defaultWebEncoder.encodeForXML(original);
>>       }
>>   }
>>
>> where defaultWebEncoder is an object with org.owasp.esapi.Encoder  
>> class
>>
>> Should we use a different approach? Ideas?
>>
>> Jacopo
>>
>>
>> On Aug 13, 2009, at 9:03 AM, Sumit Pandit wrote:
>>
>>> Hello Devs
>>>
>>> In Accounting -> Reports PDF is not rendering properly for  
>>> numeric value. For ex - It printed it like - $116.85
>>> I have verified it for Income Statement and Trial Balance.
>>>
>>> Thanks And Regards
>>> Sumit Pandit
>>
>