Watermarking in Word Processing Documents

Share on FacebookTweet about this on TwitterShare on LinkedIn

A watermark in presentation software and word processing is frequently used in a slightly different manner than digital watermarks used in other digital multimedia content. This watermark is often a faded image or text used as a background of a slide or a page. It is meant to enhance, but is not the focal point of the page/slide. Watermarks are sometimes used in the form of a logo, discreetly placed on a slide or page to brand the presentation or document.

How GroupDocs.Watermark Works?

GroupDocs.Watermark is an API for adding watermarks to the documents of different formats. It provides the effective watermarking methods that allow you to add watermarks that are hard to be automatically removed by third-party tools. It also allows you to search and remove previously added watermarks of popular types (including watermarks added by third-party tools) in a document. The API provides straight forward and easy to use set of methods to add, search and remove watermarks in supported file formats. It supports following watermark types.

  • Text watermark
  • Image watermark

Watermarking in Microsoft Word Documents

When adding watermark in Microsoft Word application, it places a shape with appropriate content in section headers. GroupDocs.Watermark API uses the same approach. When calling AddWatermark method of WordsDocument class, the shape is added to a document.

You can also set some additional options when adding shape watermark to a Word document using GroupDocs.Watermark.

The Following code sample demonstrates it.

The code snippet for java guys is given below:

You can see the faded red watermark in the center of the document page like the screenshot given below:

Let’s pick some other cases to see how effectively you can do watermarking in a Word Processing document.

Adding Watermark to a Particular Section

The Microsoft Word allows the user to divide and format the document into multiple sections. Defining sections in the document enables the user to set specific page layout and formatting for different parts of the document. An example of the sections is headers and footers. Headers and footers are used to display text or any graphical object on all the pages.

GroupDocs.Watermark API allows you to add watermark objects in the headers and footers of the page. Adding watermark to a section of a Word document using GroupDocs.Watermark consists of following steps.

  1. Load the document 
  2. Create and initialize watermark object 
  3. Set watermark properties 
  4. Add watermark to the section of the document
  5. Save the document

Following code sample adds watermark to the headers of a particular section.

Java guys will write the code like below:

Locking Watermark in a Document

There might be the case when you need to lock the watermarks in a Word document to restrict the editing. To deal with such cases, the GroupDocs.Watermark provides 5 variants of locking Word document when adding watermark.

  • AllowOnlyRevisions: user can only add revision marks to the document.
  • AllowOnlyComments: user can only modify comments in the document.
  • AllowOnlyFormFields: the document is split into one-page sections and locked section with watermark is added between each two adjacent document sections.
  • ReadOnly: the entire document is read-only.
  • ReadOnlyWithEditableContent: the document is read-only, but all the content except the watermark is marked as editable.

LockType property has been added to WordsShapeSettings class to set any of the above-mentioned lock types. WordsLockType enum in GroupDocs.Watermark.Office.Words namespace is used to define the lock type.

The following code sample shows how to add and lock the watermark in all pages.

Java guys can follow the code as given below:

Removing Watermark from a Particular Section

Removing watermark from a particular section of a Word document using GroupDocs.Watermark consists of following steps.

  1. Load the document 
  2. Create and initialize image/text search criteria  
  3. Find possible watermarks
  4. Remove found watermarks 
  5. Save the document

Following code sample shows how to remove watermark from a particular section.

The code sample for Java users is given below:

The complete ready to run code sample is available on GitHub.

The post Watermarking in Word Processing Documents appeared first on Document Manipulation APIs Blog – groupdocs.com.

Posted in Conholdate.Total Product Family, GroupDocs.Watermark Product Family | Tagged | Leave a comment

Read VBA Macros, Convert to Horizontally Merged Cells, Compress Metafiles, Add Table Styles using Aspose.Words for Java 19.6

Share on FacebookTweet about this on TwitterShare on LinkedIn

In this post, I will enlist/explain new features introduced in Aspose.Words for Java 19.6 release.

Access/Read VBA Macros from Word Document

Aspose.Words now provides three classes to get access to the VBA project source code. The VBAProject class provides access to VBA project information, the VbaModuleCollection class returns collection of VBA project modules and VbaModule class provides access to the VBA project module. The code example given below shows how to read VBA Macros from the Word document:

Convert to Horizontally Merged Table Cells

