Watermark Password Protected Documents using GroupDocs.Watermark for .NET 19.11

C# .NET Watermarking API

Another month, another release! GroupDocs.Watermark for .NET 19.11 has been released with 4 improvements and 1 bug fix. So in this article, I’ll give you a brief overview of each improvement and fix we have included in the latest release.

First of all, let’s begin with the improvements and then see what has been fixed in v19.11.

Adding Watermark to Password Protected Documents

GroupDocs.Watermark already supports adding watermark to the password protected documents. However, we have improved and simplified the usage of this feature by adding Password property to the common LoadOptions class. This is how you will add watermark to a password protected document using v19.11 or later.

FormatFamily Enum

FormatFamily enumeration has been added toGroupDocs.Watermark.Common namespace to group the supported document formats. The following groups have been made based on the type of the document:

  • Unknown – Unknown file formats.
  • Diagram – Visio formats (VSD, VSDX etc.).
  • Email – Email formats (EML, MSG, etc.).
  • Image – Image formats (PNG, JPG, etc.).
  • MultiframeImage – Multi-frame image formats (TIFF etc.).
  • Pdf – PDF format.
  • Presentation – Presentation formats (PPT, PPTX, etc.).
  • Spreadsheet – Spreadsheet formats (XLS, XLSX, etc.).
  • WordProcessing – Word processing formats (DOC, DOCX, etc.).

MultiframeImageWatermarkOptions Class

MultiframeImageWatermarkOptions class has been added to simplify the process of adding watermarks to any supported multi-frame image. The following code sample shows how to use this class.

FontNotFoundException Class for PDF Documents

There could be the case when you add a text watermark to a PDF document with a font that is not available/installed at your end. For such a case, we have added the FontNotFoundException class for the exception that is thrown when the requested font is not found.

Bug Fix

In the previous versions of the API, System.NullReferenceException was thrown when finding the possible watermarks in some of the PDF documents. This issue has been resolved and the fix is available in v19.11.

Visit the documentation to learn more about the GroupDocs.Watermark for .NET API. You can evaluate all the features of the API by downloading or cloning the source code examples from the GitHub repository. In case you find some issue, feel free to contact us via our forum.

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Watermark Product Family | Tagged , , , , , | Leave a comment

Build your full text search solution in C#

There are two main steps to perform or implement full text search.

  • Indexing
  • Search process

Before we leap into the details, let’s get an overview of this technique. Full text search is basically a more advanced way to search a text/query over a collection of documents in a computer. This approach quickly finds all instances of a term and it works by using text indexes.

One of the examples of full text search implementation is in Word processors and text editors. It helps you to find a phrase or word anywhere in the document.

API Usage

GroupDocs.Search for .NET is a full text search, back-end API that can be integrated in any .NET application without any third party tool or software dependency. It allows you to search over a multitude of document formats in your applications. To make it possible to search instantly across thousands of documents, they must be added to the index. All you have to do is to add DLL reference in your project in order to get started.

Indexing

If you are supposed to perform search over a large number of documents with different or same file formats, you need to create an index.

What is an index?

An index possesses scanned text of all the documents. Therefore, when you are going to perform a search operation (search a specific query), only the index is referenced, rather than the text of the original documents.

Index creation

It can be created in memory or on disk. An index created in memory cannot be saved after exiting your program. In contrast, an index created on disk may be loaded in the future to continue working. The following example shows how to create an index on disk.

Perform Search

When documents are indexed, the index is ready to handle search queries. Following types of search queries are supported:

  • Simple
  • Case sensitive
  • Boolean
  • Phrasal
  • Faceted

See complete list in this article.

Lets go through a use-case. Suppose we have multiple documents (Word, PDF, Excel and HTML) and we want to perform a specific search query (search term “video”) over them.

We will get document path and search term occurrences in all the documents available in documentFolder.

Lets generate output HTML with highlighted search results.

