What accuracy-related changes we introduced in Docotic.Pdf 3.1
This document describes accuracy-related changes we made in Docotic.Pdf 3.1 API
While developing Docotic.Pdf 3.1 we discovered that single precision floating numbers are not always can represent data found in existing PDFs. And we also found out that our library may produce different results when run in different environments (i.e. the same code may produce different results when run in 32-bit and 64-bit applications).
We decided that it's time to introduce changes to API of the library. And we did just that. Now library doesn't lose any floating-point data found in existing PDFs and produce the same results in any environment.
Most of the changes are transparent for users of the library. For example, many of library methods are now accept double values instead of float ones. And we also introduced PdfPoint, PdfRectangle and PdfSize structures along with overloads for existing methods to help users of the Docotic.Pdf to achieve more precise layout in their documents.
Unfortunately, we were forced to introduce small amount of changes that may require users of the library to adapt their code for new version of Docotic.Pdf. Below is the list of these changes. Please note that PdfPoint, PdfRectangle and PdfSize structures have ToPointF, ToSizeF and ToRectangleF methods and corresponding constructors that can be used to convert values between PdfPoint and PointF, PdfSize and SizeF, or PdfRectangle and RectangleF structures.
- PdfButton
- Value of FontSize property is now of double type.
- PdfCanvas (and child types)
- Value of CharacterSpacing property is now of double type.
- Value of CurrentPosition property is now of PdfPoint type.
- Value of FlatnessTolerance property is now of double type.
- Value of FontSize property is now of double type.
- GetTextHeight() method now returns values of double type.
- GetTextWidth(String) method now returns values of double type.
- MeasureText(String) method now returns values of PdfSize type.
- Value of BitMiracle.Docotic.Pdf.PdfCanvas.MiterLimit property is now of double type.
- Value of TextAngle property is now of double type.
- Value of TextHorizontalScaling property is now of double type.
- Value of TextPosition property is now of PdfPoint type.
- Value of TextRise property is now of double type.
- Value of WordSpacing property is now of double type.
- PdfComboBox
- Value of FontSize property is now of double type.
- PdfDashPattern
- GetPattern() method now returns arrays of values of double type.
- Value of Offset property is now of double type.
- PdfDocumentView
- Value of Height property is now of double type.
- Value of Left property is now of double type.
- Value of Top property is now of double type.
- Value of Width property is now of double type.
- Value of ZoomPercent property is now of double type.
- PdfPage
- Value of Height property is now of double type.
- Value of Width property is now of double type.
- PdfPen
- Value of Width property is now of double type.
- PdfTextBox
- Value of FontSize property is now of double type.
- PdfTextData
- Value of Position property is now of PdfPoint type.
- PdfTilingPattern
- Value of Height property is now of double type.
- Value of Width property is now of double type.
- Value of XStep property is now of double type.
- Value of YStep property is now of double type.
- PdfWatermark
- Value of Height property is now of double type.
- Value of Width property is now of double type.
- PdfWidget (and child types)
- Value of BoundingBox property is now of PdfRectangle type.
- Value of Height property is now of double type.
- Value of Left property is now of double type.
- Value of Top property is now of double type.
- Value of Width property is now of double type.