Files
PdfPig/src/UglyToad.PdfPig.Tests/Integration/OldGutnishTests.cs
Eliot Jones 997979cc92 #11 early access to the raw xobjects for images.
temporary 'safe' untested implementation of seac for type 1 charstrings.
make structure public
bump version of package and project to 0.0.3 (it had accidentally increased to 0.0.5)
2018-11-26 19:46:41 +00:00

49 lines
1.3 KiB
C#

namespace UglyToad.PdfPig.Tests.Integration
{
using System.Linq;
using Xunit;
public class OldGutnishTests
{
private static string GetFilename()
{
return IntegrationHelpers.GetDocumentPath("Old Gutnish Internet Explorer.pdf");
}
[Fact]
public void HasCorrectNumberOfPages()
{
using (var document = PdfDocument.Open(GetFilename()))
{
Assert.Equal(3, document.NumberOfPages);
}
}
[Fact]
public void HasCorrectContentAfterReadingPreviousPage()
{
using (var document = PdfDocument.Open(GetFilename()))
{
var page = document.GetPage(1);
Assert.Contains("Þissi þieluar hafþi ann sun sum hit hafþi. En hafþa cuna hit huita stierna", page.Text);
page = document.GetPage(2);
Assert.Contains("Greipur sem annar hét; og Gunnfjón sá þriðji", page.Text);
}
}
[Fact]
public void GetsImageOnPageOne()
{
using (var document = PdfDocument.Open(GetFilename()))
{
var page = document.GetPage(1);
var images = page.ExperimentalAccess.GetRawImages().ToList();
Assert.Single(images);
}
}
}
}