Updated Home (markdown)

davebrokit
2024-05-27 12:38:03 +01:00
parent 5fce77cff0
commit 657ce7174f

25
Home.md

@@ -65,6 +65,31 @@ byte[] b = builder.Build();
The resulting bytes are a valid PDF document and can be saved to the file system, served from a web server, etc. The resulting bytes are a valid PDF document and can be saved to the file system, served from a web server, etc.
You can use document builder to visualise what pdf pig has done for document reading.
```cs
using UglyToad.PdfPig;
using UglyToad.PdfPig.Writer;
using (var document = PdfDocument.Open(pdf))
{
var builder = new PdfDocumentBuilder{};
var pageBuilder = builder.AddPage(document, pageNumber);
pageBuilder.SetStrokeColor(255,0,0);
var page = document.GetPage(pageNumber);
foreach(var word in page.GetWords())
{
var box = word.BoundingBox;
pageBuilder.DrawRectangle(box.BottomLeft, (decimal)box.Width, (decimal)box.Height);
}
builder.ToImage().Display();
}
```
View this gist that goes through some basic beginner examples: https://gist.github.com/cordasfilip/c6d2510b358323dc2f71c843460cbcdf
## Contents ## ## Contents ##
More details on the API can be found here. More details on the API can be found here.