Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions MuPDF.NET.Test/WidgetTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,20 @@ public void Checkbox()
//Assert.Pass();
}
*/

[Test]
public void ShouldNotThrowOnGetWidgets()
{
Document doc = new Document("../../../resources/test_widget_parse.pdf");

var currentPage = 0;
while (currentPage < doc.PageCount)
{
var page = doc[currentPage];
var widgets = page.GetWidgets().ToList();
Assert.That(widgets.Count, Is.GreaterThanOrEqualTo(0));
currentPage++;
}
}
}
}
Binary file added MuPDF.NET.Test/resources/test_widget_parse.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion MuPDF.NET/Widget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public void ParseDa()
string font = "Helv";
float fontSize = 0;
float[] col = { 0, 0, 0 };
string[] dat = TextDa.Split(' '); // split on any whitespace
string[] dat = TextDa.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries); // split on any whitespace and remove empty entries
for (int i = 0; i < dat.Length; i++)
{
string item = dat[i];
Expand Down