From ef28bbaaf1bd5b56e991b11317052d660a09b8a8 Mon Sep 17 00:00:00 2001 From: TekH Date: Fri, 24 Oct 2025 13:50:24 +0200 Subject: [PATCH] refactor(pdf-burner): replace annotation type constants with AnnotationType class - Removed individual annotation type constants (ANNOTATION_TYPE_IMAGE, ANNOTATION_TYPE_INK, ANNOTATION_TYPE_WIDGET) - Introduced new Friend Class `AnnotationType` to encapsulate annotation type string constants - Updated all references to use `AnnotationType.Image`, `AnnotationType.Ink`, and `AnnotationType.Widget` - Improved code organization by grouping related constants and removing redundant declarations --- .../Jobs/FinalizeDocument/PDFBurner.vb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb index a969da8b..347bb888 100644 --- a/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb +++ b/EnvelopeGenerator.CommonServices/Jobs/FinalizeDocument/PDFBurner.vb @@ -20,9 +20,6 @@ Namespace Jobs.FinalizeDocument Private ReadOnly Manager As AnnotationManager Private ReadOnly LicenseManager As LicenseManager - Private Const ANNOTATION_TYPE_IMAGE = "pspdfkit/image" - Private Const ANNOTATION_TYPE_INK = "pspdfkit/ink" - Private Const ANNOTATION_TYPE_WIDGET = "pspdfkit/widget" Private Property _pdfBurnerParams As PDFBurnerParams Public Sub New(pLogConfig As LogConfig, pGDPictureLicenseKey As String, pdfBurnerParams As PDFBurnerParams) @@ -106,16 +103,13 @@ Namespace Jobs.FinalizeDocument Logger.Debug("Adding AnnotationID: " + oAnnotation.id) Select Case oAnnotation.type - Case ANNOTATION_TYPE_IMAGE - + Case AnnotationType.Image AddImageAnnotation(oAnnotation, oAnnotationData.attachments) Exit Select - - Case ANNOTATION_TYPE_INK + Case AnnotationType.Ink AddInkAnnotation(oAnnotation) Exit Select - - Case ANNOTATION_TYPE_WIDGET + Case AnnotationType.Widget 'Add form field values Dim formFieldValue = oAnnotationData.formFieldValues.FirstOrDefault(Function(fv) fv.name = oAnnotation.id) If formFieldValue IsNot Nothing AndAlso Not _pdfBurnerParams.IgnoredLabels.Contains(formFieldValue.value) Then @@ -196,6 +190,12 @@ Namespace Jobs.FinalizeDocument #End Region #Region "Model" + Friend Class AnnotationType + Public Const Image As String = "pspdfkit/image" + Public Const Ink As String = "pspdfkit/ink" + Public Const Widget As String = "pspdfkit/widget" + End Class + Friend Class AnnotationData Public Property annotations As List(Of Annotation)