As an output, we will get 6 HTML files. Each file will show content of a different document (e.g. excel.xlsx, source.docx, target.docx) with highlighted search term/word. Given below is the output of excel.xlsx and source.docx files.

We have an open-source example project that you can use in order to evaluate API features. Go through the developer guide and if you face any issue, you can post it on forum.

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Search Product Family | Tagged , , , , | Leave a comment

Create Document Viewer in ASP.NET Core MVC for 140+ File Formats

The online document viewer applications have become popular after the grown usage of digital documents, especially in the content management systems. The reason behind this popularity is you can view a multitude of document formats without purchasing or installing dedicated software programs. Considering the importance of document viewers, I thought to write an article on how to create a universal document viewer application.

This document viewer will be an ASP.NET Core MVC application and it will target the .NET Core framework. For the document rendering at the backend, we’ll use GroupDocs.Viewer for .NET API – a powerful file viewer API which supports over 140 document types including PDF, Word, Excel, PowerPoint, Visio, CAD, Outlook, and many other popular formats.

Why .NET Core?

.NET Core is a valuable addition to the .NET ecosystem by Microsoft. It makes it possible to develop cross-platform applications without any additional efforts required by the developers. This is why I have selected .NET Core to be the targetted framework.

Steps to Create Document Viewer in ASP.NET Core

1. Create a new project in Visual Studio.

2. Select .NET Core from the project types and ASP.NET Core Web Application from templates.

3. Select Web Application (Model-View-Controller) and click Ok button.

4. Install GroupDocs.Viewer from NuGet.

5. Open Views/Home/Index.cshtml file and replace its content with the following:

6. Open Controllers/HomeController.cs and replace the content of the class with the following code.

7. Append the following styles in the wwwroot/css/site.css file.

8. Build the application and run in your favorite browser.

ASP.NET Core File Viewer

Download

The complete source code of the application is available on GitHub repository.

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Viewer Product Family | Tagged , , , , , , , | Leave a comment

Add arrow annotation in a PDF file using C#

We are living in a paper-less era. Everything in business has gone digital. If you are given a document (e.g. PDF, Word, Presentation) and asked to brief the sales achieved in 2018. What will you do? You will try to highlight or add arrow to the concerned text.

Understanding API usage

GroupDocs.Annotation for .NET is a back-end API that can be integrated in any .NET application without any third party/tool dependency. Following are the supported annotation types:

  • Area
  • Arrow
  • Distance
  • Ellipse
  • Link
  • Point

See full list of supported annotations in this article and list of supported file formats here.

Implementation

In this post we will see implementation of arrow annotation in a PDF file. Arrow annotation draws an arrow on the document like shown in the picture below.

There is an ability to specify the next properties for ArrowAnnotation type:

  • Box – defines annotation position at document page
  • Opacity – allows to set annotation opacity
  • PenColor – defines frame color
  • PenStyle – defines frame line style (solid, dash, dot etc.)
  • PenWidth –  defines frame line width in pixels

Download our open-source example project to evaluate API features. If you face any issue, please post it on forum.


Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Annotation Product Family | Tagged , | Leave a comment

Convert a PDF document to HTML using C#

Using GroupDocs.Conversion for .NET, it is possible to convert any PDF document to HTML file in C#. Conversion process or feature is not limited to PDF files only. You can convert any supported file format to HTML.
GroupDocs.Conversion for .NET is a back-end API that can be integrated in any (new or existing) .NET application.

Implementation

This API can convert any source document to a markup format which in general is a HTML conformable format.

You can see that sample PDF has some visuals and text. And the resultant HTML covers everything.

You can download our GitHub open-source example project in order to evaluate the API. If you face any API related issue, please post it on forum.

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Conversion Product Family | Tagged , , | Leave a comment

Introducing All-New GroupDocs.Signature for Java API

We are back with a major update for our customers who are using the eSign API – GroupDocs.Signature for Java. We have performed major product optimization and revamped the architecture which has made the API more memory efficient and easy to use. We have also added the support of a couple of new file formats. Let’s have an overview of this amazing release and check out what you would get after upgrading to API v2.

