Locating signature in the Word header or footer

A Word document offers a diverse selection of pre-designed headers and footers, providing you with options to enhance the design and layout of your document effortlessly. The header, positioned in the top margin, and the footer, located in the bottom margin, serve as integral sections of the document layout. Typically, headers and footers play host to supplementary details like page numbers, dates, author identification, and footnotes.

GroupDocs.Signature provides ability to locate signature in the footer and header of Word document. The ShapePosition class contains the following values

  • ShapePosition.Default - signature will be placed in the Word document body
  • ShapePosition.Header - signature will be placed in the Word document header
  • ShapePosition.Footer - signature will be placed in the Word document footer

The position is set with the setShapePosition method of TextSignOptions and ImageSignOptions, so it is also available for the options classes derived from them, such as barcode, QR code and stamp signature options.

Here are the steps to set signature mode with adding text into Word document with GroupDocs.Signature:

  • Create new instance of Signature class and pass source document path as a constructor parameter.
  • Instantiate the TextSignOptions and call its setShapePosition method
  • Call sign method of Signature class instance.

Locate Signature Area in the Word header/footer

Now, users can easily create and customize text signatures directly within the headers and footers of their Word documents.

Signature signature = new Signature("sample.docx");
try
{
    List<SignOptions> listOptions = new ArrayList<SignOptions>();

    TextSignOptions headerSign = new TextSignOptions("Hello header!");
    headerSign.setShapePosition(ShapePosition.Header);

    TextSignOptions footerSign = new TextSignOptions("Hello footer!");
    footerSign.setShapePosition(ShapePosition.Footer);

    listOptions.add(headerSign);
    listOptions.add(footerSign);

    signature.sign(outputFilePath, listOptions);
}
finally
{
    signature.dispose();
}

More resources

GitHub Examples

You may easily run the code above and see the feature in action in our GitHub examples:

Free Online Apps

Along with the full-featured Java 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.

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.