Add #if !NET8 back in to pass the .net core tests

This commit is contained in:
Mike Phares 2025-05-28 13:42:05 -07:00
parent 65a433e9ab
commit 54799f54ec

View File

@ -1,6 +1,8 @@
#if !NET8
using iTextSharp.text;
using iTextSharp.text.html.simpleparser;
using iTextSharp.text.pdf;
#endif
using System.IO;
@ -31,6 +33,7 @@ public class StandardPdfRenderer {
public static MemoryStream GetPortableDocumentFormat(string pageTitle, string htmlText) {
MemoryStream result = new();
#if !NET8
using (Document pdfDocument = new Document(PageSize.A4, HorizontalMargin, HorizontalMargin, VerticalMargin, VerticalMargin)) {
using (PdfWriter pdfWriter = PdfWriter.GetInstance(pdfDocument, result)) {
pdfWriter.CloseStream = false;
@ -43,6 +46,7 @@ public class StandardPdfRenderer {
}
}
}
#endif
return result;
}