What is New in API v2?

We have simplified the way of signing the documents as well as improved the working of the API. Have a look at the key reasons why you should upgrade to the latest release.

  • The previous versions of the API had separate classes to deal with each supported document format. For example, we had PdfSignTextOptions class for text signatures in PDF files and WordsSignTextOptions class for Word Processing documents. But now, we have introduced a unified approach where the signature, verification, and search options are related to signature types only and not the document formats. A single class, TextSignOptions will now be used for all the document formats.
  • The Signature class is introduced as a single entry point to sign the document with various signature types as well as perform verification and search.
  • The overall document related classes that were used to deal with different document formats have been unified to common classes.
  • The API’s architecture is redesigned from scratch in order to simplify the usage of options and classes to manipulate all the signature types.
  • The procedures of getting the document’s information and generating the previews for the documents are also simplified.

How to Migrate?

The migration process is not as complex as it is supposed to be for the API versions with major updates. The legacy API has been moved into the com.groupdocs.signature.legacy package. Once you upgrade, it is required to make a project-wide replacement of imports from com.groupdocs.signature. to com.groupdocs.signature.legacy to resolve build issues.

The following is a code comparison of the previous versions with the latest one. It will give you an overview of how the coding style, the classes, and the methods have been changed.

Signing Document with Text Signature

Old Versions

Version 19.11 or Later

Setting Up Encryption for Metadata Signature

In addition to the major update, we have also added the feature of setting up the encryption for the metadata signature at the options levels. The MetadataSignOptions class provides setDataEncryption method to specify the encryption type (read more). The following code sample shows how to use this option:

Support of New File Formats

We have added the support of following file formats in the latest release:

If you are interested in migration to the latest release, just download and integrate v19.11 in your applications. We have also updated the source code examples in our GitHub repository so you can easily evaluate the API v2. For more details, consult the documentation or have a conversation with us on our forum.

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Signature Product Family | Tagged , , , , | Leave a comment

Upcoming release of GroupDocs.Classification for .NET

GroupDocs.Classification for .NET allows you to classify document or text with IAB-2 or Document taxonomies. Have a look at the image below:

You can see how API classifies an input text to IAB-2. If you haven’t already explored the online app, visit it now.

Big News

We are going to launch GroupDocs.Classification API for .NET platform very soon. That means, whatever features you can avail/evaluate in the online app, will be available in a back-end API that you can integrate in any of your (existing or new) .NET application.

Is there any dependency?

No, all you have to do is to integrate a DLL in your application and start document or text classification. As this will be a back-end API. Hence, you can implement it in your web, console or desktop application.

Lets have a look at the basic API features:

  • Raw text classification
  • Document classification
  • Classifying documents with the next format

Supported document formats:

  • Word
  • PDF
  • OpenOffice
  • TXT

Official release of the API will be announced soon. Please stick to our blog for further updates and news.

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Classification Product Family | Tagged , , | Leave a comment

Search Text or Image Signatures in Documents using GroupDocs.Signature for .NET 19.10

C# .NET Digital Signature API

With the release of version 19.10 of our electronic signature APIGroupDocs.Signature for .NET, we have introduced the features of searching text signatures and image signatures in the supported document formats. Not only this, the API now supports .NET Standard 2.0 which makes it compatible with any .NET implementation that targets .NET Standard specifications. So let’s have a brief overview of what is new, improved or fixed in the latest release.

Searching Text or Image Signatures

Text and image signatures are among the popular types of signatures for digital documents. GroupDocs.Signature supports adding text and image signatures in the supported document formats. However, there could be the case when you need to scan a document to search if a document is signed with a particular text or image. The manual inspection of the whole document or a bunch of documents is not an efficient way. To deal with such a case, we have introduced the feature of searching text or image signatures.

Searching Text Signature

