private int GetNumberOfCoverPages(CoverPage coverPageSettings) { if (!coverPageSettings.Enabled) return 0; return _pdfProcessor.GetNumberOfPages(coverPageSettings.File); }
public int GetNumberOfPages(string file) { if (IsPdfFile(file)) { return(_pdfProcessor.GetNumberOfPages(file)); } return(GetNumberOfPsPages(file)); }
public void GetNumberOfPages_InputIsPdfFile_ReturnsNumberOfPagesFromPdfProcessor() { var expectedNumberOfPages = 12345; var filename = "pdffile.pdf"; _pdfProcessor.GetNumberOfPages(filename).Returns(expectedNumberOfPages); Assert.AreEqual(expectedNumberOfPages, _directConversionHelper.GetNumberOfPages(filename)); }
private int GetNumberOfAttachmentPages(AttachmentPage attachmentPage) { var count = 0; if (!attachmentPage.Enabled) { return(count); } try { count += _processor.GetNumberOfPages(attachmentPage.File); } catch { _logger.Warn("Problem detecting page number of attachment page file \"" + attachmentPage.File + "\""); count = 1; } return(count); }
protected override int GetNumberOfPages(string fileName) { return(_pdfProcessor.GetNumberOfPages(fileName)); }