Menu

#1 Incorrectly localized PDF file

open
nobody
None
5
2002-08-08
2002-08-08
No

Don't use ToString() when writing floating point values to
the pdf document. ToString() is culture-sensitive. This
means when using PDFLib on for example a german
system a number like "0.5" will be written as "0,5".

Discussion

  • Nobody/Anonymous

    Logged In: NO

    This can easily be fixed. Change
    PDFLib.Objects.DataTypes.ToString() to:

    public override string ToString()
    {
    if (_obj is float)
    return ((float)_obj).ToString(new CultureInfo( "en-US"
    )) + " " ;
    else
    return _obj.ToString() + " " ;
    }

     
  • Grischa Brockhaus

    Logged In: YES
    user_id=142354

    This can easily be fixed. Change
    PDFLib.Objects.DataTypes.ToString() to:

    public override string ToString()
    {
    if (_obj is float)
    return ((float)_obj).ToString(new CultureInfo( "en-US"
    )) + " " ;
    else
    return _obj.ToString() + " " ;
    }

     

Log in to post a comment.