PNG
JPG
BMP
TIFF
RTF
eSign RTF Formats in Java
Native and high performance Microsoft Word RTF file digitall signature using Java APIs, without the use of any software like Microsoft or Open Office, Adobe PDF.
How to Sign Microsoft Word RTF File Electronically Using Java
In order to digitally sign Microsoft Word RTF document, we’ll use
API which is a feature-rich, powerful and easy to use electronic signature API for Java platform. You can download its latest version directly from
and install it within your Maven-based project by adding the following configurations to the pom.xml.
Repository
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>https://repository.aspose.com/repo/</url>
</repository>
Dependency
<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-words</artifactId>
<version>version of aspose-words API</version>
<classifier>jdk17</classifier>
</dependency>
Steps for e-Signing RTF Files in Java
A basic document digital signature can be done with just few lines of code. One can add electronic signature as drawing, text and images to multiple files. Moreover, eSigned documents can be saved as PDF, JPEG, HTML, OpenOffice and other formats.
- Create instance of Document class
- Create DocumentBuilder Object
- Load SignatureLine using builder Object
- Create SignOptions Object
- Set the Signature using SignOptions
System Requirements
Before integrating the code, make sure that you have the following prerequisites.
- Microsoft Windows or a compatible OS with Java Runtime Environment for JSP/JSF Application and Desktop Applications.
- Get latest version of Aspose.Words for Java directly from Maven .
e-Sign RTF Files - Java
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
SignatureLine signatureLine = builder.insertSignatureLine(new SignatureLineOptions()).getSignatureLine();
doc.save("Document.NewSignatureLine.rtf");
SignOptions signOptions = new SignOptions();
signOptions.setSignatureLineId(signatureLine.getId());
java.nio.file.Path path = java.nio.file.Paths.get("SignatureImage.emf");
signOptions.setSignatureLineImage(Files.readAllBytes(path));
CertificateHolder certHolder = CertificateHolder.create("temp.pfx", "password");
DigitalSignatureUtil.sign("Document.NewSignatureLine.rtf", "Document.NewSignatureLine.rtf_out.rtf", certHolder, signOptions);
Java Words API can be used to load, view and convert Microsoft Word and OpenDocument Formats like DOC, DOCX, ODT to PDF, XPS, HTML and various other formats. You can also create new documents from scratch and save them in the supported formats. It is a standalone API that is suitable for server side and backend systems where high performance is required. It does not depend on any software like Microsoft or OpenOffice.
Online RTF eSignature Live Demos
Other Supported Electronic Signature Formats
Using Java, One can digitally sign easily of many other formats including