diff --git a/src/UglyToad.PdfPig/Content/Page.cs b/src/UglyToad.PdfPig/Content/Page.cs index bb08f029..c0458446 100644 --- a/src/UglyToad.PdfPig/Content/Page.cs +++ b/src/UglyToad.PdfPig/Content/Page.cs @@ -154,6 +154,15 @@ { return annotationProvider.GetAnnotations(); } + + /// + /// Gets the calculated letter size in points. + /// This is considered experimental because the calculated value is incorrect for some documents at present. + /// + public decimal GetPointSize(Letter letter) + { + return letter.PointSize; + } } } } \ No newline at end of file diff --git a/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs b/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs index 9839c316..915f8130 100644 --- a/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs +++ b/src/UglyToad.PdfPig/Graphics/ContentStreamProcessor.cs @@ -126,7 +126,7 @@ // TODO: this does not seem correct, produces the correct result for now but we need to revisit. // see: https://stackoverflow.com/questions/48010235/pdf-specification-get-font-size-in-points - var pointSize = decimal.Round(fontSize * transformationMatrix.A, 2); + var pointSize = decimal.Round(rotation.Rotate(transformationMatrix).Multiply(TextMatrices.TextMatrix).Multiply(fontSize).A, 2); while (bytes.MoveNext()) {