diff --git a/src/UglyToad.PdfPig/Content/Pages.cs b/src/UglyToad.PdfPig/Content/Pages.cs index 85b0efaa..1bb12fec 100644 --- a/src/UglyToad.PdfPig/Content/Pages.cs +++ b/src/UglyToad.PdfPig/Content/Pages.cs @@ -117,7 +117,11 @@ pageFactoryCache.Add(type, pageFactory); } +#if NET6_0_OR_GREATER + internal void AddPageFactory() where TPageFactory : IPageFactory +#else internal void AddPageFactory() where TPageFactory : IPageFactory +#endif { var constructor = typeof(TPageFactory).GetConstructor(new[] { diff --git a/src/UglyToad.PdfPig/PdfDocument.cs b/src/UglyToad.PdfPig/PdfDocument.cs index 27cc86b0..65826986 100644 --- a/src/UglyToad.PdfPig/PdfDocument.cs +++ b/src/UglyToad.PdfPig/PdfDocument.cs @@ -148,7 +148,11 @@ /// /// /// +#if NET6_0_OR_GREATER + public void AddPageFactory() where TPageFactory : IPageFactory +#else public void AddPageFactory() where TPageFactory : IPageFactory +#endif { pages.AddPageFactory(); }