HTML JPG PDF XML DOCX
  Product Family
PDF

Add strikeout text annotations to PDF documents via Go SDK

API for adding strikeout text annotations to PDF documents using Aspose.PDF Cloud Go SDK

Get Started

How to append strikeout text annotations to PDF documents using Cloud Go SDK

For adding annotations to PDF documents, we’ll use Aspose.PDF Cloud Go SDK This Cloud Go SDK assists Go programmers in developing cloud-based PDF creator, annotator, editor, and converter apps using Go programming language via Aspose.PDF REST API. Use the following command from the Package Manager Console.

Package Manager Console Command


     
    go get -u github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v25
     
     

Steps to add annotations using Go

Aspose.PDF Cloud Go developers can easily append annotations to PDF documents. Developers need just a few lines of code.

  1. Uploading the file to cloud storage.
  2. Define the Strikeout Annotation with specific properties (custom name, bounding rectangle, Visual and positioning details).
  3. Post the Annotation to the PDF Page.
  4. Downloading the modified document if successful.
 

This sample code shows adding annotations to PDF document using PDF Cloud Go SDK


    package main

    import (
        "fmt"

        asposepdfcloud "github.com/aspose-pdf-cloud/aspose-pdf-cloud-go/v25"
    )

    func AppendStrikeoutAnnotation(pdf_api *asposepdfcloud.PdfApiService, document_name string, page_num int32, output_document string, prefix string, remote_folder string) {
        // Append a new strikeout text annotation to the PDF document.
        UploadFile(pdf_api, document_name)
        args := map[string]interface{}{
            "folder": remote_folder,
        }

        new_annotation := asposepdfcloud.StrikeOutAnnotation{
            Name:                "Strikeout_Annotation",
            Rect:                &asposepdfcloud.Rectangle{LLX: 100, LLY: 350, URX: 450, URY: 400},
            Flags:               []asposepdfcloud.AnnotationFlags{asposepdfcloud.AnnotationFlagsDefault},
            HorizontalAlignment: asposepdfcloud.HorizontalAlignmentLeft,
            VerticalAlignment:   asposepdfcloud.VerticalAlignmentTop,
            RichText:            NEW_SO_ANNOTATION_TEXT,
            Subject:             NEW_SO_ANNOTATION_SUBJECT,
            Contents:            NEW_SO_ANNOTATION_CONTENTS,
            Title:               NEW_SO_ANNOTATION_DESCRIPTION,
            ZIndex:              1,
            Color:               &asposepdfcloud.Color{A: 0xFF, R: 0x00, G: 0xFF, B: 0x00},
            QuadPoints: []asposepdfcloud.Point{
                {X: 10, Y: 10},
                {X: 20, Y: 10},
                {X: 10, Y: 20},
                {X: 10, Y: 10},
            },
            Modified: "03/27/2025 00:00:00.000 AM",
        }

        _, httpResponse, err := pdf_api.PostPageStrikeOutAnnotations(document_name, page_num, []asposepdfcloud.StrikeOutAnnotation{new_annotation}, args)
        if err != nil {
            fmt.Println(err.Error())
        } else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
            fmt.Println("AppendStrikeoutAnnotation(): Failed to append annotation to the document page.")
        } else {
            fmt.Println("AppendStrikeoutAnnotation(): annotation '" + NEW_SO_ANNOTATION_TEXT + "' added to the document '" + document_name + "'.")
            DownloadFile(pdf_api, document_name, output_document, prefix)
        }
    }
 

Work with the annotations in PDF via Go SDK

Adding annotations to a PDF serves many important purposes across different use cases. One of the most common reasons is for review and feedback. Annotations let users highlight specific parts of a document, leave comments, ask questions, or suggest changes. This makes the review process more efficient and organized, especially when multiple collaborators are involved. Add the Annotations into PDF documents with Aspose.PDF Cloud Go SDK.

With our Go SDK you can

  • Add PDF document’s header & footer in text or image format.
  • Add tables & text or image stamps to PDF documents.
  • Append multiple PDF documents to an existing file.
  • Work with PDF attachments, annotations, & form fields.
  • Apply encryption or decryption to PDF documents & set a password.
  • Delete all stamps & tables from a page or entire PDF document.
  • Delete a specific stamp or table from the PDF document by its ID.
  • Replace single or multiple instances of text on a PDF page or from the entire document.
  • Extensive support for converting PDF documents to various other file formats.
  • Extract various elements of PDF files & make PDF documents optimized.
  • You can try out our free App to add the annotations into PDF files online and test the functionality.

  •