From e2715ed3a5671a5e4892628d6e860f27a349c9e5 Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Tue, 30 Apr 2024 19:35:24 -0700 Subject: [PATCH] Remove obsolete serialization support on .NET --- src/UglyToad.PdfPig.Fonts/CorruptCompressedDataException.cs | 6 ++++++ .../Exceptions/PdfDocumentEncryptedException.cs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/UglyToad.PdfPig.Fonts/CorruptCompressedDataException.cs b/src/UglyToad.PdfPig.Fonts/CorruptCompressedDataException.cs index 9cb4b3948..5c8a635a7 100644 --- a/src/UglyToad.PdfPig.Fonts/CorruptCompressedDataException.cs +++ b/src/UglyToad.PdfPig.Fonts/CorruptCompressedDataException.cs @@ -1,12 +1,16 @@ namespace UglyToad.PdfPig.Fonts { using System; +#if !NET using System.Runtime.Serialization; +#endif /// /// Thrown when a PDF contains an invalid compressed data stream. /// +#if !NET [Serializable] +#endif public class CorruptCompressedDataException : Exception { /// @@ -24,11 +28,13 @@ public CorruptCompressedDataException(string message, Exception inner) : base(me { } +#if !NET /// protected CorruptCompressedDataException( SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } } \ No newline at end of file diff --git a/src/UglyToad.PdfPig/Exceptions/PdfDocumentEncryptedException.cs b/src/UglyToad.PdfPig/Exceptions/PdfDocumentEncryptedException.cs index 22e79eb64..e0caf4e36 100644 --- a/src/UglyToad.PdfPig/Exceptions/PdfDocumentEncryptedException.cs +++ b/src/UglyToad.PdfPig/Exceptions/PdfDocumentEncryptedException.cs @@ -1,14 +1,18 @@ namespace UglyToad.PdfPig.Exceptions { using System; +#if !NET using System.Runtime.Serialization; +#endif using Encryption; /// /// /// The document is encrypted and cannot be decrypted. /// +#if !NET [Serializable] +#endif public class PdfDocumentEncryptedException : Exception { internal EncryptionDictionary? Dictionary { get; } @@ -38,11 +42,13 @@ internal PdfDocumentEncryptedException(string message, EncryptionDictionary dict Dictionary = dictionary; } +#if !NET /// protected PdfDocumentEncryptedException( SerializationInfo info, StreamingContext context) : base(info, context) { } +#endif } }