I'd like to get bounding box of pdf objects (text and vectorial) but i get strange results
For i As Integer = 0 To renderInfo.SegmentData.Count - 2 Step 2
Dim x As Single = renderInfo.SegmentData(i)
Dim y As Single = renderInfo.SegmentData(i + 1)
Dim a As parser.Vector = New parser.Vector(x, y, 1).Cross(renderInfo.Ctm)
x = a(parser.Vector.I1)
y = a(parser.Vector.I2)
lastRect = New System.util.RectangleJ(x, y, 0, 0)
If Not IsNothing(lastRect) Then
If lastRect.X < minX Then
minX = lastRect.X
End If
If lastRect.X > maxX Then
maxX = lastRect.X
End If
If lastRect.Y < minY Then
minY = lastRect.Y
End If
If lastRect.Y > maxY Then
maxY = lastRect.Y
End If
End If
Next
This is the core of my ModifyPath implementation, it works with some PDFs but it doesn't work with few ones (like this). I'd like to get the same values as GhostScript BoundingBox data : 67 376 561 746
Any ideas?