private void ExecuteForDocument(Input type, string filePath, string password, int dimOne, int dimTwo, int pageIndex, Action <IPageReader> action) { using (var docReader = _fixture.GetDocReader(type, filePath, password, dimOne, dimTwo)) using (var pageReader = docReader.GetPageReader(pageIndex)) { action(pageReader); } }
private static int GetNonZeroByteCount(Input type, string filePath, LibFixture fixture) { using (var reader = fixture.GetDocReader(type, filePath, null, 1000, 1000)) { using (var pageReader = reader.GetPageReader(0)) { return(pageReader.GetImage().Count(x => x != 0)); } } }
public void GetDocReader_WhenCalledWithInvalidFileData_ShouldThrow(Input type) { Assert.Throws <DocnetException>(() => _fixture.GetDocReader(type, "Docs/protected_0.pdf", null, 10, 10)); }