Пример #1
0
        public void ShouldConvertToLandscapePdf()
        {
            var converter = new HtmlToPdfConverter();
            var settings  = new HtmlToPdfSettings()
            {
                CompressionLevel = PdfCompressionLevel.NoCompression,
                Margin           = "25 25 25 25",
                PageOrientation  = PdfPageOrientation.Landscape,
                PageSize         = PdfPageSize.A3,
                Standart         = PdfStandart.PdfA
            };

            var pdfFile = converter.ConvertToPdfAsArray(settings, SpecifiedHtmlString);

            var pdfReader    = new PdfReader(pdfFile);
            var firstPdfPage = pdfReader.GetPageSize(1);

            firstPdfPage.Width.ShouldBeGreaterThanOrEqualTo(firstPdfPage.Height);
        }
Пример #2
0
        public void ShouldConvertToB4Pdf()
        {
            var converter = new HtmlToPdfConverter();
            var settings  = new HtmlToPdfSettings()
            {
                CompressionLevel = PdfCompressionLevel.NoCompression,
                Margin           = "25 25 25 25",
                PageOrientation  = PdfPageOrientation.Portrait,
                PageSize         = PdfPageSize.B4,
                Standart         = PdfStandart.PdfA
            };

            var pdfFile = converter.ConvertToPdfAsArray(settings, SpecifiedHtmlString);

            var pdfReader    = new PdfReader(pdfFile);
            var firstPdfPage = pdfReader.GetPageSize(1);

            firstPdfPage.Width.ShouldBe(709);
            firstPdfPage.Height.ShouldBe(1002);
        }