In the latest versions of MS Word, Table cells are merged horizontally by their width. Whereas, the merge flags were used in the older technique, like Cell.CellFormat.HorizontalMerge. The merge flags are not used when cells are horizontally merged by their width and it is also not possible to detect which cells are merged. Aspose.Words now provides ConvertToHorizontallyMergedCells method to convert cells which are horizontally merged by their widths to the cell horizontally merged by flags. It simply transforms the table and adds new cells when needed.

The following code example shows the working of the above-mentioned method.

Compress Metafiles in Word Document

In MS Word, all the metafiles are compressed by default regardless of their size. However, Aspose.Words used to compress large metafiles only and smaller ones were not compressed just because of better performance. Aspose.Words now provides a property AlwaysCompressMetafiles, to facilitate the users if they want to compress all the metafiles either large or small. Its default value is true which means that all metafiles shall be compressed regardless of their sizes and false means that small metafiles shall not be compressed for performance reason.

Working with Table Styles

You can change the format of Table by using Table styles in MS Word. With Table style, you can change the look of Table e.g. border, shading, alignment, text font etc. In this release of Aspose.Words, new public properties have been added into the TableStyle class. We have implemented new public types ConditionalStyleCollection, ConditionalStyle, and ConditionalStyleType. Please read the following article for more details.

Working with Table Styles

License.IsLicensed Marked as Obsolete

Starting from Aspose.Words 19.6, the License.IsLicensed property is marked as obsolete. We will remove it in later releases

/// <summary>
/// Returns true if a valid license has been applied; false if the component is running in evaluation mode.
/// </summary>
[Obsolete("This property is obsolete. SetLicense() method raises an exception if license is invalid.")]
public bool IsLicensed

Obsolete methods Range.Replace Removed

We have removed the following Range.Replace methods from Aspose.Words API.

public int Replace(string pattern, string replacement)
public int Replace(string pattern, string replacement, FindReplaceOptions options)
public int Replace(Regex pattern, string replacement)
public int Replace(Regex pattern, string replacement, FindReplaceOptions options)

See also Useful Links

Keeping the Aspose tradition, you are welcome to shape the upcoming releases of Aspose.Words for Java API by posting your suggestions and concerns in the Aspose.Words for Java Support Forum.

The post Read VBA Macros, Convert to Horizontally Merged Cells, Compress Metafiles, Add Table Styles using Aspose.Words for Java 19.6 appeared first on File Format APIs Blog – aspose.com.

Posted in Conholdate.Total Product Family, Aspose.Words Product Family | Tagged | Leave a comment

GroupDocs.Signature for Java 19.5 Supports Rounded Corners for Stamp Signature

Share on FacebookTweet about this on TwitterShare on LinkedIn

Many people use stamps as part of their documents to mark them as approved or completed. For example, when a document is to be signed by the concerned person at a company, he puts his signature as well as stamps the document as a proof that the document is signed by the authorized person. In other words, the stamps are used to seal the document that is being exchanged among multiple persons/parties.

Various companies use digital signatures to sign their document using automated systems. This way, they can avoid the efforts of manually signing a bunch of documents as well as they don’t have to print the document for signatures and then scan the signed copy for distribution. If such companies have the requirement to sign as well as stamp their documents then how would they do it digitally? Well, here comes the GroupDocs.Signature that allows digital stamping of the documents.

Digital stamping is one of the salient features of the GroupDocs.Signature API. We provide a wide range of options to control the placement and appearance of the digital stamps in the document. The following is a snapshot of the document which we have stamped using our API.

In the above snapshot, you can observe that the borderlines are flat. However, some of you may want to have rounded corners for the stamp. So keeping that in mind, we have provided the support of stamps with the round corners in GroupDocs.Signature for Java 19.5. For this, we have added a new public class SquareBorderLine that inherits BorderLine to implement square stamp with rounded corners. This is how you can achieve it using the code.

The following would be the output of the above written code.

So if you want to implement this feature in your e-signing application, just download that latest release and integrate it into your application. In case you would have any query or question, do write to us on our forum.

The post GroupDocs.Signature for Java 19.5 Supports Rounded Corners for Stamp Signature appeared first on Document Manipulation APIs Blog – groupdocs.com.

Posted in Conholdate.Total Product Family, GroupDocs.Signature Product Family, GroupDocs.Signature for Java, digital document signature, digital signature, digital signature API for Java, e-sign API, e-signature, electronic signature, signature api for java, stamp signature, stamp with rounder corner | Tagged , , , , , , , , , , | Leave a comment