Example #1
0
 public void PdfHelper_ThrowsExceptionOnEmptyImageBytes()
 {
     PDFContentData contentData = new PDFContentData
     {
         Buffer = null,
         Type   = "image",
     };
     PdfDocument doc = PdfHelper.ConcatenatePDFs(outputDocument, contentData);
 }
Example #2
0
        public void PdfHelper_CanConcatenatePDFFromBytes()
        {
            PDFContentData contentData = new PDFContentData {
                Buffer = testPdfByteArray,
                Type   = "pdf",
            };
            PdfDocument doc = PdfHelper.ConcatenatePDFs(outputDocument, contentData);

            Assert.IsNotNull(doc);
        }
Example #3
0
 public void PdfHelper_ThrowsExceptionOnNonexistantFilePath()
 {
     PDFContentData contentData = new PDFContentData
     {
         FilePaths = new List <string> {
             @"C:\this-is-a-fake-file-and-i-really-hope-nobody-really-has-one-of-these.pdf"
         }
     };
     PdfDocument doc = PdfHelper.ConcatenatePDFs(outputDocument, contentData);
 }
Example #4
0
 public void PdfHelper_ThrowsExceptionOnEmptyFilePath()
 {
     PDFContentData contentData = new PDFContentData
     {
         FilePaths = new List <string> {
             ""
         }
     };
     PdfDocument doc = PdfHelper.ConcatenatePDFs(outputDocument, contentData);
 }
Example #5
0
        public void PdfHelper_CanConcatenateHTMLFromString()
        {
            PDFContentData contentData = new PDFContentData
            {
                HtmlString = testHtmlString,
                Type       = "html",
            };
            PdfDocument doc = PdfHelper.ConcatenatePDFs(outputDocument, contentData);

            Assert.IsNotNull(doc);
        }
Example #6
0
        public void PdfHelper_GracefullyHandlesEmptyHTMLString()
        {
            PDFContentData contentData = new PDFContentData
            {
                HtmlString = "",
                Type       = "html",
            };
            PdfDocument doc = PdfHelper.ConcatenatePDFs(outputDocument, contentData);

            Assert.IsNotNull(doc);
        }
Example #7
0
        public void PdfHelper_CanConcatenateImageFromFile()
        {
            PDFContentData contentData = new PDFContentData
            {
                FilePaths = new List <string> {
                    testImagePath
                }
            };
            PdfDocument doc = PdfHelper.ConcatenatePDFs(outputDocument, contentData);

            Assert.IsNotNull(doc);
        }
Example #8
0
        public void PdfHelper_GracefullyHandlesUnsupportedFileType()
        {
            PDFContentData contentData = new PDFContentData
            {
                FilePaths = new List <string> {
                    "fake-file.xls"
                }
            };
            PdfDocument doc = PdfHelper.ConcatenatePDFs(outputDocument, contentData);

            Assert.IsNotNull(doc);
        }