We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a sample pdf file helloworld.pdf, which have one single line "Hello, good morning!".
Use the following code to draw bounding box of each letter.
using (var document = PdfDocument.Open("helloworld.pdf")) { var builder = new PdfDocumentBuilder { }; for (var pageNumber = 1; pageNumber <= document.NumberOfPages; pageNumber++) { var pageBuilder = builder.AddPage(document, pageNumber); pageBuilder.SetStrokeColor(128, 128, 128); var page = document.GetPage(pageNumber); var letters = page.Letters; foreach (var letter in letters) { if (letter != null) { pageBuilder.DrawLine(letter.GlyphRectangle.BottomLeft, letter.GlyphRectangle.BottomRight, 0.3); pageBuilder.DrawLine(letter.GlyphRectangle.BottomRight, letter.GlyphRectangle.TopRight, 0.3); pageBuilder.DrawLine(letter.GlyphRectangle.TopRight, letter.GlyphRectangle.TopLeft, 0.3); pageBuilder.DrawLine(letter.GlyphRectangle.TopLeft, letter.GlyphRectangle.BottomLeft, 0.3); } } } byte[] fileBytes = builder.Build(); File.WriteAllBytes("helloworld-letterbox.pdf", fileBytes); }
Result is:
Note: the bounding box do not include the descent part of letter g.
g
The text was updated successfully, but these errors were encountered:
This definitely looks like a bug, not sure when I'd have time to look so unfortunately it'll probably be stuck like this for a good-while.
Sorry, something went wrong.
No branches or pull requests
I have a sample pdf file helloworld.pdf, which have one single line "Hello, good morning!".
Use the following code to draw bounding box of each letter.
Result is:
Note: the bounding box do not include the descent part of letter
g
.The text was updated successfully, but these errors were encountered: