コード例 #1
0
ファイル: BackgroundAdder.cs プロジェクト: lorddev/PDFCreator
        private int GetNumberOfCoverPages(CoverPage coverPageSettings)
        {
            if (!coverPageSettings.Enabled)
                return 0;

            return _pdfProcessor.GetNumberOfPages(coverPageSettings.File);
        }
コード例 #2
0
        public int GetNumberOfPages(string file)
        {
            if (IsPdfFile(file))
            {
                return(_pdfProcessor.GetNumberOfPages(file));
            }

            return(GetNumberOfPsPages(file));
        }
コード例 #3
0
        public void GetNumberOfPages_InputIsPdfFile_ReturnsNumberOfPagesFromPdfProcessor()
        {
            var expectedNumberOfPages = 12345;
            var filename = "pdffile.pdf";

            _pdfProcessor.GetNumberOfPages(filename).Returns(expectedNumberOfPages);

            Assert.AreEqual(expectedNumberOfPages, _directConversionHelper.GetNumberOfPages(filename));
        }
コード例 #4
0
        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);
        }
コード例 #5
0
 protected override int GetNumberOfPages(string fileName)
 {
     return(_pdfProcessor.GetNumberOfPages(fileName));
 }