# GroupDocs — Complete Documentation > Central documentation index for GroupDocs on-premise document processing SDKs. Explore developer documentation and guides for all product families. --- ## .NET Standard 2.0 API Limitations Path: /signature/net/net-standard-2-0-api-limitations/ ## Limitations of .NET Standard 2.0 compared to .NET API ### Limitations 1. Because of the lack of Windows fonts in target OS (Android, macOS, Linux, etc), fonts used in documents are substituted with available fonts, this might lead to inaccurate document layout when rendering the document to PNG, JPG, and PDF. 2. If GroupDocs.Signature for .NET Standard is intended to be used in a Linux environment, an additional NuGet package should be referenced to make it work correctly with graphics: [SkiaSharp.NativeAssets.Linux](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux) for Ubuntu (it also should work on most Debian-based Linux distributions) or [Goelze.SkiaSharp.NativeAssets.AlpineLinux](https://www.nuget.org/packages/Goelze.SkiaSharp.NativeAssets.AlpineLinux) for Alpine Linux. #### Recommendations When using GroupDocs.Signature in a non-Windows environment in order to improve rendering results we do recommend installing the following packages: 1. libgdiplus - is the Mono library that provides a GDI+-compatible API on non-Windows operating systems. 2. libc6-dev - package contains the symlinks, headers, and object files needed to compile and link programs which use the standard C library. 3. ttf-mscorefonts-installer - package with Microsoft compatible fonts. To install packages on Debian-based Linux distributions use [apt-get](https://wiki.debian.org/apt-get) utility: 1. sudo apt-get install libgdiplus 2. sudo apt-get install libc6-dev 3. sudo apt-get install ttf-mscorefonts-installer --- ## Load document from Amazon S3 Storage Path: /signature/java/load-document-from-amazon-s3-storage/ Following example demonstrates how to process with documents from Amazon S3 Storage. ```java public static void run() { String key = "sample.docx"; try { InputStream stream = downloadFile(key); Signature signature = new Signature(stream); QrCodeSignOptions options = new QrCodeSignOptions("JohnSmith"); options.setEncodeType(QrCodeTypes.QR); options.setLeft(100); options.setTop(100); // sign document to file signature.sign("signedSample.docx", options); System.out.print("\nSource document signed successfully.\n" ); }catch(Exception e){ throw new GroupDocsSignatureException(e.getMessage()); } } public static InputStream downloadFile(String key) { AWSCredentials credentials = new BasicAWSCredentials( "", "" ); AmazonS3 s3client = AmazonS3ClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(credentials)) .withRegion(Regions.US_EAST_2) .build(); String bucketName = "my-bucket"; S3Object s3object = s3client.getObject(bucketName, key); S3ObjectInputStream inputStream = s3object.getObjectContent(); return inputStream; } ``` ## More resources ### GitHub Examples  You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online App  Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online **[GroupDocs Signature App](https://products.groupdocs.app/signature)**. --- ## How to load document from Amazon S3 Storage Path: /signature/net/load-document-from-amazon-s3-storage/ Following example demonstrates how to process with documents from Amazon S3 Storage. ```csharp public static void Run() { string key = "sample.docx"; string outputFilePath = "SignedSample"; using (Stream stream = DownloadFile(key)) { using (Signature signature = new Signature(stream)) { QrCodeSignOptions options = new QrCodeSignOptions("JohnSmith") { EncodeType = QRCodeTypes.QR, Left = 100, Top = 100 }; // sign document to file signature.Sign(outputFilePath, options); } } Console.WriteLine("\nSource document signed successfully.\nFile saved at " + outputFilePath); } public static Stream DownloadFile(string key) { AmazonS3Client client = new AmazonS3Client(); string bucketName = "my-bucket"; GetObjectRequest request = new GetObjectRequest { Key = key, BucketName = bucketName }; using (GetObjectResponse response = client.GetObject(request)) { MemoryStream stream = new MemoryStream(); response.ResponseStream.CopyTo(stream); stream.Position = 0; return stream; } } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## eSign Document with Barcode Signature Path: /signature/python-net/esign-document-with-barcode-signature/ ## What is a Barcode? A **barcode** or **bar code** is a way of presenting data in a visual, machine-readable form. Generally speaking, barcode is an image of a rectangular form that consists of parallel black lines and white spaces of different widths. Barcodes are used in various areas where quick identification is necessary - as part of the purchase process in retail stores, in warehouses to track inventory, and on invoices to assist in accounting, among many other uses. ![Barcode](/signature/python-net/images/esign-document-with-barcode-signature.gif) Barcodes allow storing of product-related data like manufacturing and expiry dates, manufacturer name, country of origin, and product price. There are plenty of barcode types nowadays because different companies use different combinations of numbers and bars in their barcodes depending on their needs. From the document signature perspective, Barcode may contain different characters (letters, digits, or symbols) and may have various lengths and sizes depending on the type and settings to keep signature information, title, subject, or short encrypted data. ## How to eSign Document with Barcode Signature [**GroupDocs.Signature for Python via .NET**](https://products.groupdocs.com/signature/python-net) supports a wide range of Barcode types that can be used to create electronic signatures within the documents. Please refer to the [BarcodeTypes](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/barcodetypes/#fields) description to get the full list of supported barcodes. To specify different options for Barcode signature GroupDocs.Signature for Python via .NET provides [BarcodeSignOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesignoptions) class. The main fields are: * [encode_type](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesignoptions/encode_type) - specifies the Barcode type (AustralianPost, Codabar, EAN13, OPC, etc.); * [text](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/textsignoptions/text) - specifies the Barcode text. Here are the steps to eSign a document with the Barcode signature using GroupDocs.Signature for Python via .NET API: * Create a new instance of [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class and pass the source document path as a constructor parameter. * Instantiate the [BarcodeSignOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesignoptions) object according to your requirements and specify the Barcode type by setting the [encode_type](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesignoptions/encode_type) property with one of the predefined supported types. Set the [text](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/textsignoptions/text) property value. * Call the [Sign](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/sign/) method of the [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class instance and pass the [BarcodeSignOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesignoptions) to it. This example shows how to sign a PDF document with a Barcode signature using Python: {{< tabs "example-1" >}} {{< tab "Python" >}} ```python import groupdocs.signature as signature from groupdocs.signature.options import BarcodeSignOptions from groupdocs.signature.domain import BarcodeTypes import groupdocs.signature.domain as gsd import sys import os def run(): with signature.Signature("./sample.pdf") as sign: # Create barcode signature options options = BarcodeSignOptions() # Set barcode text options.text = "John Smith" # Set barcode type options.encode_type = BarcodeTypes.QR # Set barcode position options.left = 100 options.top = 100 # Set barcode size options.width = 100 options.height = 100 # Set barcode colors options.fore_color = gsd.Color.BLUE options.back_color = gsd.Color.WHITE options.border_color = gsd.Color.BLACK # Set barcode border options.border_visiblity = True options.border_dash_style = gsd.DashStyle.DASH options.border_weight = 2 # Sign document sign.sign("./SampleSigned.pdf", options) ``` {{< /tab >}} {{< tab "sample.pdf" >}} {{< tab-text >}} The following sample file is used in this example: [sample.pdf](/signature/python-net/_sample_files/developer-guide/basic-usage/electronic-signature-types/esign-document-with-barcode-signature/sample.pdf) {{< /tab-text >}} {{< /tab >}} {{< /tabs >}} ### Advanced Barcode Signature Options You can customize the barcode signature further with additional options: {{< tabs "example-2" >}} {{< tab "Python" >}} ```python import groupdocs.signature as signature from groupdocs.signature.options import BarcodeSignOptions from groupdocs.signature.domain import BarcodeTypes import groupdocs.signature.domain as gsd import sys import os def run(): with signature.Signature("./sample.pdf") as sign: # Create barcode signature options options = BarcodeSignOptions("JohnSmith") # Setup Barcode encoding type options.encode_type = BarcodeTypes.QR # Set signature position and size options.left = 100 options.top = 100 options.width = 200 options.height = 100 # Set advanced options options.fore_color = gsd.Color.BLUE options.back_color = gsd.Color.WHITE options.opacity = 0.8 options.rotation_angle = 45 # Set barcode alignment options.horizontal_alignment = gsd.HorizontalAlignment.CENTER options.vertical_alignment = gsd.VerticalAlignment.CENTER # Add border options.border_color = gsd.Color.BLACK options.border_dash_style = gsd.DashStyle.SOLID options.border_weight = 2 # Sign document sign.sign("./SampleSigned.pdf", options) ``` {{< /tab >}} {{< tab "sample.pdf" >}} {{< tab-text >}} The following sample file is used in this example: [sample.pdf](/signature/python-net/_sample_files/developer-guide/basic-usage/electronic-signature-types/esign-document-with-barcode-signature/sample.pdf) {{< /tab-text >}} {{< /tab >}} {{< /tabs >}} ### Different Barcode Types GroupDocs.Signature supports various barcode types. Here's an example showing how to use different barcode types: {{< tabs "example-3" >}} {{< tab "Python" >}} ```python import groupdocs.signature as signature from groupdocs.signature.options import BarcodeSignOptions from groupdocs.signature.domain import BarcodeTypes # Initialize signature with signature.Signature("sample.pdf") as sign: # Create barcode signature options options = BarcodeSignOptions("1234567890") # Setup different Barcode encoding types # For numeric data options.encode_type = BarcodeTypes.EAN_13 # For alphanumeric data # options.encode_type = BarcodeTypes.CODE_128 # For QR codes # options.encode_type = BarcodeTypes.QR # For 2D barcodes # options.encode_type = BarcodeTypes.DATA_MATRIX # Set signature position options.left = 100 options.top = 100 # Sign document sign.sign("SampleSigned.pdf", options) ``` {{< /tab >}} {{< tab "sample.pdf" >}} {{< tab-text >}} The following sample file is used in this example: [sample.pdf](/signature/python-net/_sample_files/developer-guide/basic-usage/electronic-signature-types/esign-document-with-barcode-signature/sample.pdf) {{< /tab-text >}} {{< /tab >}} {{< /tabs >}} ### Summary This guide demonstrates how to use [**GroupDocs.Signature for Python via .NET**](https://products.groupdocs.com/signature/python-net) to add barcode-based signatures to documents. It covers creating, configuring, and applying barcode signatures with support for various barcode types and customization options. For further exploration, refer to related guides on document information and advanced signing techniques. ## More Resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for Python via .NET examples](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Python-via-.NET) ### Free Online Apps Along with the full-featured Python library, we provide simple but powerful free online apps. To generate barcodes and/or sign your files with barcodes for free, you can use the [Barcode Generator](https://products.groupdocs.app/signature/generate/barcode) online app. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the other online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## eSign Image with Metadata signature Path: /signature/python-net/esign-image-with-metadata-signature/ ## Overview Metadata signature for Image document is an electronic signature based on image metadata standard. Most image formats support metadata specification or [EXIF](https://en.wikipedia.org/wiki/Exif). Image metadata is dictionary map with unique whole short identifier in range 0-65535, Some identifiers are reserved by [EXIF specification.](https://www.exiv2.org/tags.html) From signature perspective image metadata may content any hidden value of standard (int,char, string) or custom type (user defined class), be encrypted and decrypted back by known key over Search method. [**GroupDocs.Signature**](https://products.groupdocs.com/signature/python-net) provides [ImageMetadataSignature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/imagemetadatasignature) class to specify Metadata e-signature for image documents. Image document metadata contains pair with unique identifier Id and its Value. Image document metadata could keep big amount of data that provides ability to keep serialized custom objects with additional encryption in there. ### Here are the steps to add metadata signatures into Image with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class and pass source document path as a constructor parameter. * Instantiate the [MetadataSignOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/metadatasignoptions) object according to your requirements. * Instantiate one or several [ImageMetadataSignature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/imagemetadatasignature) objects and add them into [MetadataSignOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/metadatasignoptions) to metadata signatures collection ([Signatures](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/metadatasignoptions/signatures)) via [Add](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/metadatasignaturecollection/add) or [AddRange](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/metadatasignaturecollection/addrange) method. * Call [Sign](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/sign/) method of [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class instance and pass [MetadataSignOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/metadatasignoptions) to it. ## How to eSign Image with Metadata signature This example shows how to sign png image with metadata e-signatures {{< tabs "example-1" >}} {{< tab "Python" >}} ```python import groupdocs.signature as signature from groupdocs.signature.options import MetadataSignOptions from groupdocs.signature.domain import ImageMetadataSignature from datetime import datetime # Initialize signature with signature.Signature("sample.png") as sign: # Create metadata options options = MetadataSignOptions() # Specify different Metadata Signatures and add them to options signature collection imgs_metadata_id = 41996 # Create several Image Metadata signatures with different types options.add(ImageMetadataSignature(imgs_metadata_id, "Mr.Scherlock Holmes")) # String value imgs_metadata_id += 1 options.add(ImageMetadataSignature(imgs_metadata_id, datetime.now())) # Date Time value imgs_metadata_id += 1 options.add(ImageMetadataSignature(imgs_metadata_id, 123456)) # Integer value imgs_metadata_id += 1 options.add(ImageMetadataSignature(imgs_metadata_id, 123.456)) # Double value imgs_metadata_id += 1 options.add(ImageMetadataSignature(imgs_metadata_id, 123.456)) # Decimal value imgs_metadata_id += 1 options.add(ImageMetadataSignature(imgs_metadata_id, 123.456)) # Float value # Sign document sign.sign("SampleSigned.png", options) ``` {{< /tab >}} {{< tab "sample.png" >}} {{< tab-text >}} The following sample file is used in this example: [sample.png](/signature/python-net/_sample_files/developer-guide/basic-usage/electronic-signature-types/esign-document-with-metadata-signature/esign-image-with-metadata-signature/sample.png) {{< /tab-text >}} {{< /tab >}} {{< /tabs >}} ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for Python via .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Python-via-.NET) ### Free Online Apps Along with the full-featured Python library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## eSign document with Barcode signature Path: /signature/java/esign-document-with-barcode-signature/ ## What is a Barcode? A **barcode** or **bar code** is a way of presenting data in a visual, machine-readable form. Generally speaking, barcode is an image of rectangular form that consists of parallel black lines and white spaces of different widths. Barcodes are used in various areas where quick identification is necessary - as part of the purchase process in retail stores, in warehouses to track inventory, and on invoices to assist in accounting, among many other uses. ![](/signature/java/images/esign-document-with-barcode-signature.gif) Barcodes allow to store product related data like manufacturing and expiry dates, manufacturer name, country of the origin and product price. There are plenty of barcode types nowadays because different companies use different amount of number and bar combinations in their barcodes dependent on their needs. From document signature perspective Barcode may contain different characters (letters, digits or symbols) and have a various length and its size depending on the type and settings to keep signature information, title, subject or short encrypted data. ## eSign document with Barcode signature [GroupDocs.Signature](https://products.groupdocs.com/signature/java) for Java supports wide range or Barcode types that can be used to create electronic signature within the documents. Please refer to [BarcodeTypes](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.barcodes/BarcodeTypes) description to get the full list of supported barcodes. To specify different options for Barcode signature GroupDocs.Signature for Java provides [BarcodeSignOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/BarcodeSignOptions) class. The main fields are: * [getEncodeType](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/BarcodeSignOptions#getEncodeType()) - specifies Barcode type (AustralianPost, Codabar, EAN13, OPC, etc.); * [getText](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/TextSignOptions#getText()) - specifies Barcode text.  Here are the steps to eSign document with Barcode signature using GroupDocs.Signature for .NET API: * Create new instance of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class and pass source document path as a constructor parameter. * Instantiate the [BarcodeSignOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/BarcodeSignOptions) object according to your requirements and specify Barcode type by setting [setEncodeType](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/BarcodeSignOptions#setEncodeType()) from predefined supported types. Set [setText](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/TextSignOptions#setText(java.lang.String)) property value. * Call [sign](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#sign(java.io.OutputStream,%20com.groupdocs.signature.options.sign.SignOptions)) method of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class instance and pass [BarcodeSignOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/BarcodeSignOptions) to it. This example shows how to sign PDF document with Barcode signature. ```java Signature signature = new Signature("sample.pdf"); try { // setup options with text of signature BarcodeSignOptions signOptions = new BarcodeSignOptions("12345678"); // setup Barcode encoding type signOptions.setEncodeType(BarcodeTypes.Code128); // set signature position signOptions.setLeft(100); signOptions.setTop(100); // sign document signature.sign("SampleSigned.pdf", signOptions); }catch (Exception e){ throw new GroupDocsSignatureException(e.getMessage()); } ``` ## More resources ### Advanced Usage Topics To learn more about document eSign features, please refer to the [advanced usage section]({{< ref "signature/java/developer-guide/advanced-usage/_index.md" >}}). ### GitHub Examples  You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online App  Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online **[GroupDocs Signature App](https://products.groupdocs.app/signature)**. --- ## Update Barcode signatures in document Path: /signature/java/update-barcode-signatures-in-document/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/java) provides [BarcodeSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature) class to manipulate barcode signatures location, size and textual content.  Please be aware that [update](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options/Signature#update(java.lang.String,%20com.groupdocs.signature.domain.signatures.BaseSignature)) method modifies the same document that was passed to constructor of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class. Here are the steps to update Barcode signature in the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/java/com.groupdocs.signature/Signature) class and pass source document path as a constructor parameter; * Instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.search/BarcodeSearchOptions) object with desired properties; * Call [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) method to obtain list of [BarcodeSignatures](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature); * Select from list [BarcodeSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature) object(s) that should be updated; * Call [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) object [update](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options/Signature#update(java.lang.String,%20com.groupdocs.signature.domain.signatures.BaseSignature)) method and pass one or several signatures to it. This example shows how to update Barcode signature that was found using  [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) method. ```java Signature signature = new Signature("sampleSigned.pdf"); try { BarcodeSearchOptions options = new BarcodeSearchOptions(); List signatures = signature.search(BarcodeSignature.class,options); if (signatures.size() > 0) { BarcodeSignature barcodeSignature = signatures.get(0); barcodeSignature.setLeft(100); barcodeSignature.setTop(100); boolean result = signature.update("sampleSigned.pdf",barcodeSignature); if (result) { System.out.print("Signature with Barcode '"+barcodeSignature.getText()+"' and encode type '"+barcodeSignature.getEncodeType().getTypeName()+"' was updated in the document ['"+fileName+"']."); } else { System.out.print("Signature was not updated in the document! Signature with Barcode"+barcodeSignature.getText()+"' and encode type '"+barcodeSignature.getEncodeType().getTypeName()+"' was not found!"); } } } catch (Exception e) { throw new GroupDocsSignatureException(e.getMessage()); } ``` More resources ### Advanced Usage Topics To learn more about document eSign features, please refer to the [advanced usage section]({{< ref "signature/java/developer-guide/advanced-usage/_index.md" >}}). ### GitHub Examples  You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online App  Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online **[GroupDocs Signature App](https://products.groupdocs.app/signature)**. --- ## Update Barcode signatures in document Path: /signature/net/update-barcode-signatures-in-document/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) class to manipulate barcode signatures location, size and textual content. Please be aware that [Update](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/update/) method modifies the same document that was passed to constructor of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class. ### Here are the steps to update Barcode signature in the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter; * Instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) object with desired properties; * Call [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method to obtain list of [BarcodeSignatures](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature); * Select from list [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) object(s) that should be updated; * Call [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) object [Update](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/update/) method and pass one or several signatures to it. This example shows how to update Barcode signature that was found using  [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method. ```csharp // initialize Signature instance using (Signature signature = new Signature("sampleSigned.pdf")) { BarcodeSearchOptions options = new BarcodeSearchOptions(); List signatures = signature.Search(options); if (signatures.Count > 0) { BarcodeSignature barcodeSignature = signatures[0]; // change position barcodeSignature.Left = 100; barcodeSignature.Top = 100; bool result = signature.Update(barcodeSignature); if (result) { Console.WriteLine($"Signature with Barcode '{barcodeSignature.Text}' was updated!"); } else { Console.WriteLine($"Signature was not updated in the document!"); } } } ``` ### Advanced Usage Topics To learn more about document eSign features, please refer to the [advanced usage section]({{< ref "signature/net/developer-guide/advanced-usage/_index.md" >}}). ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To generate barcodes and/or sign your files with barcodes for free, you can use the [Barcode Generator](https://products.groupdocs.app/signature/generate/barcode) online app. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the other online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Update Barcode signatures in document Path: /signature/nodejs-java/update-barcode-signatures-in-document/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/nodejs-java) provides the [BarcodeSignature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature.domain/barcodesignature) class to manipulate barcode signatures' location, size, and textual content. Please be aware that the [Update](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/update/) method modifies the same document that was passed to the constructor of the [Signature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature) class. ### Here are the steps to update a Barcode signature in the document with GroupDocs.Signature: * Create a new instance of the [Signature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature) class and pass the source document path as a constructor parameter. * Instantiate the [BarcodeSearchOptions](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search) object with the desired properties. * Call the [Search](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search) method to obtain a list of [BarcodeSignatures](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature.domain/barcodesignature). * Select from the list the [BarcodeSignature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature.domain/barcodesignature) object(s) that should be updated. * Call the [Signature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature) object's [Update](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/update/) method and pass one or several signatures to it. This example shows how to update Barcode signature that was found using  [Search](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search) method. ```csharp // The path to the documents directory. const filePath = Constants.SAMPLE_PDF_SIGNED; const fileName = path.basename(filePath); // Copy source file since the update method works with the same document const outputFilePath = path.join(Constants.OutputPath, 'UpdateBarcode', fileName); const dir = path.dirname(outputFilePath); if (!fs.existsSync(dir)) { fs.mkdirSync(dir, { recursive: true }); } // Initialize Signature instance const signature = new signatureLib.Signature(filePath); // Initialize BarcodeSearchOptions const options = new signatureLib.BarcodeSearchOptions(); // Search for barcode signatures in the document const signatures = signature.search(signatureLib.BarcodeSignature.class, options).toArray(); if (signatures.length > 0) { const barcodeSignature = signatures[0]; barcodeSignature.setLeft(100); barcodeSignature.setTop(100); // Update the barcode signature in the document const result = signature.update(outputFilePath, barcodeSignature); if (result) { console.log(`\nSignature with Barcode '${barcodeSignature.getText()}' and encode type '${barcodeSignature.getEncodeType().getTypeName()}' was updated in the document ['${fileName}'].`); } else { console.log(`\nSignature was not updated in the document! Signature with Barcode '${barcodeSignature.getText()}' and encode type '${barcodeSignature.getEncodeType().getTypeName()}' was not found!`); } } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To generate barcodes and/or sign your files with barcodes for free, you can use the [Barcode Generator](https://products.groupdocs.app/signature/generate/barcode) online app. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the other online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Implement custom encryption with QR-Code signatures Path: /signature/net/implement-custom-encryption-with-qr-code-signatures/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides ability to embed into QR-code signature custom objects. This feature is implemented over object serialization to string and further encryption. There is ability to provide custom encryption. This procedure requires implementation of interface [IDataEncryption](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain.extensions/idataencryption) with two methods to encrypt and decrypt data. Here are the steps to embed into QR-code text with custom encryption with GroupDocs.Signature: * Define custom data encryption class that implements [IDataEncryption](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain.extensions/idataencryption) interface. By default GroupDocs.Signature has several encryption implementation you can use but allows user to customize it. * Implement class with properties and specify if needed class attributes (like custom serialization attribute, custom encryption attribute), specify attributes for properties like [FormatAttribute](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain.extensions/formatattribute) attribute to specify serialization name and display format, same as [SkipSerializationAttribute](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain.extensions/skipserializationattribute) to mark property of class as not serialize * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter. * Create one or several objects of [QrCodeSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/qrcodesignoptions) object with [Data](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/qrcodesignoptions/data) value * Instantiate the [QrCodeSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/qrcodesignoptions) object according to your requirements and custom object to [Data](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/qrcodesignoptions/data) property. * Call [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method of  [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature)  class instance and pass [QrCodeSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/qrcodesignoptions) to it. This example shows how to specify custom serialization class. This class could be implemented also as Attribute (optional) to specify as class attribute. ```csharp // Define class that implements IDataEncryption interface private class CustomXOREncryption : IDataEncryption { /// /// Gets or sets non empty key for encryption (at least one character) /// public int Key { get; set; } /// /// Encode method to encrypt string. /// /// Source string to encode. /// Returns enccrypted string public string Encode(string source) { return Process(source); } /// /// Decode method to obtain decrypted string. /// /// Source string to decode. /// Returns decrypted string public string Decode(string source) { return Process(source); } /// /// Using XOR operation get encoded / decoded string /// /// /// private string Process(string source) { StringBuilder src = new StringBuilder(source); StringBuilder dst = new StringBuilder(src.Length); char chTmp; for (int index = 0; index < src.Length; ++index) { chTmp = src[index]; chTmp = (char)(chTmp ^ this.Key); dst.Append(chTmp); } return dst.ToString(); } } ``` ## Definition of class This example shows how to define custom class with serialization and encryption properties and setup Format attributes for properties. ```csharp public class DocumentSignatureData { [Format("SignID")] public string ID { get; set; } [Format("SAuth")] public string Author { get; set; } [Format("SDate", "yyyy-MM-dd")] public DateTime Signed { get; set; } [Format("SDFact", "N2")] public decimal DataFactor { get; set; } [SkipSerialization] public string Comments { get; set; } } ``` ## Sign documents with custom encrypted objects and values into QR-code signatures This example shows how to add custom object into metadata signature to Image document. ```csharp using (Signature signature = new Signature("sample.pdf")) { // create data encryption IDataEncryption encryption = new CustomXOREncryption(); // create custom object DocumentSignatureData documentSignatureData = new DocumentSignatureData() { ID = Guid.NewGuid().ToString(), Author = Environment.UserName, Signed = DateTime.Now, DataFactor = 11.22M }; // setup QR-Code options QrCodeSignOptions options = new QrCodeSignOptions() { // set custom object to serialize to QR Code Data = documentSignatureData, // QR-code type EncodeType = QrCodeTypes.QR, // specify serialization encryption DataEncryption = encryption, // locate and aligh signature Height = 100, Width = 100, VerticalAlignment = VerticalAlignment.Bottom, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Padding() { Right = 10, Bottom = 10 } }; // sign document to file signature.Sign("QRCodeCustomEncryption.pdf", options); } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To generate QR codes and/or sign your files with QR codes for free, you can use the [QR Code Generator](https://products.groupdocs.app/signature/generate/qrcode) online app. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the other online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## eSign Image with Metadata signature Path: /signature/java/esign-image-with-metadata-signature/ Metadata signature for Image document is an electronic signature based on image metadata standard. Most image formats support metadata specification or [EXIF](https://en.wikipedia.org/wiki/Exif). Image metadata is dictionary map with unique whole short identifier in range 0-65535, Some identifiers are reserved by [EXIF specification.](https://www.exiv2.org/tags.html) From signature perspective image metadata may content any hidden value of standard (int,char, string) or custom type (user defined class), be encrypted and decrypted back by known key over Search method. GroupDocs.Signature provides [ImageMetadataSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures.metadata/ImageMetadataSignature) class to specify Metadata e-signature for image documents. Image document metadata contains pair with unique identifier Id and its Value. Image document metadata could keep big amount of data that provides ability to keep serialized custom objects with additional encryption in there. See more examples [here]({{< ref "signature/java/developer-guide/advanced-usage/signing/sign-document-with-secure-custom-metadata-signatures/_index.md" >}}). Here are the steps to add metadata signatures into Image with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/java/com.groupdocs.signature/Signature) class and pass source document path as a constructor parameter. * Instantiate the [MetadataSignOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/MetadataSignOptions) object according to your requirements. * Instantiate one or several [ImageMetadataSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures.metadata/ImageMetadataSignature) objects and add them into [MetadataSignOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/MetadataSignOptions) to metadata signatures collection ([getSignatures](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/MetadataSignOptions#getSignatures())) via [add](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures.metadata/MetadataSignatureCollection#add(com.groupdocs.signature.domain.signatures.metadata.MetadataSignature)) or addRange method. * Call [sign](https://reference.groupdocs.com/signature/java/com.groupdocs.signature/Signature#sign(java.io.OutputStream,%20com.groupdocs.signature.options.sign.SignOptions)) method of [Signature](https://reference.groupdocs.com/signature/java/com.groupdocs.signature/Signature) class instance and pass [MetadataSignOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/MetadataSignOptions) to it. ## How to eSign Image with Metadata signature This example shows how to sign png image with metadata e-signatures ```java Signature signature = new Signature("sample.jpg"); // create Metadata option with predefined Metadata text MetadataSignOptions options = new MetadataSignOptions(); // Specify different Metadata Signatures and add them to options signature collection int imgsMetadataId = 41996; // Create several Image Metadata signatures with different types ImageMetadataSignature[] signatures = new ImageMetadataSignature[] { new ImageMetadataSignature(imgsMetadataId++, 123456), // int new ImageMetadataSignature(imgsMetadataId++, "Mr.Scherlock Holmes"), // string new ImageMetadataSignature(imgsMetadataId++,new Date()), // date time new ImageMetadataSignature(imgsMetadataId++, 123.456), //decimal value }; options.getSignatures().addRange(signatures); // sign document to file signature.sign("SampleSigned.jpg", options); ``` ## More resources ### Advanced Usage Topics To learn more about document eSign features, please refer to the [advanced usage section]({{< ref "signature/java/developer-guide/advanced-usage/_index.md" >}}). ### GitHub Examples  You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online App  Along with full-featured .NET library we provide simple, but powerful free Apps.  You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online **[GroupDocs Signature App](https://products.groupdocs.app/signature)**. --- ## Iterative Digital signing of the PDF document Path: /signature/net/iterative-digital-signing-of-the-pdf-document/ ### How to apply digital signatures iteratively to a PDF document [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) class to specify different amount of settings for Digital signature * digital certificate (file on local disk [CertificateFilePath](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/certificatefilepath/) or stream [CertificateStream](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/certificatestream/)) (required) * password of digital certificate [Password](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/password/) (required) * digital signature details ([Reason](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/reason/), [Contact](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/contact/), [Location](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/location/)) ### How to add Digital signature: * Define the paths for the input PDF file, the digital certificates, and specify the output path where the signed documents will be saved. * Create a new instance of the [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass the source document path as a constructor parameter. * Instantiate the [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) object with the required certificate and its password, and configure additional properties such as reason, contact, location, and position. * Call the [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class instance and pass [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) to it. * After signing, update the document path for the next iteration. * Analyze the [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) to check the newly created signatures if needed. * Iterate through each certificate, repeating the above steps for each one. This example demonstrates how to iteratively sign a PDF document with multiple digital certificates. See [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) ```csharp string filePath = "sample.pdf"; string fileName = Path.GetFileName(filePath); string[] certificatePaths = new string[] { "certificate1.pfx", "certificate2.pfx" }; string outputFilePath = Path.Combine("output folder path", "SignWithDigitalIterative", fileName); int iteration = 1; string documentFile = filePath; foreach (var certificatePath in certificatePaths) { using (Signature signature = new Signature(documentFile)) { DigitalSignOptions options = new DigitalSignOptions(certificatePath) { Password = "1234567890", // Certificate password Reason = $"Approved-{iteration}", // Digital certificate details Contact = $"John{iteration} Smith{iteration}", Location = $"Location-{iteration}", AllPages = true, // Sign all pages Left = 10 + 100 * (iteration - 1), Top = 10 + 100 * (iteration - 1), Width = 160, Height = 80, Margin = new Padding() { Bottom = 10, Right = 10 } }; SignResult signResult = signature.Sign(outputFilePath, options); documentFile = outputFilePath; Console.WriteLine($"\nSource document signed successfully {iteration++}-" + $"time with {signResult.Succeeded.Count} signature(s).\n" + $"File saved at {outputFilePath}."); } } ``` ### Iteratively sign with custom appearance and image This example demonstrates how to iteratively sign a PDF document with multiple digital certificates, customizing the appearance and adding an image to each signature. See [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) Here are the steps: * Setting up variables: define the paths for the input PDF file, the digital certificates, and specify the output path where the signed documents will be saved. ```csharp // File paths for source document, image, and output files string sourceFile = "sample.pdf"; string imageFilePath = "image.jpg"; string signedFile = "signed.pdf"; string resultOutputFile = "result.pdf"; // Paths to digital certificates for signing string[] certificatePaths = new string[] { certificateFilePath1, certificateFilePath2 }; int iteration = 0; ``` * Helper method to generate the [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) object with the required certificate and its password, and configure additional properties such as reason, contact, location, and position. An image and custom appearance labels are also set. ```csharp private static DigitalSignOptions CreateDigitalSignOptions(string certificatePath, string imageFilePath, int iteration) { return new DigitalSignOptions(certificatePath) { Password = "1234567890", // Certificate password Reason = "Sign", // Signature reason Contact = $"JohnSmith{iteration}", // Contact details Location = $"Office{iteration}", // Signature location Visible = true, Left = 80 + iteration * 5, // Positioning for visibility Top = 600 + iteration * 5, Height = 50 + iteration * 5, Width = 200 + iteration * 5, ImageFilePath = imageFilePath, // Image appearance for signature Appearance = new PdfDigitalSignatureAppearance { ReasonLabel = "Reason Label", DigitalSignedLabel = "Digital Signed Label" } }; } ``` * Create a new instance of the [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass the source document path as a constructor parameter. * Call the [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class instance and pass [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) to it. * After signing, update the document path for the next iteration. * Analyze the [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) to check the newly created signatures if needed. * Iterate through each certificate, repeating the above steps for each one. ```csharp foreach (var certificatePath in certificatePaths) { using (Signature signature = new Signature("sample.pdf")) { // Generate signature options with helper method DigitalSignOptions options = CreateDigitalSignOptions(certificatePath, imageFilePath, iteration); // Update output file name on second iteration if (iteration == 1) signedFile = resultOutputFile; // Sign document and display result SignResult signResult = signature.Sign(signedFile, options); Console.WriteLine( $"\nDocument signed successfully {iteration + 1}-time with " + $"{signResult.Succeeded.Count} signature(s).\nFile saved at {signedFile}."); iteration++; } } ``` ### Customize digital appearance with color, image and font This example demonstrates how to apply a digital signature with a customized appearance, including a foreground color, image, and specific font settings. Here are the steps: * Setting up variables: define the paths for the input PDF file, the digital certificates, and specify the output path where the signed documents will be saved. ```csharp // File paths for source document, image, and output files string sourceFile = "sample.pdf"; string imageFilePath = "image.jpg"; string signedFile = "signed.pdf"; string resultOutputFile = "result.pdf"; // Paths to digital certificates for signing string[] certificatePaths = new string[] { certificateFilePath1, certificateFilePath2 }; int iteration = 0; ``` * Helper method to generate the [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) object with the required certificate and its password, and configure additional properties such as reason, contact, location, and position. An image and custom appearance labels are also set. ```csharp private static DigitalSignOptions CreateDigitalSignOptions(string certificatePath, string imageFilePath, int iteration) { return new DigitalSignOptions(certificatePath) { // Specify the type of signature SignatureType = SignatureType.Digital, // Provide the certificate password Password = "1234567890", // Digital certificate details for signature metadata Reason = "Sign", // Reason for the signature Contact = "JohnSmith" + iteration, // Contact information of the signer Location = "Office1" + iteration, // Location where the document is signed // Enable visibility of the signature on the document Visible = true, // Specify the position and size of the signature on the page Left = 400, // Horizontal position (X-axis) Top = 20 + iteration * 70, // Vertical position (Y-axis) Height = 70, // Height of the signature area Width = 200, // Width of the signature area // Add an image to represent the digital certificate's appearance ImageFilePath = imageFilePath, // Path to the image file // Customize the signature's appearance Appearance = new PdfDigitalSignatureAppearance { // Set a custom font color for the signature text Foreground = Color.FromArgb(50, Color.Gray), // Apply specific font settings for the signature FontFamilyName = "TimesNewRoman", // Font family name FontSize = 12 // Font size } }; } ``` * Create a new instance of the [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass the source document path as a constructor parameter. * Call the [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class instance and pass [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) to it. * After signing, update the document path for the next iteration. * Analyze the [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) to check the newly created signatures if needed. * Iterate through each certificate, repeating the above steps for each one. ```csharp foreach (var certificatePath in certificatePaths) { using (Signature signature = new Signature("sample.pdf")) { // Generate signature options with helper method DigitalSignOptions options = CreateDigitalSignOptions(certificatePath, imageFilePath, iteration); // Update output file name on second iteration if (iteration == 1) signedFile = resultOutputFile; // Sign document and display result SignResult signResult = signature.Sign(signedFile, options); Console.WriteLine( $"\nDocument signed successfully {iteration + 1}-time with " + $"{signResult.Succeeded.Count} signature(s).\nFile saved at {signedFile}."); iteration++; } } ``` The following image demonstrates the result: ![Digital](/signature/net/images/iterative-digital-signing-of-the-pdf-document_custom_colors.png) ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Sign document with Royal Mail Mailmark 2D Barcode signature Path: /signature/net/sign-document-with-mailmark-2d/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides [Mailmark2D](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain.extensions/mailmark2d/mailmark2d) class to create Royal Mail Mailmark 2D barcode. These barcodes can store various data, including information about the sender, recipient, postage, and destination. The use of Mailmark 2D barcodes allows for more accurate and detailed tracking of mail items throughout their journey in the postal system. Here are the steps how to add Mailmark2D Barcode signature into document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter. * Instantiate the  [Mailmark2D](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain.extensions/mailmark2d/mailmark2d/) object with all required additional options. * Instantiate the  [QrCodeSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/qrcodesignoptions/) object with all required additional options and set Mailmark2D object into Data property. * Call [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class instance and pass [QrCodeSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/qrcodesignoptions) to it. * Analyze [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) result to check newly created signatures if needed. This example shows how to add Mailmark2D signature to document. We use enum [Mailmark2DType](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain.extensions/mailmark2dtype/) to specify 2D barcode type, on which depends barcode form: ![Types](/signature/net/images/mailmark2dtype.png) ```csharp using (Signature signature = new Signature(filePath)) { // create Mailmark2D data object Mailmark2D mailmark2D = new Mailmark2D() { UPUCountryID = "JGB ", InformationTypeID = "0", Class = "1", SupplyChainID = 123, ItemID = 1234, DestinationPostCodeAndDPS = "QWE1", RTSFlag = "0", ReturnToSenderPostCode = "QWE2", DataMatrixType = Mailmark2DType.Type_7, CustomerContentEncodeMode = DataMatrixEncodeMode.C40, CustomerContent = "CUSTOM" }; // create options QrCodeSignOptions options = new QrCodeSignOptions { EncodeType = QrCodeTypes.QR, Left = 100, Top = 100, // setup Data property to Mailmark2D instance Data = mailmark2D }; // sign document to file var signResult = signature.Sign(outputFilePath, options); // analyzing result Console.WriteLine("List of newly created signatures:"); int number = 1; foreach (BaseSignature temp in signResult.Succeeded) { Console.WriteLine($"Signature #{number++}: Type: {temp.SignatureType} Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); }  } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To generate barcodes and/or sign your files with barcodes for free, you can use the [Barcode Generator](https://products.groupdocs.app/signature/generate/barcode) online app. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the other online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Pdf Digitally signing Path: /signature/net/sign-document-with-digital-signature-advanced/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) class to specify different amount of settings for Digital signature * digital certificate (file on local disk [CertificateFilePath](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/certificatefilepath/) or stream [CertificateStream](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/certificatestream/)) (required) * password of digital certificate [Password](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/password/) (required) * digital signature details ([Reason](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/reason/), [Contact](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/contact/), [Location](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/location/)) * signature image as digital signature appearance on document page ([ImageFilePath](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/imagesignoptions/imagefilepath) or [ImageStream](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/imagesignoptions/imagestream)) * image signature appearance on document page ([Alignment](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/imagesignoptions/horizontalalignment), [Margin](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/imagesignoptions/margin) etc.) Here are the steps to add Digital signature into document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter. * Instantiate the [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) object with required certificate and its password. * Call [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method of  [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class instance and pass [DigitalSignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/digitalsignoptions/) to it. * Analyze [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) result to check newly created signatures if needed. This example shows how to add Digital signature to document. See [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) ```csharp using (Signature signature = new Signature("sample.pdf")) { // initialize digital option with certificate file path DigitalSignOptions options = new DigitalSignOptions("certificate.pfx") { // certifiate password Password = "1234567890", // digital certificate details Reason = "Sign", Contact = "JohnSmith", Location = "Office1", // image as digital certificate appearance on document pages ImageFilePath = "sample.jpg", // AllPages = true, Width = 80, Height = 60, VerticalAlignment = VerticalAlignment.Bottom, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Padding() { Bottom = 10, Right = 10}, }; signature.Sign("signed.pdf", options); } ``` ### Add Long-Term Validation (LTV)(Long-Term Validation) information for a signature What is Long-Term Validation (LTV) for Digital Signatures? Long-Term Validation (LTV) is a method used to ensure the continued validity of digital signatures over time, even after the signing certificate expires or is revoked. LTV embeds additional information within the signed document, such as the certificate’s revocation status, timestamp, and the certificate chain, which allows anyone verifying the signature in the future to determine its authenticity, even if the original certificate is no longer available. Why is LTV Important? Digital signatures rely on certificates, which have expiration dates. Once the signing certificate expires or is revoked, the signature may no longer be considered valid. However, many legal, financial, and regulatory scenarios require documents to remain valid for years or decades. LTV solves this problem by embedding validation data directly into the signed document, ensuring that the signature’s authenticity can be verified at any point in the future. Here is an example of how to implement Long-Term Validation (LTV) for a PDF document using GroupDocs.Signature: ```csharp using (Signature signature = new Signature("sample.pdf")) { // initialize digital option with certificate file path DigitalSignOptions options = new DigitalSignOptions("certificate.pfx") { // certifiate password Password = "1234567890", // digital certificate details Reason = "Sign", Contact = "JohnSmith", Location = "Office1", AllPages = true, Width = 80, Height = 60, VerticalAlignment = VerticalAlignment.Bottom, HorizontalAlignment = HorizontalAlignment.Right, Margin = new Padding() {Bottom = 10, Right = 10}, // Enable Long-Term Validation (LTV) to ensure signature validity over time UseLtv = true }; signature.Sign("signed.pdf", options); } ``` After signing a document with LTV support, you can check whether the signature includes LTV data using Adobe Acrobat. Here is the example of signature detailes in Adobe Acrobat: ![LTV](/signature/net/images/sign-document-with-ltv-advanced.png) ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Deleting Barcode signatures - advanced Path: /signature/java/deleting-barcode-signatures-advanced/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/java) provides [BarcodeSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature) class to manipulate barcode signatures and delete them from the documents over [delete](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#delete(java.io.OutputStream,%20com.groupdocs.signature.domain.signatures.BaseSignature)) method. Please be aware that [delete](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#delete(java.io.OutputStream,%20com.groupdocs.signature.domain.signatures.BaseSignature)) method modifies the same document that was passed to constructor of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class. Here are the steps to delete Barcode signature from the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class and pass source document path as a constructor parameter; * Instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.search/BarcodeSearchOptions) object with desired properties; * Call [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) method to obtain list of [BarcodeSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature); * Select from list [BarcodeSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature) object(s) that should be removed from the document; * Call [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) object [delete](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#delete(java.io.OutputStream,%20com.groupdocs.signature.domain.signatures.BaseSignature)) method and pass one or several signatures to it. * Analyze [DeleteResult](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain/DeleteResult) result to check whether signatures were updated or not. Here are the alternative steps to delete Barcode signature from the document with GroupDocs.Signature. This approach is based on saved signatures Id after [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) or [sign](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#sign(java.io.OutputStream,%20com.groupdocs.signature.options.sign.SignOptions)) methods. * Create new instance of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class and pass source document path as a constructor parameter; * Instantiate one or several [BarcodeSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature) objects with signature Id(s) passed to constructor; * Call [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class object [delete](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#delete(java.io.OutputStream,%20com.groupdocs.signature.domain.signatures.BaseSignature)) method and pass one or several signatures to it; * Analyze [DeleteResult](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain/DeleteResult) result to check whether signatures were updated or not.  ## Delete Barcode signature from the document after Search This example shows how to delete Barcode signature that was found using [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) method. ```java // initialize Signature instance Signature signature = new Signature("signed.docx"); BarcodeSearchOptions options = new BarcodeSearchOptions(); List signatures = signature.search(BarcodeSignature.class, options); List signaturesToDelete = new ArrayList(); // collect signatures to delete for (BarcodeSignature temp : signatures) { if (temp.getText().contains("John")) { signaturesToDelete.add(temp); } } // delete signatures DeleteResult deleteResult = signature.delete("signed.docx",signaturesToDelete); if (deleteResult.getSucceeded().size() == signaturesToDelete.size()) { System.out.print("All signatures were successfully deleted!"); } else { System.out.print("Successfully deleted signatures : "+deleteResult.getSucceeded().size()); System.out.print("Not deleted signatures : "+deleteResult.getFailed().size()); } System.out.print("List of deleted signatures:"); for(BaseSignature temp : deleteResult.getSucceeded()) { System.out.print("Signature# Id:"+temp.getSignatureId()+", Location: "+temp.getLeft()+"x"+temp.getTop()+". Size: "+temp.getWidth()+"x"+temp.getHeight()); } ``` ## Delete Barcode signature from the document by known signature Identifier This example shows how to delete Barcode signature in the document by known signature Id (that was obtained by  [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) or [sign](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#sign(java.io.OutputStream,%20com.groupdocs.signature.options.sign.SignOptions)) method previously). ```java // initialize Signature instance Signature signature = new Signature("signed.docx"); // read from some data source signature Id value String[] signatureIdList = new String[] { "1a5fbc08-4b96-43d9-b650-578b16fbb877", "b0123987-b0d4-4004-86ec-30ab5c41ac7e" }; // create list of Barcode Signature by known SignatureId List signatures = new ArrayList(); for (String item : signatureIdList) { signatures.add(new BarcodeSignature(item)); } // delete required signatures DeleteResult deleteResult = signature.delete("signed.docx",signatures); if (deleteResult.getSucceeded().size() == signatures.size()) { System.out.print("All signatures were successfully deleted!"); } else { System.out.print("Successfully deleted signatures : " + deleteResult.getSucceeded().size()); System.out.print("Not deleted signatures : " + deleteResult.getFailed().size()); } System.out.print("List of deleted signatures:"); for(BaseSignature temp : deleteResult.getSucceeded()) { System.out.print("Signature# Id:"+temp.getSignatureId()+", Location: "+temp.getLeft()+"x"+temp.getTop()+". Size: "+temp.getWidth()+"x"+temp.getHeight()); } ``` ## More resources GitHub Examples  You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online App   Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online **[GroupDocs Signature App](https://products.groupdocs.app/signature)**. --- ## Delete Barcode signatures from documents Path: /signature/java/delete-barcode-signatures-from-documents/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/java) provides [BarcodeSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature) class to manipulate barcode signatures and delete them from the documents over [delete](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options/Signature#delete(java.io.OutputStream,%20com.groupdocs.signature.domain.signatures.BaseSignature)) method. Please be aware that [delete](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options/Signature#delete(java.io.OutputStream,%20com.groupdocs.signature.domain.signatures.BaseSignature)) method modifies the same document that was passed to constructor of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class. Here are the steps to delete Barcode signature from the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class and pass source document path as a constructor parameter; * Instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.search/BarcodeSearchOptions) object with desired properties; * Call [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) method to obtain list of [BarcodeSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature); * Select from list [BarcodeSignature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.signatures/BarcodeSignature) object(s) that should be removed from the document; * Call [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) object [delete](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options/Signature#delete(java.io.OutputStream,%20com.groupdocs.signature.domain.signatures.BaseSignature)) method and pass one or several signatures to it. or not.  This example shows how to delete Barcode signature that was found using [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) method. ```java Signature signature = new Signature("signed.docx"); try { BarcodeSearchOptions options = new BarcodeSearchOptions(); // search for Barcode signatures in document List signatures = signature.search(BarcodeSignature.class,options); if (signatures.size() > 0) { BarcodeSignature barcodeSignature = signatures.get(0); boolean result = signature.delete("signed.docx", barcodeSignature); if (result) { System.out.print("Signature with Barcode "+barcodeSignature.getText()+" and encode type "+barcodeSignature.getEncodeType().getTypeName()+" was updated in the document [signed.docx]."); } else { System.out.print("Signature was not updated in the document! Signature with Barcode "+barcodeSignature.getText()+" and encode type "+barcodeSignature.getEncodeType().getTypeName()+" was not found!"); } } } catch (Exception e) { throw new GroupDocsSignatureException(e.getMessage()); } ``` ## More resources ### Advanced Usage Topics To learn more about document eSign features, please refer to the [advanced usage section]({{< ref "signature/java/developer-guide/advanced-usage/_index.md" >}}). ### GitHub Examples  You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online App  Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online **[GroupDocs Signature App](https://products.groupdocs.app/signature)**. --- ## Deleting Barcode signatures - advanced Path: /signature/net/deleting-barcode-signatures-advanced/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) class to manipulate barcode signatures and delete them from the documents over [Delete](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/delete) method. Please be aware that [Delete](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/delete) method modifies the same document that was passed to constructor of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class. Here are the steps to delete Barcode signature from the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter; * Instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) object with desired properties; * Call [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method to obtain list of [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature); * Select from list [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) object(s) that should be removed from the document; * Call [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) object [Delete](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/delete) method and pass one or several signatures to it. * Analyze [DeleteResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/deleteresult) result to check whether signatures were updated or not. Here are the alternative steps to delete Barcode signature from the document with GroupDocs.Signature. This approach is based on saved signatures Id after [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) or [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) methods. * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter; * Instantiate one or several [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) objects with signature Id(s) passed to constructor; * Call [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class object [Delete](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/delete) method and pass one or several signatures to it; * Analyze [DeleteResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/deleteresult) result to check whether signatures were updated or not. ## Delete Barcode signature from the document after Search This example shows how to delete Barcode signature that was found using [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method. ```csharp // initialize Signature instance using (Signature signature = new Signature("signed.docx")) { BarcodeSearchOptions options = new BarcodeSearchOptions(); List signatures = signature.Search(options); List signaturesToDelete = new List(); // collect signatures to delete foreach (BarcodeSignature temp in signatures) { if (temp.Text.Contains("John")) { signaturesToDelete.Add(temp); } } // delete signatures DeleteResult deleteResult = signature.Delete(signaturesToDelete); if (deleteResult.Succeeded.Count == signaturesToDelete.Count) { Console.WriteLine("All signatures were successfully deleted!"); } else { Console.WriteLine($"Successfully deleted signatures : {deleteResult.Succeeded.Count}"); Console.WriteLine($"Not deleted signatures : {deleteResult.Failed.Count}"); } Console.WriteLine("List of deleted signatures:"); foreach (BaseSignature temp in deleteResult.Succeeded) { Console.WriteLine($"Signature# Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); } } ``` ## Delete Barcode signature from the document by known signature Identifier This example shows how to delete Barcode signature in the document by known signature Id (that was obtained by [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) or [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method previously). ```csharp // initialize Signature instance using (Signature signature = new Signature("signed.docx")) { // read from some data source signature Id value string[] signatureIdList = new string[] { "1dd21cf3-b904-4da9-9413-1ff1dab51974", "9e386726-a773-4971-b2fc-eaadfce65ffd" }; // create list of Barcode Signature by known SignatureId List signatures = new List(); signatureIdList.ToList().ForEach(p => signatures.Add(new BarcodeSignature(p))); // delete required signatures DeleteResult deleteResult = signature.Delete(signatures); if (deleteResult.Succeeded.Count == signatures.Count) { Console.WriteLine("All signatures were successfully deleted!"); } else { Console.WriteLine($"Successfully deleted signatures : {deleteResult.Succeeded.Count}"); Console.WriteLine($"Not deleted signatures : {deleteResult.Failed.Count}"); } Console.WriteLine("List of deleted signatures:"); foreach (BaseSignature temp in deleteResult.Succeeded) { Console.WriteLine($"Signature# Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); } } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To generate barcodes and/or sign your files with barcodes for free, you can use the [Barcode Generator](https://products.groupdocs.app/signature/generate/barcode) online app. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the other online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Delete Barcode signatures from documents Path: /signature/net/delete-barcode-signatures-from-documents/ ## Overview [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) class to manipulate barcode signatures and delete them from the documents over [Delete](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/delete) method. Please be aware that [Delete](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/delete) method modifies the same document that was passed to constructor of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class. ## How to delete Barcode signature from the document Here are the steps to delete Barcode signature from the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter; * Instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) object with desired properties; * Call [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method to obtain list of [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature); * Select from list [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) object(s) that should be removed from the document; * Call [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) object [Delete](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/delete) method and pass one or several signatures to it. This example shows how to delete Barcode signature that was found using [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method. ```csharp using (Signature signature = new Signature("signed.docx")) { BarcodeSearchOptions options = new BarcodeSearchOptions(); // search for Barcode signatures in document List signatures = signature.Search(options); if (signatures.Count > 0) { BarcodeSignature barcodeSignature = signatures[0]; bool result = signature.Delete(barcodeSignature); if (result) { Console.WriteLine( $"Signature with Barcode '{barcodeSignature.Text}' and " + $"encode type '{barcodeSignature.EncodeType.TypeName}' " + $"was deleted from document ['{fileName}']." ); } else { Console.WriteLine( $"Signature was not deleted from the document! " + $"Signature with Barcode '{barcodeSignature.Text}' and " + $"encode type '{barcodeSignature.EncodeType.TypeName}' " + $"was not found!" ); } } } ``` ### Advanced Usage Topics To learn more about document eSign features, please refer to the [advanced usage section]({{< ref "signature/net/developer-guide/advanced-usage/_index.md" >}}). ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Delete Barcode signatures from documents Path: /signature/nodejs-java/delete-barcode-signatures-from-documents/ ## Overview [**GroupDocs.Signature**](https://products.groupdocs.com/signature/nodejs-java) provides [BarcodeSignature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature.domain/barcodesignature) class to manipulate barcode signatures and delete them from the documents over [Delete](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/delete) method. Please be aware that [Delete](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/delete) method modifies the same document that was passed to constructor of [Signature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature) class. ## How to delete Barcode signature from the document Here are the steps to delete Barcode signature from the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature) class and pass source document path as a constructor parameter; * Instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature.options.search/barcodesearchoptions/) object with desired properties; * Call [Search](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search(com.groupdocs.signature.options.search.SearchOptions)) method to obtain list of [BarcodeSignature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature.domain/barcodesignature); * Select from list [BarcodeSignature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature.domain/barcodesignature) object(s) that should be removed from the document; * Call [Signature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature) object [Delete](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/delete) method and pass one or several signatures to it. This example shows how to delete Barcode signature that was found using [Search](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search(com.groupdocs.signature.options.search.SearchOptions)) method. ```javascript const filePath = Constants.SAMPLE_PDF_SIGNED; const fileName = path.basename(filePath); const outputDirectory = path.join(Constants.OutputPath, 'DeleteBarcode'); if (!fs.existsSync(outputDirectory)) { fs.mkdirSync(outputDirectory, { recursive: true }); } // Copy source file since the delete method works with the same Document const outputFilePath = path.join(outputDirectory, fileName); fs.copyFileSync(filePath, outputFilePath); const signature = new signatureLib.Signature(outputFilePath); const options = new signatureLib.BarcodeSearchOptions(); // Search for Barcode signatures in the document const signatures = signature.search(signatureLib.BarcodeSignature.class, options).toArray(); if (signatures.length > 0) { const barcodeSignature = signatures[0]; const isDeleted = signature.delete(outputFilePath, barcodeSignature); const barcodeText = barcodeSignature.getText(); const encodeTypeName = barcodeSignature.getEncodeType().getTypeName(); if (isDeleted) { console.log( `Signature with Barcode '${barcodeText}' and encode type '${encodeTypeName}' was successfully deleted from the document '${fileName}'.` ); } else { console.log( `Failed to delete the signature! Barcode '${barcodeText}' with encode type '${encodeTypeName}' was not removed from the document '${fileName}'.` ); } } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## How to update Barcode signature in advance Path: /signature/net/updating-barcode-signatures-with-advanced-options/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) class to manipulate barcode signatures location, size, textual content and encode type over [Update](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/update/) method of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class. This method returns [UpdateResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/updateresult) object to analyze if signatures were successfully processed. Please be aware that [Update](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/update/) method modifies the same document that was passed to constructor of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class. The [UpdateResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/updateresult) contains list of successfully updated signatures and ones that failed. The Barcode signature could be failed to update due to several reasons: * if signature object was initialized with constructor by incorrect signature identifier; * if signature object was not found; * there was an error occurred while updating signature in the document. Here are the steps to update Barcode signature in the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter; * Instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) object with desired properties; * Call [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method to obtain list of [BarcodeSignatures](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature); * Select from list [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) object(s) that should be updated; * Call [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) object [Update](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/update/) method and pass one or several signatures to it. * Analyze [UpdateResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/updateresult) result to check whether signatures were updated or not. Here are the alternative steps to update Barcode signature in the document with GroupDocs.Signature. This approach is based on saved signatures Id after [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) or [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) methods. * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter; * Instantiate one or several [BarcodeSignature](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/barcodesignature) objects with signature Id(s) passed to constructor; * Call [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class object [Update](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/update/) method and pass one or several signatures to it; * Analyze [UpdateResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/updateresult) result to check whether signatures were updated or not. The following table describes changeable properties for Barcode signatures dependent on document type. | Document Type / Signature Property | Left | Top | Width | Height | EncodeType | Text | IsSignature | | --- | --- | --- | --- | --- | --- | --- | --- | | Image | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | | Spreadsheet | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | ![(tick)](/signature/net/images/check.png) | | Pdf | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | ![(tick)](/signature/net/images/check.png) | | Presentation | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | ![(tick)](/signature/net/images/check.png) | | Word Processing | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(tick)](/signature/net/images/check.png) | ![(error)](/signature/net/images/error.png) | ![(error)](/signature/net/images/error.png) | ![(tick)](/signature/net/images/check.png) | ## Update Barcode signature in the document after Search This example shows how to update Barcode signature that was found using [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method. ```csharp // initialize Signature instance using (Signature signature = new Signature("signed.pdf")) { BarcodeSearchOptions options = new BarcodeSearchOptions(); List signatures = signature.Search(options); // adjust signature properties foreach (BarcodeSignature temp in signatures) { // apply some condition to adjust signature properties if (temp.Text == "Test1") { temp.Left = temp.Left + 10; temp.Top = temp.Top + 10; } temp.IsSignature = true; } // update all found signatures UpdateResult updateResult = signature.Update(signatures.ConvertAll(p => (BaseSignature)p)); if (updateResult.Succeeded.Count == signatures.Count) { Console.WriteLine("\nAll signatures were successfully updated!"); } else { Console.WriteLine($"Successfully updated signatures : {updateResult.Succeeded.Count}"); Console.WriteLine($"Not updated signatures : {updateResult.Failed.Count}"); } Console.WriteLine("List of updated signatures:"); foreach (BaseSignature temp in updateResult.Succeeded) { Console.WriteLine($"Signature# Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); } } ``` ## Update Barcode signature in document by known signature Identifier This example shows how to update Barcode signature in the document by known signature Id (that was obtained by [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) or [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method previously). ```csharp // initialize Signature instance using (Signature signature = new Signature("signed.xlsx")) { // read from some data source signature Id value string[] signatureIdList = new string[] { "1dd21cf3-b904-4da9-9413-1ff1dab51974", "9e386726-a773-4971-b2fc-eaadfce65ffd" }; // create list of Barcode Signature by known SignatureId List signatures = new List(); signatureIdList.ToList().ForEach(p => signatures.Add(new BarcodeSignature(p))); // update all found signatures UpdateResult updateResult = signature.Update(signatures); if (updateResult.Succeeded.Count == signatures.Count) { Console.WriteLine("All signatures were successfully updated!"); } else { Console.WriteLine($"Successfully updated signatures : {updateResult.Succeeded.Count}"); Console.WriteLine($"Not updated signatures : {updateResult.Failed.Count}"); } Console.WriteLine("List of updated signatures:"); foreach (BaseSignature temp in updateResult.Succeeded) { Console.WriteLine($"Signature# Id:{temp.SignatureId}, Location: {temp.Left}x{temp.Top}. Size: {temp.Width}x{temp.Height}"); } } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Composing signature with linear gradient brush background Path: /signature/net/composing-signature-with-linear-gradient-brush-background/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides [LInearGradientBrush](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain.extensions/lineargradientbrush) class to specify filling signature background with linear gradients Here are the steps to use Linear gradient brush with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path or stream as a constructor parameter. * Instantiate the [SignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/signoptions) object with all required additional options and setup [Background.Brush](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/background/brush) property with instance of  [LInearGradientBrush](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain.extensions/lineargradientbrush) * Call [Sign](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/sign/) method of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class instance and pass [SignOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/signoptions) to it. * Analyze [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) result to check newly created signatures if needed. This example shows how to use Texture brush for signature background. See [SignResult](https://reference.groupdocs.com/signature/net/groupdocs.signature.domain/signresult) ```csharp using (Signature signature = new Signature("sample.docx")) { TextSignOptions options = new TextSignOptions("John Smith") { // adjust signature appearance brush // setup background Background = new Background() { Color = Color.LimeGreen, Transparency = 0.5, Brush = new LinearGradientBrush(Color.LimeGreen, Color.White, 45) }, // locate signature Width = 100, Height = 80, VerticalAlignment = Domain.VerticalAlignment.Center, HorizontalAlignment = Domain.HorizontalAlignment.Center, Margin = new Padding() { Top = 20, Right = 20 }, // set alternative signature implementation on document page SignatureImplementation = TextSignatureImplementation.Image }; // sign document to file signature.Sign("signed.docx", options); } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Delete Barcode signatures from documents Path: /signature/python-net/delete-barcode-signatures-from-documents/ ## Overview [**GroupDocs.Signature**](https://products.groupdocs.com/signature/python-net) provides [BarcodeSignature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/barcodesignature) class to manipulate barcode signatures and delete them from the documents over [Delete](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/delete) method. Please be aware that [Delete](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/delete) method modifies the same document that was passed to constructor of [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class. ## How to delete Barcode signature from the document Here are the steps to delete Barcode signature from the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class and pass source document path as a constructor parameter; * Instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesearchoptions) object with desired properties; * Call [Search](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/search) method to obtain list of [BarcodeSignature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/barcodesignature); * Select from list [BarcodeSignature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/barcodesignature) object(s) that should be removed from the document; * Call [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) object [Delete](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/delete) method and pass one or several signatures to it. This example shows how to delete Barcode signature that was found using [Search](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/search) method. ```python import groupdocs.signature as signature from groupdocs.signature.options import BarcodeSearchOptions # Initialize signature with signature.Signature("signed.docx") as sign: # Create search options options = BarcodeSearchOptions() # Search for barcode signatures in document signatures = sign.search(options) if len(signatures) > 0: barcode_signature = signatures[0] result = sign.delete(barcode_signature) if result: print( f"Signature with Barcode '{barcode_signature.text}' and " f"encode type '{barcode_signature.encode_type.type_name}' " f"was deleted from document ['{fileName}']." ) else: print( f"Signature was not deleted from the document! " f"Signature with Barcode '{barcode_signature.text}' and " f"encode type '{barcode_signature.encode_type.type_name}' " f"was not found!" ) ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for Python via .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Python-via-.NET) ### Free Online Apps Along with the full-featured Python library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Advanced search for Barcode signatures Path: /signature/java/advanced-search-for-barcode-signatures/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/java) provides [BarcodeSearchOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.search/BarcodeSearchOptions) class to specify different options to search for Barcode Signatures. Here are the steps to search for barcode signatures within the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class and pass source document path as a constructor parameter. * Instantiate the [BarcodeSearchOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.search/BarcodeSearchOptions) object according to your requirements and specify search options * Call [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) method of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class instance and pass [BarcodeSearchOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.search/BarcodeSearchOptions) to it. This example shows how to make advanced search for Barcode signature in the document. ```java Signature signature = new Signature("sample.pdf"); BarcodeSearchOptions options = new BarcodeSearchOptions(); options.setAllPages(true); // this value is set by default // single page number options.setPageNumber(1); // setup extended search in pages setup PagesSetup pagesSetup = new PagesSetup() ; pagesSetup.setFirstPage(true); pagesSetup.setLastPage(true); pagesSetup.setOddPages(false); pagesSetup.setEvenPages(false); options.setPagesSetup(pagesSetup); // specify special barcode type to search options.setEncodeType(BarcodeTypes.Code39Standard); // specify text match type options.setMatchType(TextMatchType.Contains); // specify text pattern to search options.setText("12345678"); // search for signatures in document List signatures = signature.search(BarcodeSignature.class, options); System.out.print("\nSource document contains following signatures."); for (BarcodeSignature barcodeSignature : signatures) { System.out.print("Barcode signature found at page " + barcodeSignature.getPageNumber() + " with type " + barcodeSignature.getEncodeType() + " and text " + barcodeSignature.getText()); } ``` ## More resources ### GitHub Examples  You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online App  Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online **[GroupDocs Signature App](https://products.groupdocs.app/signature)**. --- ## Advanced search for Barcode signatures Path: /signature/net/advanced-search-for-barcode-signatures/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) class to specify different options to search for Barcode Signatures. Here are the steps to search for barcode signatures within the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter. * Instantiate the [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) object according to your requirements and specify search options * Call [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class instance and pass [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) to it. This example shows how to make advanced search for Barcode signature in the document with enabled options to grab barcode electronic signature context. ```csharp using (Signature signature = new Signature("sample.pdf")) { BarcodeSearchOptions options = new BarcodeSearchOptions() { // specify special pages to search on AllPages = false, // single page number PageNumber = 1, // setup extended search in pages setup PagesSetup = new PagesSetup() { FirstPage = true, LastPage = true, OddPages = false, EvenPages = false }, // specify special barcode type to search EncodeType = BarcodeTypes.Code39Standard, // specify text match type MatchType = TextMatchType.Contains, // specify text pattern to search Text = "12345678", // set field for barcode images returning ReturnContent = true, // specify type of returned barcode images ReturnContentType = FileType.PNG }; // search for signatures in document List signatures = signature.Search(options); Console.WriteLine("\nSource document contains following signatures."); foreach (var barcodeSignature in signatures) { Console.WriteLine("Barcode signature found at page {0} with type {1} and text {2}", barcodeSignature.PageNumber, barcodeSignature.EncodeType, barcodeSignature.Text); Console.WriteLine("Barcode signature size {0} and format {1}", barcodeSignature.Content?.Length, barcodeSignature.Format); Console.WriteLine($"Location at {barcodeSignature.Left}-{barcodeSignature.Top}. Size is {barcodeSignature.Width}x{barcodeSignature.Height}."); } //Save Barcode images string outputPath = Path.Combine(Constants.OutputPath, "SearchForBarcodeAdvanced"); if (!Directory.Exists(outputPath)) { Directory.CreateDirectory(outputPath); } int i = 0; foreach (BarcodeSignature barcodeSignature in signatures) { if (barcodeSignature.Content != null) { string outputFilePath = Path.Combine(outputPath, $"image{i}{barcodeSignature.Format?.Extension}"); using (FileStream fs = new FileStream(outputFilePath, FileMode.Create)) { fs.Write(barcodeSignature.Content, 0, barcodeSignature.Content.Length); } } i++; } } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Locating signature on page with different measure units Path: /signature/java/locating-signature-on-page-with-different-measure-units/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/java) supports locating signature on document page with different measure units. Enumeration [MeasureType](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.enums/MeasureType) handles following types  * [MeasureType.Pixels](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.enums/MeasureType#Pixels) allows to locate signature position and size with pixels (default value) * [MeasureType.Millimeters](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.enums/MeasureType#Millimeters) allows to locate signature on page and setup size by setting millimeters * [MeasureType.Percents](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.enums/MeasureType#Percents) allows to locate signature position, size with percentage of page size    Here are the steps to locate and size signature area with different measure unit types: * Set property [setLocationMeasureType](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/ImageSignOptions#setLocationMeasureType(int)) with of one values above to specify how to implement values in properties [setLeft](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.interfaces/IRectangle#setLeft(int)), [setTop](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.interfaces/IRectangle#setTop(int)) * Set property [setSizeMeasureType](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/ImageSignOptions#setSizeMeasureType(int)) with of one values above to specify how to implement size of signature values in properties [setWidth](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.interfaces/IRectangle#setWidth(int)), [setHeight](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.domain.interfaces/IRectangle#setHeight(int)) * Set property [setMarginMeasureType](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/ImageSignOptions#setMarginMeasureType(int)) with of one values above to specify how to implement values in property [setMargin](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.sign/ImageSignOptions#setMargin(com.groupdocs.signature.domain.Padding)) ## Set signature positioning in millimeters This example shows how to specify positioning in millimeters. ```java // instantiating the signature object final Signature signature = new Signature("sample.docx"); try { // setup options with text of signature BarcodeSignOptions signOptions = new BarcodeSignOptions("12345678"); // setup Barcode encoding type signOptions.setEncodeType(BarcodeTypes.Code128); // set signature position in absolute position signOptions.setLocationMeasureType(MeasureType.Millimeters); signOptions.setLeft(40); signOptions.setTop(50); // set signature area in millimeters signOptions.setSizeMeasureType(MeasureType.Millimeters); signOptions.setWidth(20); signOptions.setHeight(10); // set margin in millimeters signOptions.setMarginMeasureType(MeasureType.Millimeters); Padding padding = new Padding(); padding.setTop(5); padding.setLeft(5); padding.setRight(5); signOptions.setMargin(padding); // sign document SignResult signResult = signature.sign("signedSample.docx", options); // analyzing result System.out.print("List of newly created signatures:"); int number = 1; for(BaseSignature temp : signResult.getSucceeded()) { System.out.print("Signature #"+ number++ +": Type: "+temp.getSignatureType()+" Id:"+temp.getSignatureId()+ ",Location: "+temp.getLeft()+"x"+temp.getTop()+". Size: "+temp.getWidth()+"x"+temp.getHeight()); } }catch (Exception e){ throw new GroupDocsSignatureException(e.getMessage()); } ``` ## Set signature positioning in percents This example shows how to set different positioning properties in percentage. ```java // instantiating the signature object final Signature signature = new Signature("sample.pdf"); try { // setup options with text of signature BarcodeSignOptions signOptions = new BarcodeSignOptions("12345678"); // setup Barcode encoding type signOptions.setEncodeType(BarcodeTypes.Code128); // set signature position in absolute position signOptions.setLocationMeasureType(MeasureType.Percents); signOptions.setLeft(5); signOptions.setTop(5); // set signature area in percents signOptions.setSizeMeasureType(MeasureType.Percents); signOptions.setWidth(10); signOptions.setHeight(5); // set margin in millimeters signOptions.setMarginMeasureType(MeasureType.Percents); Padding padding = new Padding(); padding.setTop(1); padding.setLeft(1); padding.setRight(1); signOptions.setMargin(padding); // sign document SignResult signResult = signature.sign("signed.docx", options); // analyzing result System.out.print("List of newly created signatures:"); int number = 1; for(BaseSignature temp : signResult.getSucceeded()) { System.out.print("Signature #"+ number++ +": Type: "+temp.getSignatureType()+" Id:"+temp.getSignatureId()+ ",Location: "+temp.getLeft()+"x"+temp.getTop()+". Size: "+temp.getWidth()+"x"+temp.getHeight()); } }catch (Exception e){ throw new GroupDocsSignatureException(e.getMessage()); } ``` ## More resources ### GitHub Examples  You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online App  Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online **[GroupDocs Signature App](https://products.groupdocs.app/signature)**. --- ## Update Barcode Signatures in Document Path: /signature/python-net/update-barcode-signatures-in-document/ [**GroupDocs.Signature for Python via .NET**](https://products.groupdocs.com/signature/python-net) provides functionality to manipulate barcode signatures' location, size, and textual content. Please note that the [update](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/update/) method modifies the same document that was passed to the constructor of the [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class. ### Here are the steps to update a Barcode signature in a document with GroupDocs.Signature: * Create a new instance of the [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) class and pass the source document path as a constructor parameter * Instantiate the [BarcodeSearchOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesearchoptions) object with desired properties * Call the [search](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/search) method to obtain a list of barcode signatures * Select from the list the [BarcodeSignature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.domain/barcodesignature) object(s) that should be updated * Call the [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature) object's [update](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/update/) method and pass one or several signatures to it This example shows how to update a Barcode signature that was found using the [search](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/search) method: ```python import groupdocs.signature as signature from groupdocs.signature.options import BarcodeSearchOptions # Initialize signature with signature.Signature("sample_signed.pdf") as sign: # Create search options options = BarcodeSearchOptions() # Search for barcode signatures in document signatures = sign.search(options) if len(signatures) > 0: # Get first barcode signature barcode_signature = signatures[0] # Change position barcode_signature.left = 100 barcode_signature.top = 100 # Update the signature result = sign.update(barcode_signature) if result.updated_count > 0: print(f"Signature with barcode '{barcode_signature.text}' was updated!") else: print("Signature was not updated in the document!") ``` ## More Resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for Python via .NET examples](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Python-via-.NET) ### Free Online Apps Along with the full-featured Python library, we provide simple but powerful free online apps. To generate barcodes and/or sign your files with barcodes for free, you can use the [Barcode Generator](https://products.groupdocs.app/signature/generate/barcode) online app. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the other online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Search for Barcode e-signatures Path: /signature/java/search-for-barcode-e-signatures/ [GroupDocs.Signature](https://products.groupdocs.com/signature/java) provides an easy and straightforward way to find all Barcode signatures that are present in a document. For the most simpler use case - just find all Barcode signatures within document its only needed to instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.search/BarcodeSearchOptions) class and pass it to [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) method. Here are the exact steps to search for Barcode signatures within the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class and pass source document path as a constructor parameter. * Instantiate the [BarcodeSearchOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.search/BarcodeSearchOptions) object according to your requirements and specify search options * Call [search](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature#search(java.lang.Class,%20com.groupdocs.signature.options.search.SearchOptions)) method of [Signature](https://reference.groupdocs.com/java/signature/com.groupdocs.signature/Signature) class instance and pass [BarcodeSearchOptions](https://reference.groupdocs.com/java/signature/com.groupdocs.signature.options.search/BarcodeSearchOptions) to it. This example shows how to search for Barcode signature in the document. ```java Signature signature = new Signature("sample.pdf"); BarcodeSearchOptions options = new BarcodeSearchOptions(); // search for signatures in document List signatures = signature.search(BarcodeSignature.class, options); System.out.print("\nSource document contains following signatures."); for (BarcodeSignature barcodeSignature : signatures) { System.out.print("Barcode signature found at page "+barcodeSignature.getPageNumber()+" with type "+barcodeSignature.getEncodeType()+" and text "+ barcodeSignature.getText()); } ``` ## More resources ### Advanced Usage Topics To learn more about document eSign features, please refer to the [advanced usage section]({{< ref "signature/java/developer-guide/advanced-usage/_index.md" >}}). ### GitHub Examples  You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online App  Along with full-featured .NET library we provide simple, but powerful free Apps. You are welcome to eSign PDF, Word, Excel, PowerPoint documents with free to use online **[GroupDocs Signature App](https://products.groupdocs.app/signature)**. --- ## Search for Barcode e-signatures Path: /signature/net/search-for-barcode-e-signatures/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/net) provides an easy and straightforward way to find all Barcode signatures that are present in a document. For the most simpler use case - just find all Barcode signatures within document its only needed to instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) class and pass it to [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method. Here are the exact steps to search for Barcode signatures within the document with GroupDocs.Signature: * Create new instance of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class and pass source document path as a constructor parameter. * Instantiate the [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) object according to your requirements and specify search options * Call [Search](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature/search) method of [Signature](https://reference.groupdocs.com/signature/net/groupdocs.signature/signature) class instance and pass [BarcodeSearchOptions](https://reference.groupdocs.com/signature/net/groupdocs.signature.options/barcodesearchoptions) to it. This example shows how to search for Barcode signature in the document. ```csharp using (Signature signature = new Signature("sample.pdf")) { // search for signatures in document List signatures = signature.Search(SignatureType.Barcode); Console.WriteLine("\nSource document contains following signatures."); foreach (var barcodeSignature in signatures) { Console.WriteLine("Barcode signature found at page {0} with type {1} and text {2}", barcodeSignature.PageNumber, barcodeSignature.EncodeType, barcodeSignature.Text); } } ``` ### Advanced Usage Topics To learn more about document eSign features, please refer to the [advanced usage section]({{< ref "signature/net/developer-guide/advanced-usage/_index.md" >}}). ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Search for Barcode e-signatures Path: /signature/nodejs-java/search-for-barcode-e-signatures/ [**GroupDocs.Signature**](https://products.groupdocs.com/signature/nodejs-java) provides an easy and straightforward way to find all Barcode signatures that are present in a document. For the simpler use case - just find all Barcode signatures within document its only needed to instantiate [BarcodeSearchOptions](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search) class and pass it to [Search](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search) method. Here are the exact steps to search for Barcode signatures within the document with GroupDocs.Signature: * Create a new instance of the [Signature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature) class and pass the source document path as a constructor parameter. * Instantiate the [BarcodeSearchOptions](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search) object according to your requirements and specify search options. * Call the [Search](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search) method of the [Signature](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature) class instance and pass the [BarcodeSearchOptions](https://reference.groupdocs.com/signature/nodejs-java/com.groupdocs.signature/signature/#search) to it. This example shows how to search for Barcode signature in the document. ```javascript // The path to the documents directory. const filePath = Constants.SAMPLE_SIGNED_MULTI; const signature = new signatureLib.Signature(filePath); const options = new signatureLib.BarcodeSearchOptions(); options.setAllPages(true); // this value is set by default // Search for signatures in the document const signatures = signature.search(signatureLib.BarcodeSignature.class, options).toArray(); console.log('\nSource document contains the following signatures.'); for (const barcodeSignature of signatures) { console.log(`Barcode signature found at page ${barcodeSignature.getPageNumber()} with type ${barcodeSignature.getEncodeType()} and text ${barcodeSignature.getText()}`); } ``` ## More resources ### GitHub Examples You may easily run the code above and see the feature in action in our GitHub examples: * [GroupDocs.Signature for .NET examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET) * [GroupDocs.Signature for Java examples, plugins, and showcase](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java) * [Document Signature for .NET MVC UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-MVC) * [Document Signature for .NET App WebForms UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET-WebForms) * [Document Signature for Java App Dropwizard UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Dropwizard) * [Document Signature for Java Spring UI Example](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Java-Spring) ### Free Online Apps Along with the full-featured .NET library, we provide simple but powerful free online apps. To sign PDF, Word, Excel, PowerPoint, and other documents you can use the online apps from the **[GroupDocs.Signature App Product Family](https://products.groupdocs.app/signature/family)**. --- ## Search for Barcode e-Signatures Path: /signature/python-net/search-for-barcode-e-signatures/ [GroupDocs.Signature](https://products.groupdocs.com/signature/python-net) provides the ability to search for barcode signatures in documents. Barcode signatures can be used to store various types of information in a compact format. ## What is a Barcode Signature? A barcode signature is a visual representation of data that can be scanned and read by machines. It typically consists of parallel black lines and white spaces of varying widths. Barcodes are commonly used for: - Product identification - Inventory tracking - Document verification - Data encoding ## How to Search for Barcode Signatures The [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/) class provides the [Search](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/search/) method which allows you to search for barcode signatures in documents. Here's how to use it: 1. Create a new instance of the [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/) class and pass the source document path as a parameter. 2. Instantiate the [BarcodeSearchOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesearchoptions/) object with the required options. 3. Call the [Search](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/search/) method of the [Signature](https://reference.groupdocs.com/signature/python-net/groupdocs.signature/signature/) class instance and pass the [BarcodeSearchOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesearchoptions/) to it. 4. Process the search results. Here's an example of how to search for barcode signatures in a document: {{< tabs "example-1" >}} {{< tab "Python" >}} ```python from groupdocs.signature import Signature from groupdocs.signature.options import BarcodeSearchOptions from groupdocs.signature.domain import BarcodeSignature # Initialize Signature with input document with Signature("sample.pdf") as signature: # Create search options options = BarcodeSearchOptions() # Search for signatures result = signature.search(options) print(f"Found {len(result)} signatures") # Process found signatures for barcode_signature in result: print(f"Barcode type: {barcode_signature.barcode_type}") print(f"Barcode text: {barcode_signature.text}") print(f"Page number: {barcode_signature.page_number}") print(f"Position: X={barcode_signature.left}, Y={barcode_signature.top}") print(f"Size: Width={barcode_signature.width}, Height={barcode_signature.height}") ``` {{< /tab >}} {{< tab "sample.pdf" >}} {{< tab-text >}} The following sample file is used in this example: [sample.pdf](/signature/python-net/_sample_files/developer-guide/basic-usage/search-for-electronic-signatures-in-document/search-for-barcode-e-signatures/sample.pdf) {{< /tab-text >}} {{< /tab >}} {{< /tabs >}} ## Advanced Search Options The [BarcodeSearchOptions](https://reference.groupdocs.com/signature/python-net/groupdocs.signature.options/barcodesearchoptions/) class provides various properties to customize the search process: {{< tabs "example-2" >}} {{< tab "Python" >}} ```python from groupdocs.signature import Signature from groupdocs.signature.options import BarcodeSearchOptions from groupdocs.signature.domain import BarcodeSignature # Initialize Signature with input document with Signature("sample.pdf") as signature: # Create search options options = BarcodeSearchOptions() # Specify pages to search options.pages = [1, 2] # Search only on pages 1 and 2 # Specify barcode types to search for options.barcode_type = "Code128" # Search only for Code128 barcodes # Search for signatures result = signature.search(options) print(f"Found {len(result)} signatures") # Process found signatures for barcode_signature in result: print(f"Barcode type: {barcode_signature.barcode_type}") print(f"Barcode text: {barcode_signature.text}") print(f"Page number: {barcode_signature.page_number}") print(f"Position: X={barcode_signature.left}, Y={barcode_signature.top}") print(f"Size: Width={barcode_signature.width}, Height={barcode_signature.height}") ``` {{< /tab >}} {{< tab "sample.pdf" >}} {{< tab-text >}} The following sample file is used in this example: [sample.pdf](/signature/python-net/_sample_files/developer-guide/basic-usage/search-for-electronic-signatures-in-document/search-for-barcode-e-signatures/sample.pdf) {{< /tab-text >}} {{< /tab >}} {{< /tabs >}} ## Additional Resources ### GitHub Examples You may easily run the code above and see the feature in action in our examples: * [GroupDocs.Signature for Python via .NET Examples](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Python-via-.NET) * [GroupDocs.Signature for Python via .NET Plugins](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Python-via-.NET-Plugins) * [GroupDocs.Signature for Python via .NET Showcase Apps](https://github.com/groupdocs-signature/GroupDocs.Signature-for-Python-via-.NET-Showcase) ### Free Online Apps Along with full Python library we provide simple but powerful free Apps. You are welcome to search for barcode signatures in documents with our free online apps: * [Search for Barcode Signatures Online](https://products.groupdocs.app/signature/family) --- ## 5 Secure Methods to Add Watermarks to Word Documents Path: /watermark/net/secure-methods-add-watermark-to-word/ ## Overview Microsoft Word's built-in watermark feature provides minimal document protection—anyone can remove standard watermarks by double-clicking the header and pressing delete. This guide demonstrates **five professional watermarking methods** using GroupDocs.Watermark for .NET, ranging from basic header watermarks to advanced password-protected solutions that resist removal attempts. **What you'll learn:** - Why standard Word watermarks fail to protect sensitive documents - How to implement 5 increasingly secure watermarking techniques with code examples - When to use each protection level based on your security requirements - Visual demonstrations of each method's effectiveness ## Why Word's Built-in Watermarks Aren't Secure Standard Microsoft Word watermarks have a critical security flaw: they're stored as simple shape objects in document headers. Any user can: 1. Double-click the header area to enter edit mode 2. Select the watermark shape 3. Press Delete to remove it completely This makes built-in watermarks unsuitable for: - Confidential business documents - Legal contracts and agreements - Copyright-protected materials - Documents requiring compliance controls GroupDocs.Watermark for .NET solves this problem by providing programmatic watermarking with multiple protection levels. {{< alert style="info" >}} For the **complete working code** and detailed explanations, please refer to the [full repository here](https://github.com/groupdocs-watermark/protect-word-documents-using-groupdocs-watermark-dotnet/). {{< /alert >}} ## 📂 Repository Structure Protect-Word-Documents-using-GroupDocs.Watermark-for-.NET/ │ ├── GroupDocs.Watermark-for-.NET-Word-Protection-Sample.csproj # .NET 6 project file ├── Program.cs # Entry point: runs protection routines │ ├── AddSimpleHeaderWatermark # Basic watermark in header │ ├── AddTiledWatermark # Repeated tiled watermark │ ├── AddTiledImageWatermark # Repeated tiled image watermark │ ├── AddLockedSectionWatermark # Password-protected hidden section │ └── AddLockedHeaderWatermark # Locked header + editable content ├── Resources/ # Input/output test files(create | this folder where you need) └── README.md # This documentation ## Method 1: Simple Header Watermark **Protection Level:** Low | **Difficulty:** Easy | **Best For:** Internal documents, drafts This method inserts a watermark into the document header as a shape object. While easy to implement, it offers minimal protection and can be removed by editing the header. ### Implementation ```csharp private static void AddSimpleHeaderWatermark() { Console.WriteLine("Adding simple header watermark..."); var loadOptions = new WordProcessingLoadOptions(); using (var watermarker = new Watermarker(InputFile, loadOptions)) { var watermark = new TextWatermark("Confidential", new Font("Arial", 19)) { VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, RotateAngle = 25, ForegroundColor = Color.Red, Opacity = 0.8 }; watermarker.Add(watermark); watermarker.Save(Path.Combine(OutputDir, "header_watermark.docx")); } Console.WriteLine("Header watermark added."); } ``` **Watch how easily it's removed:** ![how-to](/watermark/net/images/use-cases/secure-methods-add-watermark-to-word/2_remove_text_watermark_in_header.gif) ### Security Considerations - **Vulnerability:** Can be deleted by double-clicking the header and selecting the watermark shape - **Use Case:** Quick internal documents where high security isn't required - **Advantage:** Simple to implement with minimal code ## Method 2: Tiled Watermarks **Protection Level:** Medium | **Difficulty:** Easy | **Best For:** Multi-page documents requiring moderate security Tiled watermarks create multiple instances across each page, making manual removal tedious and time-consuming. This method provides effective deterrence for documents longer than a few pages. ### Implementation ```csharp private static void AddTiledWatermark() { Console.WriteLine("Adding tiled watermark..."); var loadOptions = new WordProcessingLoadOptions(); using (var watermarker = new Watermarker(InputFile, loadOptions)) { var watermark = new TextWatermark("Protected Document", new Font("Arial", 19)) { VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, RotateAngle = 25, ForegroundColor = Color.Red, Opacity = 0.9, TileOptions = new TileOptions { LineSpacing = new MeasureValue { MeasureType = TileMeasureType.Percent, Value = 12 }, WatermarkSpacing = new MeasureValue { MeasureType = TileMeasureType.Percent, Value = 12 } } }; var options = new WordProcessingWatermarkSectionOptions { Name = "TiledShape", AlternativeText = "Repeated watermark" }; watermarker.Add(watermark, options); watermarker.Save(Path.Combine(OutputDir, "tiled_watermark.docx")); } Console.WriteLine("Tiled watermark added."); } ``` **See the tiled protection in action:** ![how-to](/watermark/net/images/use-cases/secure-methods-add-watermark-to-word/3_tiled_watermark.gif) ### Key Features - **Multiple Instances:** Creates 15-20+ watermark copies per page - **Spacing Control:** Customize `LineSpacing` and `WatermarkSpacing` as percentages - **Removal Deterrent:** Deleting all instances becomes impractical for multi-page documents - **Ideal For:** Contracts, proposals, client-facing documents ## Method 3: Image Tiled Watermarks **Protection Level:** Medium-High | **Difficulty:** Easy | **Best For:** Brand protection, copyright claims Image watermarks use company logos, signatures, or custom graphics instead of text. When tiled, they create a professional security layer that's harder to replicate than simple text. ### Implementation ```csharp private static void AddImageWatermark() { using (Watermarker watermarker = new Watermarker(InputFile)) { // Create the image watermark object var watermark = new ImageWatermark("logo.png"); // Configure tile options watermark.TileOptions = new TileOptions() { LineSpacing = new MeasureValue() { MeasureType = TileMeasureType.Percent, Value = 10 }, WatermarkSpacing = new MeasureValue() { MeasureType = TileMeasureType.Percent, Value = 8 }, }; // Set watermark properties watermark.Opacity = 0.7; watermark.RotateAngle = -30; // Add watermark watermarker.Add(watermark); watermarker.Save(Path.Combine(OutputDir, "image_watermark_word.docx")); } } ``` **See the professional image watermark in action:** ![how-to](/watermark/net/images/use-cases/secure-methods-add-watermark-to-word/3.1_tiled_image_watermark.gif) ### Security Advantages - **Unique Visual Elements:** Logos and graphics are harder to recreate than text - **Brand Authentication:** Company seals and official stamps establish document authenticity - **Supported Formats:** PNG, JPG, and other image formats - **Professional Appearance:** Maintains document aesthetics while providing protection ## Method 4: Password-Protected Hidden Section **Protection Level:** High | **Difficulty:** Medium | **Best For:** Confidential documents requiring strong security This advanced technique places the watermark in a password-protected section configured for "form fields only" mode. Users cannot edit or remove the watermark without the password. ### Implementation ```csharp private static void AddLockedWatermark_AllowOnlyFormFields() { Console.WriteLine("Adding locked watermark (allow form fields)..."); using (var watermarker = new Watermarker(InputFile)) { var watermark = new TextWatermark("Do Not Edit", new Font("Arial", 36, FontStyle.Bold | FontStyle.Italic)) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, Opacity = 0.4, RotateAngle = 45, ForegroundColor = Color.Red }; var options = new WordProcessingWatermarkPagesOptions { IsLocked = true, Password = "012345", LockType = WordProcessingLockType.AllowOnlyFormFields }; watermarker.Add(watermark, options); watermarker.Save(Path.Combine(OutputDir, "locked_allow_form_fields.docx")); } Console.WriteLine("Locked watermark added (AllowOnlyFormFields)."); } ``` **Watch the locked header protection:** ![how-to](/watermark/net/images/use-cases/secure-methods-add-watermark-to-word/4_allow_only_form_fields.gif) ### Configuration Options - **IsLocked:** Set to `true` to enable password protection - **Password:** Choose a strong password for document protection - **LockType:** Use `AllowOnlyFormFields` to restrict editing - **Use Case:** Legal documents, financial reports, intellectual property ### Important Considerations When using password-protected sections, the hidden section occupies space in the document structure. For documents that completely fill available space, this may cause layout issues such as extra blank pages. ## Method 5: Locked Header with Editable Content Ranges **Protection Level:** Very High | **Difficulty:** Medium | **Best For:** Documents requiring both security and user interaction This sophisticated approach locks the header section (containing the watermark) while allowing specific document areas to remain editable. It combines maximum watermark security with controlled user access. ### Implementation ```csharp private static void AddLockedHeaderWatermark() { Console.WriteLine("Adding locked header watermark..."); var loadOptions = new WordProcessingLoadOptions(); using (var watermarker = new Watermarker(InputFile, loadOptions)) { var watermark = new TextWatermark("Company Confidential", new Font("Arial", 19)) { VerticalAlignment = VerticalAlignment.Center, HorizontalAlignment = HorizontalAlignment.Center, RotateAngle = 25, ForegroundColor = Color.Red, Opacity = 0.8 }; var options = new WordProcessingWatermarkSectionOptions { SectionIndex = 0, IsLocked = true, Password = "012345", LockType = WordProcessingLockType.ReadOnly }; watermarker.Add(watermark, options); watermarker.Save(Path.Combine(OutputDir, "locked_header_watermark.docx")); } Console.WriteLine("Locked header watermark added."); } ``` **Watch the locked header protection:** ![how-to](/watermark/net/images/use-cases/secure-methods-add-watermark-to-word/5_watermark_locked_in_header.gif) ### How It Works 1. **Header Protection:** The entire header section is locked with read-only protection 2. **Password Security:** Requires authentication to modify the watermark 3. **Editable Ranges:** Document body sections can be marked as editable 4. **Granular Control:** Different users can be assigned different editing permissions ### Visual Trade-offs When documents with editable ranges are opened in Microsoft Word, editable sections appear highlighted in yellow. This visual indicator helps users identify where they can type, but may affect the document's professional appearance in some contexts. ### Ideal Applications - Template documents with fixed branding - Forms requiring user input - Collaborative documents with protected headers - Scenarios requiring granular editing permissions ## Choosing the Right Protection Method | Method | Protection Level | Difficulty | Best Use Case | Removal Difficulty | |--------|-----------------|------------|---------------|-------------------| | Simple Header | Low | Easy | Internal drafts | Very Easy | | Tiled Text | Medium | Easy | Multi-page proposals | Tedious | | Tiled Image | Medium-High | Easy | Brand protection | Difficult | | Password-Protected Section | High | Medium | Confidential documents | Very Difficult | | Locked Header + Editable Ranges | Very High | Medium | Templates & forms | Very Difficult | ## Common Questions **Q: Does adding watermarks increase file size?** A: Yes, but minimally. Simple header watermarks add negligible size. Tiled watermarks add more due to multiple shape objects, but the increase is typically under 5% for text watermarks. **Q: Can I watermark other file formats?** A: Yes. GroupDocs.Watermark for .NET supports 40+ file formats including PDF, Excel, PowerPoint, images, and more. **Q: Do I need Microsoft Word installed?** A: No. GroupDocs.Watermark is a standalone .NET library that works independently of Microsoft Office. **Q: Can users still print watermarked documents?** A: Yes. Watermarks remain visible in printed copies unless you configure them otherwise using opacity and visibility settings. **Q: How do I remove password protection for testing?** A: During development, use simple passwords like "012345" as shown in examples. For production, implement secure password management. ## Conclusion Microsoft Word's built-in watermarks are insufficient for documents requiring real security. GroupDocs.Watermark for .NET provides five progressively secure protection methods, from simple header watermarks for internal use to advanced password-protected solutions for confidential documents. Choose the protection level that matches your document's sensitivity: - Use **simple headers** for low-risk internal documents - Implement **tiled watermarks** for contracts and proposals - Apply **password protection** for confidential business documents - Deploy **locked headers with editable ranges** for templates and collaborative documents Not every file needs maximum security, but critical documents deserve more than Word's easily-removable watermarks. Start protecting your documents today with GroupDocs.Watermark for .NET. --- ## About Search Engines Path: /search/java/about-search-engines/ This page is about the classification of search engines and what place GroupDocs.Search API occupies in this classification. There are a large number of ways to classify search engines. Here are the main ones. According to the search area, search engines can conditionally be divided into 3 groups: * Global. Global search engines are designed to search for information throughout the Internet or a significant part of it. * Local. Local search engines are designed to search for information on any part of the global network, for example, one or more sites, or on a local network. Such search engines are usually used inside private (corporate) networks or in e-commerce systems (online stores). * Personal. Personal search engines are used to search among files on personal computers or in small local networks. According to the data source, search engines are divided into the following groups: * Desktop search engines. Desktop search tools search for information on a user's PC, including web browser history, email archives, text documents, sound files, images, and videos. * Federated search engines. Federated search is an information retrieval technology that allows user to simultaneously search multiple search resources of different types. The user makes one request, which applies to databases, indexes, or other search engines participating in the federation. The search results are then combined to present to the user. Federated search is used, for example, to integrate disparate information resources within one large organization. * Human search engines. The human search engine is a search engine that uses human participation to filter search results and help users refine their search query. The goal is to provide users with a limited number of relevant results, in contrast to traditional search engines, which often return many results, which may or may not be relevant. * Metasearch engines. Metasearch engine is a tool for searching information on the Internet, which uses search results of web search engines to get its own results. Metasearch engines receive data from a user and immediately makes requests to search engines. Received results are handled and presented to users. * Web search engines. Web search engine is a software system designed to search on the Internet. Search results are usually presented as a set of links to web pages, images, videos, infographics, articles, and other types of files. By type of content, search engines are divided into: * Full text search engines. Full-text search means searching for one or more documents in a full-text database. Each of these documents is a separate file in some format. Full-text search is different from searching by metadata or by parts of original texts presented in databases (such as titles, annotations, individual sections or bibliographic references) and is usually performed across the entire content of each indexed document. * Image search engines. The image search engine is a computer system for viewing, searching and retrieving images from a large database of digital images. To be able to search for images, some metadata are added to images specified manually or using image recognition systems. * Video search engines. Video search engines are computer programs designed to search for videos stored on digital devices. The search is be performed in indexed metadata that is automatically produced from audiovisual material. By type of interaction interface, search engines are divided into: * Normal search. Normal search involves entering a search query and subsequent retrieval of search results as a list. * Incremental search. Incremental search is a type of search interface, which is characterized by the provision of search results to the user in the process of typing a search query. The user can also choose the option of ending his search query from the proposed list. * Semantic search. Semantic search refers to search with meaning, in contrast to lexical search, where the search engine searches for literal matches of words or their variants, without understanding the general meaning of the query. * Selection-based search. A selection-based search system is a search engine in which a user makes a search query by selecting from the proposed options. * Voice search. Voice search is an interface that allows users to enter search queries by speaking them into the microphone of a digital device. Database management systems are also search engines, because they always have facilities for indexing data and performing searches on them. Various databases differ in the way data is stored and the types of indexes created: * Relational database management system. A relational database is a digital database based on the relational or table-oriented model of data. * Document store. A document-oriented database is a computer program designed to store, retrieve and manage document-oriented information, also known as semi-structured data. * Key-value store. A key-value database is a data storage paradigm for storing, retrieving, and managing associative arrays, as well as a data structure, better known today as a dictionary or hash table. * Graph database management system. A graph database is a database that uses graph structures for semantic queries with nodes, edges, and properties to represent and store data. * Object database management system. An object database is a database in which information is represented in the form of objects as used in object-oriented programming. * Multi-model database management system. A multi-model database management system is a DBMS that provides the ability to store and work with data using various paradigms. In accordance with the above types of classification, GroupDocs.Search API refers to the following types of search engines: * By search area – personal or corporate (local) full-text search engine. * By data source – desktop or federated full-text search index. * By type of content – full-text search database, image search engine (reverse image search, OCR). In addition, the API can also extract metadata from image and video files, as well as add arbitrary optional fields to any indexed documents. * By the type of interaction interface – normal with the ability to retrieve results by chunks. * By type of index – nosql document store database. --- ## About Search Engines Path: /search/net/about-search-engines/ This page is about the classification of search engines and what place GroupDocs.Search API occupies in this classification. There are a large number of ways to classify search engines. Here are the main ones. According to the search area, search engines can conditionally be divided into 3 groups: * Global. Global search engines are designed to search for information throughout the Internet or a significant part of it. * Local. Local search engines are designed to search for information on any part of the global network, for example, one or more sites, or on a local network. Such search engines are usually used inside private (corporate) networks or in e-commerce systems (online stores). * Personal. Personal search engines are used to search among files on personal computers or in small local networks. According to the data source, search engines are divided into the following groups: * Desktop search engines. Desktop search tools search for information on a user's PC, including web browser history, email archives, text documents, sound files, images, and videos. * Federated search engines. Federated search is an information retrieval technology that allows user to simultaneously search multiple search resources of different types. The user makes one request, which applies to databases, indexes, or other search engines participating in the federation. The search results are then combined to present to the user. Federated search is used, for example, to integrate disparate information resources within one large organization. * Human search engines. The human search engine is a search engine that uses human participation to filter search results and help users refine their search query. The goal is to provide users with a limited number of relevant results, in contrast to traditional search engines, which often return many results, which may or may not be relevant. * Metasearch engines. Metasearch engine is a tool for searching information on the Internet, which uses search results of web search engines to get its own results. Metasearch engines receive data from a user and immediately makes requests to search engines. Received results are handled and presented to users. * Web search engines. Web search engine is a software system designed to search on the Internet. Search results are usually presented as a set of links to web pages, images, videos, infographics, articles, and other types of files. By type of content, search engines are divided into: * Full text search engines. Full-text search means searching for one or more documents in a full-text database. Each of these documents is a separate file in some format. Full-text search is different from searching by metadata or by parts of original texts presented in databases (such as titles, annotations, individual sections or bibliographic references) and is usually performed across the entire content of each indexed document. * Image search engines. The image search engine is a computer system for viewing, searching and retrieving images from a large database of digital images. To be able to search for images, some metadata are added to images specified manually or using image recognition systems. * Video search engines. Video search engines are computer programs designed to search for videos stored on digital devices. The search is be performed in indexed metadata that is automatically produced from audiovisual material. By type of interaction interface, search engines are divided into: * Normal search. Normal search involves entering a search query and subsequent retrieval of search results as a list. * Incremental search. Incremental search is a type of search interface, which is characterized by the provision of search results to the user in the process of typing a search query. The user can also choose the option of ending his search query from the proposed list. * Semantic search. Semantic search refers to search with meaning, in contrast to lexical search, where the search engine searches for literal matches of words or their variants, without understanding the general meaning of the query. * Selection-based search. A selection-based search system is a search engine in which a user makes a search query by selecting from the proposed options. * Voice search. Voice search is an interface that allows users to enter search queries by speaking them into the microphone of a digital device. Database management systems are also search engines, because they always have facilities for indexing data and performing searches on them. Various databases differ in the way data is stored and the types of indexes created: * Relational database management system. A relational database is a digital database based on the relational or table-oriented model of data. * Document store. A document-oriented database is a computer program designed to store, retrieve and manage document-oriented information, also known as semi-structured data. * Key-value store. A key-value database is a data storage paradigm for storing, retrieving, and managing associative arrays, as well as a data structure, better known today as a dictionary or hash table. * Graph database management system. A graph database is a database that uses graph structures for semantic queries with nodes, edges, and properties to represent and store data. * Object database management system. An object database is a database in which information is represented in the form of objects as used in object-oriented programming. * Multi-model database management system. A multi-model database management system is a DBMS that provides the ability to store and work with data using various paradigms. In accordance with the above types of classification, GroupDocs.Search API refers to the following types of search engines: * By search area – personal or corporate (local) full-text search engine. * By data source – desktop or federated full-text search index. * By type of content – full-text search database, image search engine (reverse image search, OCR). In addition, the API can also extract metadata from image and video files, as well as add arbitrary optional fields to any indexed documents. * By the type of interaction interface – normal with the ability to retrieve results by chunks. * By type of index – nosql document store database. --- ## About Search Engines Path: /search/nodejs-java/about-search-engines/ This page is about the classification of search engines and what place GroupDocs.Search API occupies in this classification. There are a large number of ways to classify search engines. Here are the main ones. According to the search area, search engines can conditionally be divided into 3 groups: * Global. Global search engines are designed to search for information throughout the Internet or a significant part of it. * Local. Local search engines are designed to search for information on any part of the global network, for example, one or more sites, or on a local network. Such search engines are usually used inside private (corporate) networks or in e-commerce systems (online stores). * Personal. Personal search engines are used to search among files on personal computers or in small local networks. According to the data source, search engines are divided into the following groups: * Desktop search engines. Desktop search tools search for information on a user's PC, including web browser history, email archives, text documents, sound files, images, and videos. * Federated search engines. Federated search is an information retrieval technology that allows user to simultaneously search multiple search resources of different types. The user makes one request, which applies to databases, indexes, or other search engines participating in the federation. The search results are then combined to present to the user. Federated search is used, for example, to integrate disparate information resources within one large organization. * Human search engines. The human search engine is a search engine that uses human participation to filter search results and help users refine their search query. The goal is to provide users with a limited number of relevant results, in contrast to traditional search engines, which often return many results, which may or may not be relevant. * Metasearch engines. Metasearch engine is a tool for searching information on the Internet, which uses search results of web search engines to get its own results. Metasearch engines receive data from a user and immediately makes requests to search engines. Received results are handled and presented to users. * Web search engines. Web search engine is a software system designed to search on the Internet. Search results are usually presented as a set of links to web pages, images, videos, infographics, articles, and other types of files. By type of content, search engines are divided into: * Full text search engines. Full-text search means searching for one or more documents in a full-text database. Each of these documents is a separate file in some format. Full-text search is different from searching by metadata or by parts of original texts presented in databases (such as titles, annotations, individual sections or bibliographic references) and is usually performed across the entire content of each indexed document. * Image search engines. The image search engine is a computer system for viewing, searching and retrieving images from a large database of digital images. To be able to search for images, some metadata are added to images specified manually or using image recognition systems. * Video search engines. Video search engines are computer programs designed to search for videos stored on digital devices. The search is be performed in indexed metadata that is automatically produced from audiovisual material. By type of interaction interface, search engines are divided into: * Normal search. Normal search involves entering a search query and subsequent retrieval of search results as a list. * Incremental search. Incremental search is a type of search interface, which is characterized by the provision of search results to the user in the process of typing a search query. The user can also choose the option of ending his search query from the proposed list. * Semantic search. Semantic search refers to search with meaning, in contrast to lexical search, where the search engine searches for literal matches of words or their variants, without understanding the general meaning of the query. * Selection-based search. A selection-based search system is a search engine in which a user makes a search query by selecting from the proposed options. * Voice search. Voice search is an interface that allows users to enter search queries by speaking them into the microphone of a digital device. Database management systems are also search engines, because they always have facilities for indexing data and performing searches on them. Various databases differ in the way data is stored and the types of indexes created: * Relational database management system. A relational database is a digital database based on the relational or table-oriented model of data. * Document store. A document-oriented database is a computer program designed to store, retrieve and manage document-oriented information, also known as semi-structured data. * Key-value store. A key-value database is a data storage paradigm for storing, retrieving, and managing associative arrays, as well as a data structure, better known today as a dictionary or hash table. * Graph database management system. A graph database is a database that uses graph structures for semantic queries with nodes, edges, and properties to represent and store data. * Object database management system. An object database is a database in which information is represented in the form of objects as used in object-oriented programming. * Multi-model database management system. A multi-model database management system is a DBMS that provides the ability to store and work with data using various paradigms. In accordance with the above types of classification, GroupDocs.Search API refers to the following types of search engines: * By search area – personal or corporate (local) full-text search engine. * By data source – desktop or federated full-text search index. * By type of content – full-text search database, image search engine (reverse image search, OCR). In addition, the API can also extract metadata from image and video files, as well as add arbitrary optional fields to any indexed documents. * By the type of interaction interface – normal with the ability to retrieve results by chunks. * By type of index – nosql document store database. --- ## Accept or reject detected changes Path: /comparison/python-net/accept-or-reject-detected-changes/ [GroupDocs.Comparison for Python via .NET](https://products.groupdocs.com/comparison/python-net) lets you programmatically accept or reject individual changes before producing the final result. ## Accept or reject changes (files on disk) Compare files, update change actions, and apply them to the output. ```python import groupdocs.comparison as gc with gc.Comparer("source.docx") as comparer: comparer.add("target.docx") comparer.compare() changes = comparer.get_changes() # Example: reject the first change if changes: changes[0].comparison_action = gc.ComparisonAction.REJECT with open("result.docx", "wb") as out_stream: comparer.apply_changes(out_stream, gc.ApplyChangeOptions(changes=changes)) ``` 🔹 Use case: Remove undesired edits from the final deliverable while keeping approved changes. The result is as follows: | Accepted changes | Rejected changes | | :-----------------------------------------------------------------: | :----------------------------------------------------------------: | | ![](/comparison/python-net/images/accepted-changes.png) | ![](/comparison/python-net/images/rejected-changes.png) | ## Accept or reject changes (streams) Work entirely with streams and persist the merged result. ```python import groupdocs.comparison as gc with open("source.docx", "rb") as src, open("target.docx", "rb") as tgt: with gc.Comparer(src) as comparer: comparer.add(tgt) comparer.compare() changes = comparer.get_changes() if changes: changes[0].comparison_action = gc.ComparisonAction.REJECT with open("result.docx", "wb") as out_stream: comparer.apply_changes(out_stream, gc.ApplyChangeOptions(changes=changes)) ``` 🔹 Use case: Integrate approval workflows in services that don’t use local file paths. --- ## Accept or Reject detected changes Path: /comparison/java/accept-or-reject-detected-changes/ [GroupDocs.Comparison](https://products.groupdocs.com/comparison/java) allows you to apply or discard specific changes between source and target documents and save output document with (or without) selected changes. To apply/reject changes to output document, follow these steps: 1. Instantiate the [Comparer](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer) object. Specify the source document path or stream. 2. Call the [add()](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/#add-java.lang.String-) method. Specify the target document path or stream. 3. Call the [compare()](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/#compare-java.lang.String-) method. 4. Call the [getChanges()](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/#getChanges--) method to get changes list. 5. Call the [setComparisonAction()](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison.result/changeinfo/#setComparisonAction-com.groupdocs.comparison.result.ComparisonAction-) method of the appropriate change object. Specify the [ComparisonAction.ACCEPT](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison.result/comparisonaction#ACCEPT) or the [ComparisonAction.REJECT](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison.result/comparisonaction#REJECT) value. 6. Call the [applyChanges()](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison/comparer/#applyChanges-java.lang.String-com.groupdocs.comparison.options.save.SaveOptions-com.groupdocs.comparison.options.ApplyChangeOptions-) method. Specify the collection of changes. The [ApplyChangeOptions](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison.options/applychangeoptions/) class includes the following properties: - [getChanges](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison.options/applychangeoptions/#getChanges--) is a list of changes that must be applied (or not) to the output document - [isSaveOriginalState](https://reference.groupdocs.com/comparison/java/com.groupdocs.comparison.options/applychangeoptions/#isSaveOriginalState--) is an option to reep the original state of the compared result after applying changes The following code snippets show how to accept/reject changes: ## Accept or Reject changes for documents stored at local disk {{< tabs "example1">}} {{< tab "Java" >}} ```java import com.groupdocs.comparison.Comparer; import com.groupdocs.comparison.options.ApplyChangeOptions; import com.groupdocs.comparison.options.save.SaveOptions; import com.groupdocs.comparison.result.ChangeInfo; import com.groupdocs.comparison.result.ComparisonAction; import java.nio.file.Path; // ... try (Comparer comparer = new Comparer("source.docx")) { comparer.add("target.docx"); final Path resultPath = comparer.compare(); ChangeInfo[] changes = comparer.getChanges(); changes[0].setComparisonAction(ComparisonAction.REJECT); comparer.applyChanges("result.docx", new SaveOptions(), new ApplyChangeOptions(changes)); } ``` {{< /tab >}} {{< /tabs >}} The result is as follows: | Accepted changes | Rejected changes | | :-----------------------------------------------------------------: | :----------------------------------------------------------------: | | ![](/comparison/java/images/accepted-changes.png) | ![](/comparison/java/images/rejected-changes.png) | ## Accept or reject changes for documents provided as a stream {{< tabs "example2">}} {{< tab "Java" >}} ```java import com.groupdocs.comparison.Comparer; import com.groupdocs.comparison.options.ApplyChangeOptions; import com.groupdocs.comparison.options.CompareOptions; import com.groupdocs.comparison.options.save.SaveOptions; import com.groupdocs.comparison.result.ChangeInfo; import com.groupdocs.comparison.result.ComparisonAction; import java.nio.file.Path; import java.io.FileInputStream; import java.io.InputStream; import java.io.FileOutputStream; import java.io.OutputStream; // ... try (Comparer comparer = new Comparer(sourceInputStream)) { comparer.add(targetInputStream); final Path resultPath = comparer.compare(new SaveOptions(), new CompareOptions()); ChangeInfo[] changes = comparer.getChanges(); changes[0].setComparisonAction(ComparisonAction.REJECT); comparer.applyChanges(resultOutputStream, new ApplyChangeOptions(changes)); } ``` {{< /tab >}} {{< /tabs >}} ## Accept or reject detected changes using SaveOriginalState option {{< tabs "example3">}} {{< tab "Java" >}} ```java import com.groupdocs.comparison.Comparer; import com.groupdocs.comparison.options.ApplyChangeOptions; import com.groupdocs.comparison.result.ChangeInfo; import com.groupdocs.comparison.result.ComparisonAction; import java.nio.file.Path; // ... try (Comparer comparer = new Comparer("source.docx")) { comparer.add("target.docx"); final Path resultPath = comparer.compare(); ChangeInfo[] changes = comparer.getChanges(); changes[0].setComparisonAction(ComparisonAction.REJECT); ApplyChangeOptions changeOptions = new ApplyChangeOptions(); changeOptions.setChanges(changes); changeOptions.setSaveOriginalState(true); comparer.applyChanges(resultFileWithRejectedChange, changeOptions); changes = comparer.getChanges(); changes[0].setComparisonAction(ComparisonAction.ACCEPT); comparer.applyChanges(resultFileWithAcceptedChange, new ApplyChangeOptions(changes)); } ``` {{< /tab >}} {{< /tabs >}} --- ## Accept or Reject detected changes Path: /comparison/net/accept-or-reject-detected-changes/ [GroupDocs.Comparison](https://products.groupdocs.com/comparison/net) allows you to apply or discard specific changes between source and target documents and save output document with (or without) selected changes. To apply/reject changes to output document, follow these steps: 1. Instantiate the [Comparer](https://reference.groupdocs.com/net/comparison/groupdocs.comparison/comparer) object. Specify the source document path or stream. 2. Call the [Add](https://reference.groupdocs.com/net/comparison/groupdocs.comparison/comparer/methods/add/index) method. Specify the target document path or stream. 3. Call the [Compare](https://reference.groupdocs.com/net/comparison/groupdocs.comparison/comparer/methods/compare/index) method. 4. Call the [GetChanges](https://reference.groupdocs.com/net/comparison/groupdocs.comparison/comparer/methods/getchanges/index) method to get changes list. 5. Set the [ComparisonAction](https://reference.groupdocs.com/net/comparison/groupdocs.comparison.result/changeinfo/properties/comparisonaction) of the appropriate change object to the [ComparisonAction.Accept](https://reference.groupdocs.com/net/comparison/groupdocs.comparison.result/comparisonaction) or [ComparisonAction.Reject](https://reference.groupdocs.com/net/comparison/groupdocs.comparison.result/comparisonaction) value. 6. Call the [ApplyChanges](https://reference.groupdocs.com/net/comparison/groupdocs.comparison/comparer/methods/applychanges/index) method. Specify the collection of changes. [ApplyChangeOptions](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.options/applychangeoptions) class includes the following properties: - [Changes](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.options/applychangeoptions/properties/changes) is a list of changes that must be applied (or not) to the output document - [SaveOriginalState](https://reference.groupdocs.com/comparison/net/groupdocs.comparison.options/applychangeoptions/properties/saveoriginalstate) is an option to reep the original state of the compared result after applying changes The following code snippets show how to accept/reject changes: ## Accept or Reject changes for documents stored at local disk {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using GroupDocs.Comparison; using GroupDocs.Comparison.Options; using GroupDocs.Comparison.Result; using System.IO; // ... using (Comparer comparer = new Comparer("source.docx")) { comparer.Add("target.docx"); comparer.Compare(); ChangeInfo[] changes = comparer.GetChanges(); changes[0].ComparisonAction = ComparisonAction.Reject; comparer.ApplyChanges(File.Create("result.docx"), new SaveOptions(), new ApplyChangeOptions() { Changes = changes }); } ``` {{< /tab >}} {{< /tabs >}} The result is as follows: | Accepted changes | Rejected changes | | :-----------------------------------------------------------------: | :----------------------------------------------------------------: | | ![](/comparison/net/images/accepted-changes.png) | ![](/comparison/net/images/rejected-changes.png) | ## Accept or reject changes for documents provided as a stream {{< tabs "example2">}} {{< tab "C#" >}} ```csharp using GroupDocs.Comparison; using GroupDocs.Comparison.Options; using GroupDocs.Comparison.Result; using System.IO; // ... using (Comparer comparer = new Comparer(File.OpenRead("source.docx"))) { comparer.Add(File.OpenRead("target.docx")); comparer.Compare(new SaveOptions(), new CompareOptions()); ChangeInfo[] changes = comparer.GetChanges(new GetChangeOptions()); changes[0].ComparisonAction = ComparisonAction.Reject; comparer.ApplyChanges(File.Create("result.docx"), new SaveOptions(), new ApplyChangeOptions() { Changes = changes }); } ``` {{< /tab >}} {{< /tabs >}} ## Accept or reject detected changes using SaveOriginalState option {{< tabs "example3">}} {{< tab "C#" >}} ```csharp using GroupDocs.Comparison; using GroupDocs.Comparison.Options; using GroupDocs.Comparison.Result; using System.IO; // ... using (Comparer comparer = new Comparer("source.docx")) { comparer.Add("target.docx"); comparer.Compare(); ChangeInfo[] changes = comparer.GetChanges(); changes[0].ComparisonAction = ComparisonAction.Reject; comparer.ApplyChanges("resultWithRejectedChange.docx", new ApplyChangeOptions() { Changes = changes, SaveOriginalState = true }); changes = comparer.GetChanges(); changes[0].ComparisonAction = ComparisonAction.Accept; comparer.ApplyChanges("resultWithAcceptedChange.docx", new ApplyChangeOptions() { Changes = changes }); } ``` {{< /tab >}} {{< /tabs >}} --- ## Accept or Reject detected changes Path: /comparison/nodejs-java/accept-or-reject-detected-changes/ [GroupDocs.Comparison](https://products.groupdocs.com/comparison/nodejs-java) allows you to apply or discard specific changes between the source and target documents and save the output document with (or without) the selected changes. The `ApplyChangeOptions` class includes the following properties: - `getChanges` is a list of changes that must be applied (or not) to the output document - `isSaveOriginalState` is an option to keep the original state of the compared result after applying changes The following code snippets show how to accept/reject changes: ## Accept or Reject changes for documents stored on a local disk The following example compares two DOCX files from disk, rejects the first detected change, and saves an updated result document. ```javascript 'use strict'; // Import GroupDocs.Comparison for Node.js via Java SDK const groupdocs = require('@groupdocs/groupdocs.comparison'); // Load Java integration and import utility class for working with Java collections const java = require('java'); let Arrays = java.import('java.util.Arrays'); // Define file paths for source, target, and result documents const sourceFile = 'sample-files/source.docx'; const targetFile = 'sample-files/target.docx'; const resultFile = 'result.docx'; // Initialize the comparer with the source document const comparer = new groupdocs.Comparer(sourceFile); // Add the target document to be compared against the source comparer.add(targetFile); // Perform the comparison operation (changes are detected but not yet applied) comparer.compare(); // Retrieve the list of detected changes (array of ChangeInfo objects) let changes = comparer.getChanges(); // Mark the first change in the list as rejected changes[0].setComparisonAction(groupdocs.ComparisonAction.REJECT); // Create options for applying changes const applyChangeOptions = new groupdocs.ApplyChangeOptions(); // Specify the changes to apply by wrapping the JavaScript array with Arrays.asList applyChangeOptions.setChanges(Arrays.asList(changes)); // Apply the selected changes and save the result document comparer.applyChanges(resultFile, applyChangeOptions); // Terminate the process with a success exit code process.exit(0); ``` This example creates a `Comparer` instance with the source document, adds the target document, and performs the comparison. It then retrieves all detected changes, marks the first change as rejected using `setComparisonAction()`, wraps the changes array in a Java List, and applies the changes to create a result document where the rejected change is not included. The result is as follows: | Accepted changes | Rejected changes | | :-----------------------------------------------------------------: | :----------------------------------------------------------------: | | ![](/comparison/nodejs-java/images/accepted-changes.png) | ![](/comparison/nodejs-java/images/rejected-changes.png) | ## Accept or reject changes for documents provided as a stream The following example loads documents from Java streams, rejects the first change, and writes the result to a new file. ```javascript 'use strict'; // Import GroupDocs.Comparison for Node.js via Java SDK const groupdocs = require('@groupdocs/groupdocs.comparison'); // Import Java interop and required classes const java = require('java'); const InputStream = java.import('java.io.FileInputStream'); const Arrays = java.import('java.util.Arrays'); // Create InputStream objects for source and target documents const sourceInputStream = new InputStream('sample-files/source.docx'); const targetInputStream = new InputStream('sample-files/target.docx'); // Initialize comparer with source document stream const comparer = new groupdocs.Comparer(sourceInputStream); // Add target document stream to comparer comparer.add(targetInputStream); // Perform comparison and generate a result document on disk comparer.compare('result.docx'); // Retrieve list of detected changes let changes = comparer.getChanges(); // Reject the first detected change changes[0].setComparisonAction(groupdocs.ComparisonAction.REJECT); // Configure options for applying changes const applyOptions = new groupdocs.ApplyChangeOptions(); // Convert JavaScript array of changes to a Java List using Arrays.asList const javaList = Arrays.asList(changes); applyOptions.setChanges(javaList); // Apply the selected changes and save them into a separate result file comparer.applyChanges('result_rejected.docx', applyOptions); // Terminate the process with a success exit code process.exit(0); ``` This example demonstrates the same workflow using Java input streams instead of file paths. It creates `InputStream` objects for both source and target documents, initializes the comparer with the source stream, adds the target stream, performs the comparison, retrieves changes, marks the first change as rejected, and applies the changes to save a new result file. ## Accept or reject detected changes using the SaveOriginalState option The following example shows how to apply different actions to the same comparison result while optionally preserving the original state. ```javascript 'use strict'; // Import GroupDocs.Comparison for Node.js via Java SDK const groupdocs = require('@groupdocs/groupdocs.comparison'); // Import Java interop helper for working with Java collections const java = require('java'); const Arrays = java.import('java.util.Arrays'); // Define file paths for source, target, and multiple result documents const sourceFile = 'sample-files/source.docx'; const targetFile = 'sample-files/target.docx'; const resultFile = 'result.docx'; const resultFileWithRejectedChange = 'rejected.docx'; const resultFileWithAcceptedChange = 'accepted.docx'; // Initialize comparer with the source document and add the target const comparer = new groupdocs.Comparer(sourceFile); comparer.add(targetFile); // Run the comparison and save the initial merged result comparer.compare(resultFile); // Reject first change and save result while keeping original state let changes = comparer.getChanges(); changes[0].setComparisonAction(groupdocs.ComparisonAction.REJECT); const rejectOptions = new groupdocs.ApplyChangeOptions(); rejectOptions.setSaveOriginalState(true); // keep original state unchanged rejectOptions.setChanges(Arrays.asList(changes)); // apply only the updated change list comparer.applyChanges(resultFileWithRejectedChange, rejectOptions); // Accept first change and save another variant of the document changes = comparer.getChanges(); changes[0].setComparisonAction(groupdocs.ComparisonAction.ACCEPT); const acceptOptions = new groupdocs.ApplyChangeOptions(); acceptOptions.setChanges(Arrays.asList(changes)); comparer.applyChanges(resultFileWithAcceptedChange, acceptOptions); // Exit the process process.exit(0); ``` This example shows how to create multiple result documents from the same comparison with different change actions. It first saves the initial comparison result, then creates one result file with the first change rejected (using `setSaveOriginalState(true)` to preserve the original comparison state), and another result file with the first change accepted. This allows you to generate multiple variants of the document with different change selections. --- ## Add area annotation Path: /annotation/java/add-area-annotation/ Area annotation allows you to mark up a rectangle area within the document page and annotate it as shown in the picture below.  ![](/annotation/java/images/add-area-annotation.png) You can use the following methods to set the properties of the [AreaAnnotation](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/) class: https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/#setBackgroundColor-java.lang.Integer- * [setBackgroundColor()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/#setBackgroundColor-java.lang.Integer-) defines the area background color * [setBox()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/#setBox-com.groupdocs.annotation.models.Rectangle-) defines the annotation position at the document page * [setOpacity()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/#setOpacity-java.lang.Double-) allows you to set the annotation opacity * [setPenColor()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/#setPenColor-java.lang.Integer-) defines the frame color * [setPenStyle()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/#setPenStyle-java.lang.Byte-) defines the frame line style (solid, dash, dot etc.) * [setPenWidth()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/#setPenWidth-java.lang.Byte-) defines the frame line width in pixels To add an area annotation to document, follow these steps:   1. Instantiate the [Annotator](https://reference.groupdocs.com/java/annotation/com.groupdocs.annotation/Annotator) class. Specify the input document path or stream. 2. Instantiate the [AreaAnnotation](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/) class. Specify the appropriate properties (position, page number, etc). 3. Call the [add()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#add-com.groupdocs.annotation.models.annotationmodels.AnnotationBase-) method. Specify the [AreaAnnotation](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/) class. 4. Call the [save()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#save--) method. Specify the output document path or stream. The following code snippet shows how to add [AreaAnnotation](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/areaannotation/) to the document: {{< tabs "example1">}} {{< tab "Java" >}} // This example demonstrates adding area annotation. // Create an instance of Reply class and add comments Reply reply1 = new Reply(); reply1.setComment("First comment"); reply1.setRepliedOn(Calendar.getInstance().getTime()); Reply reply2 = new Reply(); reply2.setComment("Second comment"); reply2.setRepliedOn(Calendar.getInstance().getTime()); java.util.List replies = new ArrayList(); replies.add(reply1); replies.add(reply2); // Create an instance of Annotator class Annotator annotator = new Annotator("inputPath"); try { // Create an instance of AreaAnnotation class and set options AreaAnnotation area = new AreaAnnotation(); area.setBackgroundColor(65535); area.setBox(new Rectangle(100, 100, 100, 100)); area.setCreatedOn(Calendar.getInstance().getTime()); area.setMessage("This is area annotation"); area.setOpacity(0.7); area.setPageNumber(0); area.setPenColor(65535); area.setPenStyle(PenStyle.Dot); area.setPenWidth((byte) 3); area.setReplies(replies); // Add annotation and save to file annotator.add(area); annotator.save("outputPath"); } finally { if (annotator != null) { annotator.dispose(); } } ``` {{< /tab >}} {{< /tabs >}} --- ## Add area annotation Path: /annotation/net/add-area-annotation/ Area annotation allows you to mark up a rectangle area within the document page and annotate it as shown in the picture below.  ![](/annotation/net/images/add-area-annotation.png) You can set the following properties of the [AreaAnnotation](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.annotationmodels/areaannotation) class: * [BackgroundColor](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.annotationmodels/areaannotation/properties/backgroundcolor) defines the area background color * [Box](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.annotationmodels/areaannotation/properties/box) defines the annotation position at the document page * [Opacity](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.annotationmodels/areaannotation/properties/opacity) - allows you to set the annotation opacity * [PenColor](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.annotationmodels/areaannotation/properties/pencolor) defines the frame color * [PenStyle](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.annotationmodels/areaannotation/properties/penstyle) defines the frame line style (solid, dash, dot etc.) * [PenWidth](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.annotationmodels/areaannotation/properties/penwidth) - defines the frame line width in pixels To add an area annotation to document, follow these steps:   1. Instantiate the [Annotator](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator) class. Specify the input document path or stream. 2. Instantiate the [AreaAnnotation](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.annotationmodels/areaannotation) class. Specify the appropriate properties (position, page number, etc). 3. Call the [Add](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator/methods/add) method. Specify the [AreaAnnotation](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.annotationmodels/areaannotation) class. 4. Call the [Save](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator/methods/save/index) method. Specify the output document path or stream. The following code snippet shows how to add [AreaAnnotation](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.annotationmodels/areaannotation) to the document: {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using (Annotator annotator = new Annotator("input.pdf")) { AreaAnnotation area = new AreaAnnotation { BackgroundColor = 65535, Box = new Rectangle(100, 100, 100, 100), CreatedOn = DateTime.Now, Message = "This is area annotation", Opacity = 0.7, PageNumber = 0, PenColor = 65535, PenStyle = PenStyle.Dot, PenWidth = 3, Replies = new List { new Reply { Comment = "First comment", RepliedOn = DateTime.Now }, new Reply { Comment = "Second comment", RepliedOn = DateTime.Now } } }; annotator.Add(area); annotator.Save("result.pdf"); } ``` {{< /tab >}} {{< /tabs >}} --- ## Add button component Path: /annotation/java/add-button-component/ Button component creates a button component as shown in the picture below: ![](/annotation/net/images/add-button-component.png) You can specify the following properties of the [ButtonComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent/) class: * [Box](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent/#setBox-com.groupdocs.annotation.models.Rectangle-) defines the annotation position * [PenColor](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent/#setPenColor-java.lang.Integer-) defines the frame color To add a button component, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/) class. Specify the input document path or stream. 2. Instantiate the [ButtonComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent/) class. Specify the appropriate properties (position, page number, etc). 3. Call the [Add](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#add-com.groupdocs.annotation.models.annotationmodels.AnnotationBase-) method. Specify the [ButtonComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent/) class. 4. Call the [Save](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#save--) method. Specify the output document path or stream. The following code snippet shows how to add [ButtonComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent/) to the document: {{< tabs "example1">}} {{< tab "Java" >}} ```java try(final Annotator annotator = new Annotator(Constants.INPUT_PDF)) { ButtonComponent buttonComponent = new ButtonComponent(); buttonComponent.setCreatedOn(new Date()); buttonComponent.setStyle(BorderStyle.DASHED); buttonComponent.setMessage("This is button component"); buttonComponent.setBorderColor(1422623); buttonComponent.setPenColor(14527697); buttonComponent.setButtonColor(10832612); buttonComponent.setPageNumber(0); buttonComponent.setBorderWidth(12); buttonComponent.setBox(new Rectangle(100, 300, 90, 30)); Reply reply1 = new Reply(); reply1.setComment("First comment"); reply1.setRepliedOn(new Date()); Reply reply2 = new Reply(); reply2.setComment("Second comment"); reply2.setRepliedOn(new Date()); List replies = new ArrayList<>(); replies.add(reply1); replies.add(reply2); buttonComponent.setReplies(replies); annotator.add(buttonComponent); annotator.save("result_button_component.pdf"); } ``` {{< /tab >}} {{< /tabs >}} --- ## Add button component Path: /annotation/net/add-button-component/ Button component creates a button component as shown in the picture below: ![](/annotation/net/images/add-button-component.png) You can specify the following properties of the [ButtonComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent) class: * [Box](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent/properties/box) defines the annotation position * [PenColor](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent/properties/pencolor) defines the frame color To add a button component, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator) class. Specify the input document path or stream. 2. Instantiate the [ButtonComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent) class. Specify the appropriate properties (position, page number, etc). 3. Call the [Add](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator/methods/add) method. Specify the [ButtonComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/buttoncomponent) class. 4. Call the [Save](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator/methods/save/index) method. Specify the output document path or stream. The following code snippet shows how to add [ButtonComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/cropdowncomponent) to the document: {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using (Annotator annotator = new Annotator("input.pdf")) { ButtonComponent button = new ButtonComponent { CreatedOn = DateTime.Now, Style = BorderStyle.Dashed, Message = "This is button component", BorderColor = 1422623, PenColor = 14527697, ButtonColor = 10832612, PageNumber = 0, BorderWidth = 12, Box = new Rectangle(100, 300, 90, 30), Replies = new List { new Reply { Comment = "First comment", RepliedOn = DateTime.Now }, new Reply { Comment = "Second comment", RepliedOn = DateTime.Now } } }; annotator.Add(button); annotator.Save("result.pdf"); } ``` {{< /tab >}} {{< /tabs >}} --- ## Add checkbox component Path: /annotation/java/add-checkbox-component/ Checkbox component creates a checkbox as shown in the picture below: ![](/annotation/net/images/add-checkbox-component.png) You can specify the following properties of the [CheckBoxComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent/) class: * [Box](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent/#setBox-com.groupdocs.annotation.models.Rectangle-) defines the annotation position * [PenColor](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent/#setPenColor-java.lang.Integer-) defines the frame color To add a checkbox component, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/) class. Specify the input document path or stream. 2. Instantiate the [CheckboxComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent/) class. Specify the appropriate properties (position, page number, etc). 3. Call the [Add](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#add-com.groupdocs.annotation.models.annotationmodels.AnnotationBase-) method. Specify the [CheckboxComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent/) class. 4. Call the [Save](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#save--) method. Specify the output document path or stream. The following code snippet shows how to add [CheckboxComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent/) to the document: {{< tabs "example1">}} {{< tab "Java" >}} ```java try(final Annotator annotator = new Annotator(Constants.INPUT_PDF)) { CheckBoxComponent checkbox = new CheckBoxComponent(); checkbox.setChecked(true); checkbox.setBox(new Rectangle(100, 100, 100, 100)); checkbox.setPenColor(65535); checkbox.setStyle(BoxStyle.STAR); Reply reply1 = new Reply(); reply1.setComment("First comment"); reply1.setRepliedOn(new Date()); Reply reply2 = new Reply(); reply2.setComment("Second comment"); reply2.setRepliedOn(new Date()); List replies = new ArrayList<>(); replies.add(reply1); replies.add(reply2); checkbox.setReplies(replies); annotator.add(checkbox); annotator.save("result_checkbox_component.pdf"); } ``` {{< /tab >}} {{< /tabs >}} --- ## Add checkbox component Path: /annotation/net/add-checkbox-component/ Checkbox component creates a checkbox as shown in the picture below: ![](/annotation/net/images/add-checkbox-component.png) You can specify the following properties of the [CheckBoxComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent) class: * [Box](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent/properties/box) defines the annotation position * [PenColor](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent/properties/pencolor) defines the frame color To add a checkbox component, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator) class. Specify the input document path or stream. 2. Instantiate the [CheckboxComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent) class. Specify the appropriate properties (position, page number, etc). 3. Call the [Add](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator/methods/add) method. Specify the [CheckboxComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/checkboxcomponent) class. 4. Call the [Save](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator/methods/save/index) method. Specify the output document path or stream. The following code snippet shows how to add [CheckboxComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/cropdowncomponent) to the document: {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using (Annotator annotator = new Annotator("input.pdf")) { CheckBoxComponent checkbox = new CheckBoxComponent { Checked = true, Box = new Rectangle(100, 100, 100, 100), PenColor = 65535, Style = BoxStyle.Star, Replies = new List { new Reply { Comment = "First comment", RepliedOn = DateTime.Now }, new Reply { Comment = "Second comment", RepliedOn = DateTime.Now } } }; annotator.Add(checkbox); annotator.Save("result.pdf"); } ``` {{< /tab >}} {{< /tabs >}} --- ## Add document password Path: /merger/java/add-document-password/ [**GroupDocs.Merger**](https://products.groupdocs.com/merger/java) allows to add document password. Here are the steps to add document password: * Initialize [AddPasswordOptions](https://reference.groupdocs.com/java/merger/com.groupdocs.merger.domain.options/AddPasswordOptions) class with new document password; * Instantiate [Merger](https://reference.groupdocs.com/java/merger/com.groupdocs.merger/Merger) object with source document path or InputStream; * Call [addPassword](https://reference.groupdocs.com/java/merger/com.groupdocs.merger/Merger#addPassword(com.groupdocs.merger.domain.options.interfaces.IAddPasswordOptions)) method and pass [AddPasswordOptions](https://reference.groupdocs.com/java/merger/com.groupdocs.merger.domain.options/AddPasswordOptions) object to it; * Call [save](https://reference.groupdocs.com/java/merger/com.groupdocs.merger/Merger#save(java.lang.String)) method specifying file path to save resultant document. The following code sample demonstrates how to add document password. ```java String filePath = "c:\sample.pptx"; String filePathOut = "c:\output\result.pptx"; AddPasswordOptions addOptions = new AddPasswordOptions("SAMPLE_PASSWORD"); Merger merger = new Merger(filePath); merger.addPassword(addOptions); merger.save(filePathOut); ``` --- ## Add document password Path: /merger/net/add-document-password/ **GroupDocs.Merger** allows to add document password. Here are the steps to add document password: * Initialize [AddPasswordOptions](https://reference.groupdocs.com/merger/net/groupdocs.merger.domain.options/addpasswordoptions) class with new document password; * Instantiate [Merger](https://reference.groupdocs.com/merger/net/groupdocs.merger/merger) object with source document path or stream; * Call [AddPassword](https://reference.groupdocs.com/merger/net/groupdocs.merger/merger/addpassword) method and pass [AddPasswordOptions](https://reference.groupdocs.com/merger/net/groupdocs.merger.domain.options/addpasswordoptions) object to it; * Call [Save](https://reference.groupdocs.com/merger/net/groupdocs.merger/merger/save/#save_1) method specifying file path to save resultant document. The following code sample demonstrates how to add document password. ```csharp string filePath = @"c:\sample.pptx"; string filePathOut = @"c:\output\result.pptx"; AddPasswordOptions addOptions = new AddPasswordOptions("SAMPLE_PASSWORD"); using (Merger merger = new Merger(filePath)) { merger.AddPassword(addOptions); merger.Save(filePathOut); } ``` --- ## Add document password Path: /merger/python-net/add-document-password/ **GroupDocs.Merger** allows to add document password. Here are the steps to add document password: * Initialize [AddPasswordOptions](https://reference.groupdocs.com/merger/python-net/groupdocs.merger.domain.options/addpasswordoptions) class with new document password; * Instantiate [Merger](https://reference.groupdocs.com/merger/python-net/groupdocs.merger/merger) object with source document path or stream; * Call [AddPassword](https://reference.groupdocs.com/merger/python-net/groupdocs.merger/merger/addpassword) method and pass [AddPasswordOptions](https://reference.groupdocs.com/merger/python-net/groupdocs.merger.domain.options/addpasswordoptions) object to it; * Call [Save](https://reference.groupdocs.com/merger/python-net/groupdocs.merger/merger/save/#save_1) method specifying file path to save resultant document. The following code sample demonstrates how to add document password. ```python with gm.Merger(constants.sample_pptx) as merger: add_password_options = gm.domain.options.AddPasswordOptions("SomePasswordString") merger.add_password(add_password_options) merger.save(constants.output_pptx) ``` --- ## Add dropdown component Path: /annotation/java/add-dropdown-component/ Dropdown component creates a combo box as shown in the picture below: ![](/annotation/net/images/add-dropdown-component.png) You can specify the following properties of the [DropdownComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/) class: * [Box](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/#setBox-com.groupdocs.annotation.models.Rectangle-) defines the annotation position * [PenColor](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/#setPenColor-java.lang.Integer-) defines the frame color * [PenStyle](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/#setPenStyle-java.lang.Byte-) defines the frame line style (solid, dash, dot etc.) * [PenWidth](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/#setPenWidth-java.lang.Byte-) defines the frame line width in pixels. To add a dropdown component, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/) class. Specify the input document path or stream. 2. Instantiate the [DropdownComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/) class. Specify the appropriate properties (position, page number, etc). 3. Call the [Add](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#add-com.groupdocs.annotation.models.annotationmodels.AnnotationBase-) method. Specify the [DropdownComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/) class. 4. Call the [Save](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#save--) method. Specify the output document path or stream. The following code snippet shows how to add [DropdownComponent](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/) to the document: {{< tabs "example1">}} {{< tab "Java" >}} ```java try(final Annotator annotator = new Annotator(Constants.INPUT_PDF)) { DropdownComponent dropdownComponent = new DropdownComponent(); dropdownComponent.setOptions(new ArrayList<>(Arrays.asList("Item1", "Item2", "Item3"))); dropdownComponent.setSelectedOption(null); dropdownComponent.setPlaceholder("Choose option"); dropdownComponent.setBox(new Rectangle(100, 100, 100, 100)); dropdownComponent.setCreatedOn(new Date()); dropdownComponent.setMessage("This is dropdown component"); dropdownComponent.setPageNumber(0); dropdownComponent.setPenColor(65535); dropdownComponent.setPenStyle(PenStyle.DOT); dropdownComponent.setPenWidth((byte) 3); List replies = new ArrayList<>(); Reply reply1 = new Reply(); reply1.setComment("First comment"); reply1.setRepliedOn(new Date()); Reply reply2 = new Reply(); reply2.setComment("Second comment"); reply2.setRepliedOn(new Date()); replies.add(reply1); replies.add(reply2); dropdownComponent.setReplies(replies); annotator.add(dropdownComponent); annotator.save("result_dropdown_component.pdf"); } ``` {{< /tab >}} {{< /tabs >}} --- ## Add dropdown component Path: /annotation/net/add-dropdown-component/ Dropdown component creates a combo box as shown in the picture below: ![](/annotation/net/images/add-dropdown-component.png) You can specify the following properties of the [DropdownComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent) class: * [Box](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/properties/box) defines the annotation position * [PenColor](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/properties/pencolor) defines the frame color * [PenStyle](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/properties/penstyle) defines the frame line style (solid, dash, dot etc.) * [PenWidth](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent/properties/penwidth) defines the frame line width in pixels. To add a dropdown component, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator) class. Specify the input document path or stream. 2. Instantiate the [DropdownComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent) class. Specify the appropriate properties (position, page number, etc). 3. Call the [Add](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator/methods/add) method. Specify the [DropdownComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent) class. 4. Call the [Save](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator/methods/save/index) method. Specify the output document path or stream. The following code snippet shows how to add [DropdownComponent](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models.formatspecificcomponents.pdf/dropdowncomponent) to the document: {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using (Annotator annotator = new Annotator("input.pdf")) { DropdownComponent dropdown = new DropdownComponent { Options = new List { "Item1", "Item2", "Item3" }, SelectedOption = null, Placeholder = "Choose option", Box = new Rectangle(100, 100, 100, 100), CreatedOn = DateTime.Now, Message = "This is dropdown component", PageNumber = 0, PenColor = 65535, PenStyle = PenStyle.Dot, PenWidth = 3, Replies = new List { new Reply { Comment = "First comment", RepliedOn = DateTime.Now }, new Reply { Comment = "Second comment", RepliedOn = DateTime.Now } } }; annotator.Add(dropdown); annotator.Save("result.pdf"); } ``` {{< /tab >}} {{< /tabs >}} --- ## Add replies to annotation Path: /annotation/java/add-replies-to-annotation/ [GroupDocs.Annotation](https://products.groupdocs.com/annotation/java) allows you to collaborate over document using annotations and annotation replies. To update an annotation reply, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/java/annotation/com.groupdocs.annotation/Annotator) class. Specify the input document path or stream. 2. Instantiate the [User](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models/user/) class. 3. Instantiate the [Reply](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models/reply/) class(es). 4. Instantiate the annotation object of the appropriate type. Available annotation types are listed [here](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models.annotationmodels/). 5. Assign the [User](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models/user/) class to `Reply.User` property (by default it is "Guest"). 6. Assign the [Reply](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation.models/reply/) class(es) to the `Replies` collection created at previous steps. 7. Call the  [add()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#add-com.groupdocs.annotation.models.annotationmodels.AnnotationBase-) method of the [Annotator](https://reference.groupdocs.com/java/annotation/com.groupdocs.annotation/Annotator) class. Specify the annotation. 8. Call the [save()](https://reference.groupdocs.com/annotation/java/com.groupdocs.annotation/annotator/#save--) method. Specify the output document path or stream. The following code snippet shows how to add replies to annotation: {{< tabs "example1">}} {{< tab "Java" >}} ```java // This example demonstrates adding replies to annotation. // Create an instance of Annotator class Annotator annotator = new Annotator("inputPath"); try { // Create an instance of User class and add data User user1 = new User(); user1.setId(1); user1.setName("Tom"); user1.setEmail("somemail@mail.com"); User user2 = new User(); user2.setId(2); user2.setName("Jack"); user2.setEmail("somebody@mail.com"); User user3 = new User(); user3.setId(3); user3.setName("Mike"); user3.setEmail("somemike@mail.com"); // Create an instance of AreaAnnotation class and set options AreaAnnotation area = new AreaAnnotation(); area.setBackgroundColor(65535); area.setBox(new Rectangle(100, 100, 100, 100)); area.setCreatedOn(Calendar.getInstance().getTime()); area.setMessage("This is area annotation"); area.setOpacity(0.7); area.setPageNumber(0); area.setPenColor(65535); area.setPenStyle(PenStyle.Dot); area.setPenWidth((byte) 3); // Create an instance of Reply class and add comments Reply reply1 = new Reply(); reply1.setId(1); reply1.setComment("First comment"); reply1.setRepliedOn(Calendar.getInstance().getTime()); reply1.setUser(user1); Reply reply2 = new Reply(); reply2.setId(2); reply2.setComment("Second comment"); reply2.setRepliedOn(Calendar.getInstance().getTime()); reply2.setUser(user2); Reply reply3 = new Reply(); reply3.setId(3); reply3.setComment("Third comment"); reply3.setRepliedOn(Calendar.getInstance().getTime()); reply3.setUser(user1); Reply reply4 = new Reply(); reply4.setId(4); reply4.setComment("Fourth comment"); reply4.setRepliedOn(Calendar.getInstance().getTime()); reply4.setUser(user2); Reply reply5 = new Reply(); reply5.setId(5); reply5.setComment("Five comment"); reply5.setRepliedOn(Calendar.getInstance().getTime()); reply5.setUser(user3); java.util.List replies = new ArrayList(); replies.add(reply1); replies.add(reply2); replies.add(reply3); replies.add(reply4); replies.add(reply5); area.setReplies(replies); // Add annotation and save to file annotator.add(area); annotator.save("outputPath"); } finally { if (annotator != null) { annotator.dispose(); } } ``` {{< /tab >}} {{< /tabs >}} --- ## Add replies to annotation Path: /annotation/net/add-replies-to-annotation/ [GroupDocs.Annotation](https://products.groupdocs.com/annotation/net) allows you to collaborate over document using annotations and annotation replies. To update an annotation reply, follow these steps: 1. Instantiate the [Annotator](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator) class. Specify the input document path or stream. 2. Instantiate the [User](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models/user) class. 3. Instantiate the [Reply](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models/reply) class(es). 4. Instantiate the annotation object of the appropriate type. Available annotation types are listed [here](https://reference.groupdocs.com/annotation/net/groupdocs.annotation.models.annotationmodels). 5. Assign the [User](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models/user) class to `Reply.User` property (by default it is "Guest"). 6. Assign the [Reply](https://reference.groupdocs.com/net/annotation/groupdocs.annotation.models/reply) class(es) to the `Replies` collection created at previous steps. 7. Call the  [Add](https://reference.groupdocs.com/annotation/net/groupdocs.annotation/annotator/methods/add) method of the [Annotator](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator) class. Specify the annotation. 8. Call the [Save](https://reference.groupdocs.com/net/annotation/groupdocs.annotation/annotator/methods/save/index) method. Specify the output document path or stream. The following code snippet shows how to add replies to annotation: {{< tabs "example1">}} {{< tab "C#" >}} ```csharp using (Annotator annotator = new Annotator("input.pdf")) { User user1 = new User { Id = 1, Name = "Tom", Email = "somemail@mail.com" }; User user2 = new User { Id = 2, Name = "Jack", Email = "somebody@mail.com" }; AreaAnnotation area = new AreaAnnotation { Box = new Rectangle(100, 100, 100, 100), CreatedOn = DateTime.Now, Message = "This is an area annotation", PageNumber = 0, Replies = new List { new Reply { Id = 1, Comment = "First comment", RepliedOn = DateTime.Now, User = user1 }, new Reply { Id = 2, Comment = "Second comment", RepliedOn = DateTime.Now, User = user2, } } }; annotator.Add(area); annotator.Save("result.pdf"); } ``` {{< /tab >}} {{< /tabs >}} --- ## Add text watermarks Path: /watermark/net/basic-usage/add-text/ One of the main features of the GroupDocs.Watermark library is adding text watermarks to documents. You may add watermarks to documents or images from local disks, as well as from streams. For a full list of supported document formats, check [Supported formats]({{< ref "watermark/net/getting-started/supported-document-formats.md" >}}). To add a text watermark perform the following steps: 1. [Create](https://reference.groupdocs.com/net/watermark/groupdocs.watermark/watermarker/constructors/4) an instance of the `Watermarker` class for a local file or file stream; 2. [Create](https://reference.groupdocs.com/net/watermark/groupdocs.watermark.watermarks/textwatermark/constructors/main) an instance of the `TextWatermark` class and specify the desired text and font for the watermark; 3. (Optionally.) Specify the watermark [color](https://reference.groupdocs.com/net/watermark/groupdocs.watermark.watermarks/textwatermark/properties/foregroundcolor), [horizontal](https://reference.groupdocs.com/net/watermark/groupdocs.watermark/watermark/properties/horizontalalignment) and [vertical](https://reference.groupdocs.com/net/watermark/groupdocs.watermark/watermark/properties/verticalalignment) alignments; 4. Call the [Add](https://reference.groupdocs.com/net/watermark/groupdocs.watermark/watermarker/methods/add) method to apply the watermark to the document; 5. Call the [Save](https://reference.groupdocs.com/net/watermark/groupdocs.watermark.watermarker/save/methods/4) method to store the document in a new location. ```csharp using GroupDocs.Watermark; using GroupDocs.Watermark.Common; using GroupDocs.Watermark.Watermarks; // Specify an absolute or relative path to your document. using (Watermarker watermarker = new Watermarker("C:\\Docs\\contract.docx")) { // Specify the desired text and font for the watermark TextWatermark watermark = new TextWatermark("Contract Draft", new Font("Arial", 60, FontStyle.Bold)); // Specify font color and text opacity, rotation and alignments watermark.ForegroundColor = Color.DarkGreen; watermark.Opacity = 0.5; watermark.HorizontalAlignment = HorizontalAlignment.Center; watermark.VerticalAlignment = VerticalAlignment.Center; // Apply the watermark watermarker.Add(watermark); // Save the resulting document watermarker.Save("C:\\Docs\\watermarked-contract.docx"); } ``` Run the program. A new watermarked document will appear in the specified path. ![Adding text watermarks](/watermark/net/images/watermarking/add-text.png) ### What's next GroupDocs.Watermark offers many more capabilities for adding text watermarks. For example, it allows specifying background and foreground colors, formatting, text opacity, use of absolute or relative positioning, and so on. To learn more about this, see the [Adding text watermarks]({{< ref "watermark/net/developer-guide/advanced-usage/adding-watermarks/adding-text-watermarks.md" >}}) article of the "Advanced usage" section. --- ## Add text watermarks Path: /watermark/nodejs-java/add-text/ One of the main features of the GroupDocs.Watermark library is adding text watermarks to documents. You may add watermarks to documents or images from local disks, as well as from streams. For a full list of supported document formats, check [Supported formats]({{< ref "watermark/net/getting-started/supported-document-formats.md" >}}). To add a text watermark perform follow next code sample: ```js const groupdocs.watermark = require('@groupdocs/groupdocs.watermark') function addATextWatermark() { const watermarker = new groupdocs.watermark.Watermarker("sample.docx"); const watermark = new groupdocs.watermark.TextWatermark('top secret', new groupdocs.watermark.Font('Arial', 36)); watermark.setForegroundColor(groupdocs.watermark.Color.getRed()); watermark.setHorizontalAlignment(groupdocs.watermark.HorizontalAlignment.Center); watermark.setVerticalAlignment(groupdocs.watermark.VerticalAlignment.Center); watermarker.add(watermark); watermarker.save("sample.docx"); watermarker.close(); } ``` Run the program. A new watermarked document will appear in the specified path. ### What's next GroupDocs.Watermark offers many more capabilities for adding text watermarks. For example, it allows specifying background and foreground colors, formatting, text opacity, use of absolute or relative positioning, and so on. --- ## Add text watermarks Path: /watermark/python-net/add-text/ One of the main features of the GroupDocs.Watermark library is adding text watermarks to documents. You may add watermarks to documents or images from local disks, as well as from streams. For a full list of supported document formats, check [Supported formats]({{< ref "watermark/python-net/getting-started/supported-document-formats.md" >}}). To add a text watermark perform follow next code sample: ```python import groupdocs.watermark as gw import groupdocs.watermark.watermarks as gww import groupdocs.watermark.common as gwс def run(): with gw.Watermarker("sample.docx") as watermarker: font = gww.Font("Arial", 36.0) watermark = gww.TextWatermark("top secret", font) watermark.foreground_color = gww.Color.red; watermark.horizontal_alignment = gwс.HorizontalAlignment.CENTER watermark.vertical_alignment = gwс.VerticalAlignment.CENTER watermarker.add(watermark) watermarker.save(join(output_directory, "result.docx")) ``` Run the program. A new watermarked document will appear in the specified path. ### What's next GroupDocs.Watermark offers many more capabilities for adding text watermarks. For example, it allows specifying background and foreground colors, formatting, text opacity, use of absolute or relative positioning, and so on. --- ## Add watermark Path: /conversion/nodejs-java/add-watermark/ [**GroupDocs.Conversion**](https://products.groupdocs.com/conversion/nodejs-java) allows you to apply a watermark to the converted document.  You can set the following options for controlling how the watermark will be stamped in the converted document: ### WatermarkOptions * **[Text](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarktextoptions/#getText--)** - watermark text * **[Font](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarktextoptions/#getWatermarkFont--)** - watermark font name * **[Color](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarktextoptions/#getColor--)** - watermark color * **[Width](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarkoptions/#getWidth--)** - watermark width * **[Height ](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarkoptions/#getHeight--)** - watermark height * **[Top](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarkoptions/#getTop--)** - watermark top position * **[Left ](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarkoptions/#getLeft--)** - watermark left position * **[RotationAngle](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarkoptions/#getRotationAngle--)** - watermark rotation angle * **[Transparency](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarkoptions/#getTransparency--)** - watermark transparency * **[Background](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/watermarkoptions/#getBackground--)** -  specifies that the watermark is stamped as background. If the value is true, the watermark is laid at the bottom. By default is false and the watermark is laid on top. To add a watermark, follow these steps: 1. Create an instance of the [Converter](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion/Converter) class and pass the source document path as a constructor parameter. 2. Instantiate the appropriate [ConvertOptions](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/ConvertOptions) class e.g. (**[PdfConvertOptions](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/PdfConvertOptions)**, **[WordProcessingConvertOptions](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/WordProcessingConvertOptions)**, **[SpreadsheetConvertOptions](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/SpreadsheetConvertOptions)**, etc.) 3. Create an instance of the [WatermarkOptions](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/WatermarkOptions) class. Set needed properties to specify the watermark color, width, height, text, image, etc. 4. Call the [setWatermark](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/commonconvertoptions/#setWatermark-com.groupdocs.conversion.options.convert.WatermarkOptions-) method of the [ConvertOptions](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/ConvertOptions) instance with the instance of the [WatermarkOptions](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/WatermarkOptions) class created in the previous step.  5. Call the [convert](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion/Converter#convert(java.lang.String,%20com.groupdocs.conversion.options.convert.ConvertOptions)) method of the [Converter](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion/Converter) class instance and pass the filename of the converted document and the instance of [ConvertOptions](https://reference.groupdocs.com/conversion/nodejs-java/com.groupdocs.conversion.options.convert/ConvertOptions) from the previous step. The following code snippet shows how to apply a watermark to the output document: ```js const converter = new groupdocs.conversion.Converter('sample.docx') const watermark = new groupdocs.conversion.WatermarkTextOptions("Sample watermark") watermark.setColor("red") watermark.setWidth(100) watermark.setHeight(100) watermark.setBackground(true) const convertOptions = new groupdocs.conversion.PdfConvertOptions() convertOptions.setWatermark(watermark) converter.convert('converted.pdf', convertOptions) ``` --- ## Adding a Watermark to Converted Documents Path: /conversion/java/add-watermark/ [**GroupDocs.Conversion**](https://products.groupdocs.com/conversion/java) provides a flexible way to apply watermarks to documents during the conversion process. This feature can be useful for branding, security, or informational purposes. You can customize various aspects of the watermark, such as its text, size, color, position, and transparency. {{< alert style="tip" >}} Looking for advanced watermarking capabilities? While GroupDocs.Conversion offers basic watermarking, you can explore [GroupDocs.Watermark](https://products.groupdocs.com/watermark/) for a comprehensive solution with enhanced features. {{< /alert >}} ### WatermarkOptions You can control how the watermark appears in the converted document using the [WatermarkOptions](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarkoptions/) class. Here are the key properties you can set: | Option | Description | |--------|-------------| |[**setText()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarktextoptions/#setText-java.lang.String-) | The content of the watermark text. | |[**setWatermarkFont()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarktextoptions/#setWatermarkFont-com.groupdocs.conversion.options.convert.Font-) | The font family of the watermark text. | |[**setColor()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarktextoptions/#setColor-java.awt.Color-) | The color of the watermark text. | |[**setWidth()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarkoptions/#setWidth-int-) | The width of the watermark. | |[**setHeight()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarkoptions/#setHeight-int-) | The height of the watermark. | |[**setTop()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarkoptions/#setTop-int-) | The distance from the top edge of the document. | |[**setLeft()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarkoptions/#setLeft-int-) | The distance from the left edge of the document. | |[**setRotationAngle()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarkoptions/#setRotationAngle-int-) | The angle at which the watermark is rotated. | |[**setTransparency()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarkoptions/#setTransparency-double-) | The transparency level of the watermark (0 is fully transparent, 1 is fully opaque). | |[**setBackground()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarkoptions/#setBackground-boolean-) | Determines whether the watermark is stamped as a background. If set to `true`, the watermark appears behind the document content. By default, it is set to `false`, meaning the watermark will appear on top of the content. | |[**setAutoAlign()**](https://reference.groupdocs.com/conversion/java/com.groupdocs.conversion.options.convert/watermarkoptions/#setAutoAlign-boolean-) | Enables or disables automatic alignment of the watermark on the document. When set to `true`, the watermark will be automatically positioned to best fit the content layout, ensuring optimal visibility and aesthetics. When set to `false`, the watermark will retain its manually defined position. | ### Steps to Add a Watermark - **Initialize the Converter**: Create an instance of the `Converter` class, providing the path to the source document. - **Set Conversion Options**: Instantiate the appropriate `ConvertOptions` class (e.g., `PdfConvertOptions`, `WordProcessingConvertOptions`, `SpreadsheetConvertOptions`, etc.). - **Configure Watermark Options**: Create an instance of the `WatermarkOptions` class and configure the properties to specify the watermark's appearance. - **Apply the Watermark**: Use the `setWatermark` method of the `ConvertOptions` instance to apply the watermark settings. - **Convert the Document**: Call the `convert` method on the `Converter` instance, passing the output file name and the configured `ConvertOptions` instance. ### Example: Add a Text Watermark to Converted Document The following Java code snippet demonstrates how to apply a text watermark to a document during conversion to PDF: {{< tabs "code-example">}} {{< tab "AddWatermarkToConvertedDocument.java" >}} ```java import com.groupdocs.conversion.Converter; import com.groupdocs.conversion.options.convert.PdfConvertOptions; import com.groupdocs.conversion.options.convert.WatermarkTextOptions; public class AddWatermarkToConvertedDocument { public static void convert() { // Initialize the converter with the source document try(Converter converter = new Converter("annual-review.docx")){ // Set conversion options for PDF PdfConvertOptions options = new PdfConvertOptions(); // Configure watermark options WatermarkTextOptions watermark = new WatermarkTextOptions("Sample Watermark"); watermark.setColor(Color.RED); // Set watermark color to red watermark.setWidth(100); // Set watermark width watermark.setHeight(100); // Set watermark height watermark.setBackground(true); // Set watermark as background // Apply the watermark to the conversion options options.setWatermark(watermark); // Convert the document and apply the watermark converter.convert("addTextWatermark.pdf", options); } } public static void main(String[] args){ convert(); } } ``` {{< /tab >}} {{< tab "annual-review.docx" >}} {{< tab-text >}} `annual-review.docx` is sample file used in this example. Click [here](/conversion/java/_sample_files/developer-guide/converting-documents/add-watermark/annual-review.docx) to download it. {{< /tab-text >}} {{< /tab >}} {{< tab "addTextWatermark.pdf" >}} {{< tab-text >}} `addTextWatermark.pdf` is converted PDF document. Click [here](/conversion/java/_sample_files/developer-guide/converting-documents/add-watermark/addTextWatermark.pdf) to download it. {{< /tab-text >}} {{< /tab >}} {{< /tabs >}} By following these steps and adjusting the settings, you can easily add customized watermarks to your converted documents using GroupDocs.Conversion. --- ## Adding class name to input controls Path: /editor/java/adding-class-name-to-input-controls/ Almost all formats within WordProcessing format family, like DOC(X/M), ODT etc., support input controls of different kinds. WordProcessing documents can contain different buttons, textboxes, check-boxes, combo-boxes, input fields, dropdown lists, radio-buttons, date/time pickers and much more, which are internally present as Structured Document Tag (SDT) entities or Fields ("Insert > Quick Parts > Document Property/Field"). **[GroupDocs.Editor](https://products.groupdocs.com/editor/java)** supports all of these entities and preserves them while converting the document to the [EditableDocument](https://reference.groupdocs.com/editor/java/com.groupdocs.editor/editabledocument) instance. Finally, when generating a HTML document from [EditableDocument](https://reference.groupdocs.com/editor/java/com.groupdocs.editor/editabledocument) in order to edit it in the WYSIWYG HTML-editor, these input controls are translated into the most appropriate HTML structures and elements. Additionally, when input document contains not only input controls, but also user-entered data, this data is also preserved and will be present in the output HTML document. In some specific use-cases the end-user may require not to edit the entire document content, but only edit and/or gather data, entered into the input controls. For such case it is required to identify all these input controls in some way in order to fetching them, to distinguish them from all other HTML elements, when working on client-side. For achieving this purpose the GroupDocs.Editor has an ability to set an unique user-provided CSS class name for all such input controls in HTML markup. Starting from version 20.2 there is an option `InputControlsClassName` (`getInputControlsClassName()` / `setInputControlsClassName(String value)`) in the [WordProcessingEditOptions](https://reference.groupdocs.com/editor/java/com.groupdocs.editor.options/wordprocessingeditoptions) class. It has the next appearance: ```java public String getInputControlsClassName() public void setInputControlsClassName(String) ``` By default it has a NULL value — class names are not applied to the HTML elements. However, if user will set a valid class name, all the input control elements (like INPUT, BUTTON, SELECT etc.) will have a "class" HTML attribute with specified class name. For example: ```java WordProcessingEditOptions editOptions = new WordProcessingEditOptions(); editOptions.setInputControlsClassName("myClass1"); ``` Finally, when "class" attribute with specified class name is applied to all HTML elements, that represent input controls, client code is able to work with them by, for example, traversing the HTML DOM and gathering and/or manipulating with data. ## Complete example Code example below demonstrates editing a sample DOCX file "Fields.docx", that contains 3 input controls: a textbox, a checkbox, and a drop down list. This file is edited twice: 1st time with default `WordProcessingEditOptions`, where no custom class name is specified, and 2nd time with custom value in the `InputControlsClassName` property using a `setInputControlsClassName(String value)` method. As a result, two resultant HTML files are produced. ```java import com.groupdocs.editor.Editor; import com.groupdocs.editor.editoptions.WordProcessingEditOptions; import com.groupdocs.editor.formats.EditableDocument; import java.nio.file.Files; import java.nio.file.Paths; // ... Editor editor = new Editor("Fields.docx"); WordProcessingEditOptions optionsWithoutClassName = new WordProcessingEditOptions(); WordProcessingEditOptions optionsWithClassName = new WordProcessingEditOptions(); optionsWithClassName.setInputControlsClassName("myClass1"); EditableDocument docWithoutClassName = editor.edit(optionsWithoutClassName); EditableDocument docWithClassName = editor.edit(optionsWithClassName); Files.write(Paths.get("input-controls-without-custom-classname.html"), docWithoutClassName.getEmbeddedHtml().getBytes()); Files.write(Paths.get("input-controls-with-custom-classname.html"), docWithClassName.getEmbeddedHtml().getBytes()); docWithoutClassName.dispose(); docWithClassName.dispose(); editor.dispose(); ``` Reference files to download: - Input "[Fields.docx](/editor/java/sample-files/Fields.docx)" - Output HTML "[input-controls-without-custom-classname.html](/editor/java/sample-files/input-controls-without-custom-classname.html)" - Output HTML "[input-controls-with-custom-classname.html](/editor/java/sample-files/input-controls-with-custom-classname.html)" Screenshot below shows the difference in HTML markup between these two output HTML files: without on the left side and with `class` attribute with a `"myClass1"` value on the right side. ![input controls without and with custom classname - side-by-side comparison](/editor/java/images/input-controls-without-with-custom-classname-side-by-side.png) --- ## Adding class name to input controls Path: /editor/net/adding-class-name-to-input-controls/ Almost all formats within WordProcessing format family, like DOC(X/M), ODT etc., support input controls of different kinds. WordProcessing documents can contain different buttons, textboxes, check-boxes, combo-boxes, input fields, dropdown lists, radio-buttons, date/time pickers and much more, which are internally present as Structured Document Tag (SDT) entities or Fields ("Insert > Quick Parts > Document Property/Field"). **[GroupDocs.Editor](https://products.groupdocs.com/editor/net)** supports all of these entities and preserves them while converting the document to the [EditableDocument](https://reference.groupdocs.com/editor/net/groupdocs.editor/editabledocument) instance. Finally, when generating a HTML document from [EditableDocument](https://reference.groupdocs.com/editor/net/groupdocs.editor/editabledocument) in order to edit it in the WYSIWYG HTML-editor, these input controls are translated into the most appropriate HTML structures and elements. Additionally, when input document contains not only input controls, but also user-entered data, this data is also preserved and will be present in the output HTML document. In some specific use-cases the end-user may require not to edit the entire document content, but only edit and/or gather data, entered into the input controls. For such case it is required to identify all these input controls in some way in order to fetching them, to distinguish them from all other HTML elements, when working on client-side. For achieving this purpose the GroupDocs.Editor has an ability to set an unique user-provided CSS class name for all such input controls in HTML markup. Starting from version 20.2 there is an option [`InputControlsClassName`](https://reference.groupdocs.com/editor/net/groupdocs.editor.options/wordprocessingeditoptions/inputcontrolsclassname/) in the [WordProcessingEditOptions](https://reference.groupdocs.com/editor/net/groupdocs.editor.options/wordprocessingeditoptions) class. It has the next appearance: ```csharp public string InputControlsClassName {get; set;} ``` By default it has a NULL value — class names are not applied to the HTML elements. However, if user will set a valid class name, all the input control elements (like INPUT, BUTTON, SELECT etc.) will have a "class" HTML attribute with specified class name. For example: {{< tabs "Signature">}} {{< tab "C#" >}} ```csharp WordProcessingEditOptions editOptions = new WordProcessingEditOptions(); editOptions.InputControlsClassName = "myClass1"; ``` {{< /tab >}} {{< tab "VB.NET">}} ```vb Dim editOptions As WordProcessingEditOptions = New WordProcessingEditOptions editOptions.InputControlsClassName = "myClass1" ``` {{< /tab >}} {{< /tabs >}} Finally, when "class" attribute with specified class name is applied to all HTML elements, that represent input controls, client code is able to work with them by, for example, traversing the HTML DOM and gathering and/or manipulating with data. ## Complete example Code example below demonstrates editing a sample DOCX file "Fields.docx", that contains 3 input controls: a textbox, a checkbox, and a drop down list. This file is edited twice: 1st time with default `WordProcessingEditOptions`, where no custom class name is specified, and 2nd time with custom value in the `InputControlsClassName` property. As a result, two resultant HTML files are produced. {{< tabs "Complete example">}} {{< tab "C#" >}} ```csharp using GroupDocs.Editor.Formats; using GroupDocs.Editor.Options; // ... Editor editor = new Editor("Fields.docx"); WordProcessingEditOptions optionsWithoutClassName = new WordProcessingEditOptions(); WordProcessingEditOptions optionsWithClassName = new WordProcessingEditOptions(); optionsWithClassName.InputControlsClassName = "myClass1"; EditableDocument docWithoutClassName = editor.Edit(optionsWithoutClassName); EditableDocument docWithClassName = editor.Edit(optionsWithClassName); System.IO.File.WriteAllText("input-controls-without-custom-classname.html", docWithoutClassName.GetEmbeddedHtml()); System.IO.File.WriteAllText("input-controls-with-custom-classname.html", docWithClassName.GetEmbeddedHtml()); docWithoutClassName.Dispose(); docWithClassName.Dispose(); editor.Dispose(); ``` {{< /tab >}} {{< tab "VB.NET">}} ```vb Imports GroupDocs.Editor.Formats Imports GroupDocs.Editor.Options ' ... Dim editor As Editor = New Editor("Fields.docx") Dim optionsWithoutClassName As New WordProcessingEditOptions() Dim optionsWithClassName As New WordProcessingEditOptions() With optionsWithClassName .InputControlsClassName = "myClass1" End With Dim docWithoutClassName As EditableDocument = editor.Edit(optionsWithoutClassName) Dim docWithClassName As EditableDocument = editor.Edit(optionsWithClassName) System.IO.File.WriteAllText("input-controls-without-custom-classname.html", docWithoutClassName.GetEmbeddedHtml()) System.IO.File.WriteAllText("input-controls-with-custom-classname.html", docWithClassName.GetEmbeddedHtml()) docWithoutClassName.Dispose() docWithClassName.Dispose() editor.Dispose() ``` {{< /tab >}} {{< /tabs >}} Reference files to download: - Input "[Fields.docx](/editor/net/sample-files/Fields.docx)" - Output HTML "[input-controls-without-custom-classname.html](/editor/net/sample-files/input-controls-without-custom-classname.html)" - Output HTML "[input-controls-with-custom-classname.html](/editor/net/sample-files/input-controls-with-custom-classname.html)" Screenshot below shows the difference in HTML markup between these two output HTML files: without on the left side and with `class` attribute with a `"myClass1"` value on the right side. ![input controls without and with custom classname - side-by-side comparison](/editor/net/images/input-controls-without-with-custom-classname-side-by-side.png) --- ## Adding class name to input controls Path: /editor/nodejs-java/adding-class-name-to-input-controls/ Almost all formats within the WordProcessing format family, such as DOC(X/M), ODT, etc., support input controls of various kinds. These documents can contain buttons, textboxes, checkboxes, combo-boxes, input fields, dropdown lists, radio-buttons, date/time pickers, and more, which are internally represented as Structured Document Tag (SDT) entities or Fields. **[GroupDocs.Editor](https://products.groupdocs.com/editor/nodejs-java)** supports all of these entities and preserves them when converting the document to an [EditableDocument](https://reference.groupdocs.com/editor/nodejs-java/com.groupdocs.editor/editabledocument) instance. When generating an HTML document from an [EditableDocument](https://reference.groupdocs.com/editor/nodejs-java/com.groupdocs.editor/editabledocument) to edit in a WYSIWYG HTML-editor on the client-side, these input controls are translated into the most appropriate HTML elements. Additionally, any user-entered data in these controls is preserved in the output HTML document. ### Why apply class names to input controls? In specific scenarios, users may need to work only with input controls to edit or gather data entered on the client-side. For such cases, identifying input controls by assigning a unique CSS class name is essential. This helps distinguish these controls from other HTML elements, making them easier to manipulate or gather data from using client-side JavaScript. Starting from version 20.8, the `inputControlsClassName` option is available in the `WordProcessingEditOptions` class, allowing users to assign a CSS class to all input controls in the HTML markup. The following methods are available: ```javascript getInputControlsClassName(): string; setInputControlsClassName(className: string): void; ``` In **Node.js**, you can assign a class name to input controls as follows: ```javascript const WordProcessingEditOptions = groupdocs.options.WordProcessingEditOptions; let editOptions = new WordProcessingEditOptions(); editOptions.inputControlsClassName = "myClass1"; // Assign a class name ``` In **Java**, this can be done similarly: ```java WordProcessingEditOptions editOptions = new WordProcessingEditOptions(); editOptions.setInputControlsClassName("myClass1"); // Assign a class name ``` ### Example After assigning the class name to input controls, all HTML elements representing input controls (e.g., ``, `