GroupDocs.Signature for .NET provides various options in TextSearchOptions class for searching the text signatures including:

  • Text – The signature text to match on searching.
  • AllPages – Flag to search on each page of the document.
  • MatchType – Specifies the match types such as exact match, contains, starts with and ends with.
  • PageNumber – For searching on a specific page.
  • PagesSetup – To specify if you want to search on even/odd pages, first/last page or on the arbitrary page numbers.

The following code sample shows how to search a text signature in a document.

Searching Image Signature

For searching image signatures, the API provides ImageSeachOptions class which contains the following options:

  • AllPages – Flag to search on each page of the document.
  • PageNumber – For searching on a specific page.
  • PagesSetup – To specify if you want to search on even/odd pages, first/last page or on the arbitrary page numbers.

The following code sample shows how to search the image signature in a document.

For more details on the search feature, please visit this documentation section.

Support of .NET Standard 2.0

We received a number of requests from our customers for the support of .NET Core. Therefore, we have added the support of .NET Standard 2.0 in our latest release. Now, you can use the API in .NET Framework as well as in .NET Core for the cross-platform development.

Bug Fix

The memory leaks were found in the previous versions of the API while previewing the documents. This issue has now been fixed in v19.10.

You can download the latest version of the API to avail the above-mentioned features and fix. For running code samples, download or clone the examples project from the GitHub repository. You can also get in touch with us via our forum.

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Signature Product Family | Tagged , , , | Leave a comment

Change page orientation of a Word document in C#

Do you want to change orientation (e.g. landscape, portrait) of a single or multiple pages in a Word document? GroupDocs.Merger for .NET allows you to do this with just a few lines of code.

Usage

Below are the steps to change page orientation:

  • Initialize OrientationOptions class with desired orientation mode and page numbers
  • Instantiate Merger objectwith source document path or stream
  • Call ChangeOrientation method and pass OrientationOptions object to it
  • Call Save method specifying file path to save resultant document

Code Implementation

Have a look at the source DOCX file.

After changing orientation of first page (from portrait to landscape)

We have following helpful resources for you in order to get started:

If you face any API related issue, please post it on forum.

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Merger Product Family | Tagged , | Leave a comment

Convert to PDF using GroupDocs.Conversion for .NET and Java

There may be multiple document types in your computer which are now outdated and need to be converted into the new ones. The world is turning into a digital valley where all the businesses are optimizing themselves to turn into an industry giant. Previous year’s data are always necessary to be stored due to the nature of competition businesses face in a competitive market. The main task is to find a way through which you can convert other file formats into the required supported documents while covering other requirements. These requirements may include changing the height, width or look of these documents.

Only fifteen years ago, the task of converting a document file format into another one required extreme efforts and hard work. Even if you wanted to convert your image into PDF, you had to convert it multiple times and spend hours in front of the screen to achieve the desired result.

Why we require to convert Images into PDF?

If you are wondering why you would require to convert images into PDF or do a similar process with other file formats, there are several advantages residing in this action. Firstly, a PDF file takes up a lesser amount of space in comparison to an image. The print quality of images is completely dependent on image resolution and it is quite problematic to drop down the size of the image. PDF comes with a solution to all these problems.

GroupDocs.Conversion for .NET and Java

GroupDocs.Conversion is an easy-to-use back-end API that is available in both .NET and Java and can easily be integrated into any application. Through this API, you can convert multiple documents into a wide variety of supported file formats and image types along with feature to customize the results through flexible options.

The most common features that API allows you while converting images into PDF are Format, Width, Height, Dpi, Password and Rotate. Apart from that, you can also set zoom size, image quality and many more.

Following example demonstrates how you can convert images into PDF using GroupDocs.Conversion for .NET:


Java developers can convert images into PDF using GroupDocs.Conversion for Java with following line of codes:

See the following screenshot of resultant PDF documents:

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted in GroupDocs.Conversion Product Family | Tagged , , , , , , , , , , , , , , , , | Leave a comment