Join Images using GroupDocs.Merger for Java 19.8

With the new release of GroupDocs.Merger for Java 19.8 you can take your document joining experience to the next level.
What is special about this release?
We are pleased to announce that you can now do image joining. And following are the supported image formats:

  • BMP
  • PNG
  • TIFF

How easy is that?
Let’s understand this with a use-case. We’ll join a BMP and TIFF file.

New Format Support
API now fully supports HTML format.


We’d recommend you to download the latest release and integrate it in your application. In case you find any issue, feel free to post on forum.



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

It’s Time to Upgrade to GroupDocs.Viewer for .NET v19.8

GroupDocs.Viewer for .NET has been serving the developers in creating the document viewer applications for many years. With the efforts of our hard-working team and the support of our valuable customers, we are able to make the API stand among the top-ranked document viewer APIs. Since the Sky is the only limit, we always keep on enriching the API with more features, improving its performance, and making its usage easier for the developers. And today, I am excited to announce that we have introduced a new public API for GroupDocs.Viewer for .NET with major improvements.

In the latest version of the API (v19.8), we’ve improved the architecture of the API to simplify its usage and make it even easier to build applications. With the major product optimization, the API now consumes fewer resources as compared to the previous versions. Whereas, the document rendering speed has been improved significantly.

Let me give you a few reasons why you should switch to the v19.8 of GroupDocs.Viewer for .NET.

  • Memory usage – Significantly improved and optimized API’s memory usage (from 10% to 400% approx. depending on the document type ).
  • Improved rendering speed – The overall rendering speed has been improved remarkably. 
  • Code optimization – Optimized public API to make it even more intuitive and simple (with only a few lines of code you will be able to perform any action which required 20+ lines of code in the previous version).
  • Single entry point – A single class to manage the document rendering process for any supported file format.
  • Easy to use – API now gives more options to the developer in terms of usage and creativity.

With the major updates, the public API of GroupDocs.Viewer for .NET has undergone significant changes. As a result, the usage of the classes and their properties and functions has also been changed. Let’s now check the difference between the coding styles of the new and old version of the API.

This is how we used to get the HTML representation of the document with embedded resources using the old version:

Now, have a look at how we can perform the same operation using the new API.

Have you noticed that the code has been shrunk significantly to fewer lines of code in the coding style of the new API? Also, you don’t have to create separate handlers for HTML and image representation. Instead, just create a Viewer class and control its behavior using the classes that extend ViewOptions i.e. HtmlViewOptions, PngViewOptions and so on.

Now, as a developer, it is obvious that you would think about how would you deal with breaking changes in code after upgrading to the version which contains the major updates. So let me make it easier for you. In the latest version, the legacy API has been moved into the Legacy namespace. Therefore, after you upgrade to version 19.8, it is required to make project-wide replacement of namespaces only. This means that the namespaces will be changed from GroupDocs.Viewer.* to GroupDocs.Viewer.Legacy.* to resolve build issues. And that’s it!

Alright! So now, its time to switch to the latest version. I would recommend you to first explore the documentation of the new API with the help of the source code examples. Once you try it yourself, you will get a better idea of how useful it’ll be for you to switch to the latest version. You can also consult the release notes as well as the migration notes.

In case you would find the migration process difficult for you, feel free to post on our forum.

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

Adding Ellipse Annotation in a PDF Document

GroupDocs.Annotation API

GroupDocs.Annotation comes with an extensive set of tools that you can use to easily add common shapes to your documents as an annotation. The list of tools is not limited to area, point, text, polyline, etc. In this section, we will primarily discuss how the Ellipse annotation could be added in a PDF document by using GroupDocs.Annotation API.

Adding Ellipse Annotation

While discussing the family of annotation types, we cannot ignore ellipse annotation. It could be regarded as a multi-purposed annotation type. For example, it could be used to display extra information on your graphs or you can use it to circle important information. AnnotationInfo could be used to set color, page, opacity, creator name and many more. At minimum following two properties of AnnotationInfo have to be set for drawing an ellipse, which determine the size and type of the annotation:

Fixed valueAnnotationType.Ellipse is always used as Type for adding an Ellipse Annotation.

Code Example for a PDF Document

For adding ellipse to a PDF document, first we will need to get the document in form of Stream by using following line of code:


Then the Ellipse annotation is added to the list of annotations:
Finally, we will export the annotation and save the output file:
This way we have added an Ellipse annotation to our PDF document using GroupDocs.Annotation API.

The complete C# code will look like this:


The code in Java will look like this:
After adding Ellipse annotation the output document will looks like following screenshot:

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

Searching in a Large Number of Documents

Usually, a searching software is able to achieve fast search responses because, instead of searching the text directly, it searches an index. This would be the equivalent of retrieving pages in a book related to a keyword by searching the index at the back of a book, as opposed to searching the words in each page of the book.

Using GroupDocs.Search for Indexing and Searching

Problem: Suppose you have 10 million documents of different file formats, e.g. MS Word, Spreadsheets, Presentations, etc. Due to limited memory size, you cannot store more than 5% of the entire data. Now the main issue is how to apply indexing and searching in this case.

Solution: The GroupDocs.Search for .NET provides many ways to perform search operations on any size of document collections. It is capable in indexing various types of documents and perform searches on it. The API supports searching for:

  • Text occurrences
  • Basic metadata fields
  • File names
  • Document types

Moreover, it allows searching on the basis of different search query types. The advanced search (e.g fuzzy search, synonyms search, boolean search) is also supported.

Creating Index

Let’s try the GroupDocs.Search API for indexing the bulk of documents of different file formats(see the supported formats list). Although, the Index can be created in memory, but here, let’s create it on disk. You just need to follow these simple steps:

  • Create a directory for Indexing
  • Create another directory and copy all the required documents into it.
  • Come to the code and firstly initialize Index object by passing the path of the index directory
  • Add documents using AddToIndex(“Documents_Folder_Path”) method of Index object.

The C# code will look like this:

Java guys can write the code like this:

After creating Index you will see the files in the Index folder like following screenshot:

Searching The Terms

The GroupDocs.Search allows various kinds of queries for search operations with more advance features. Please see this article for the detail.

Lets come to the code.

Suppose, the index has been already created as described in the above section. Let’s simply search a term. Follow the steps as written below:

  • Instantiate Index by passing index folder path
  • Search the term using Index.Search() method which will return SearchResults object.
  • Show list of searched files

The C# code will look like:

Java developers can write the code like this:

The output will be appeared like the following screenshot:

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

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

Add Ellipse Annotation in Multiple Documents

We are always keen to make our APIs rich in features and enhance usability. When we talk about annotation types. One cannot neglect ellipse annotation. Its a multi purposed annotation type. For instance you can use it to display extra information on your gauge or capture graph hits against a target line. Previously, Ellipse annotation was implemented in .NET version and it seemed very useful. We are pleased to announce that Ellipse annotation is now added in GroupDocs.Annotation for Java 19.7. Java users can implement this annotation as follows:


This is how ellipse annotation will look like:

You can also set ellipse color, pen style (e.g. dash, dot, solid), pen width. AnnotationInfo class gives you access to such properties.
You might be wondering, what documents are actually supported for the ellipse annotation? Currently, this annotation is supported for the following file formats only:

  • PDF
  • Word
  • Slide
  • Image
  • Cell
  • Diagram

Setting Watermarks Angle
We’ve added ability to set text watermark angle. The process is same as adding Watermark annotation, but you should additionally set Watermark rotation angle by setting AnnotationInfo.Angle property (in degrees).


Aside new features, we’ve also fixed some bugs:

  • Only first page is saved in output when Multi-Tiff file is annotated
  • Import annotations for Images doesn’t close stream
  • Annotation not apply if page number not defined in Words

We’d recommend you to download and integrate latest release of the API and share your concerns on forum.

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

Restart the List Numbering Dynamically within Your Document

Nested or the multi-level numbered lists allow you to group the items based on the parent item. Put it simply, you can separately list the items under each group. This becomes very useful when you have to list the items having multiple sub-items. Let’s have a look at the following figure which makes it simpler to understand the scenario.

In this figure, you can observe that there are listed 3 groups and each group further has multiple items listed under it. So, in such cases nested numbered list is used.

Lets now check out how could you populate a numbered list within your Word documents using GroupDocs.Assembly. Assume that you have the Order and Service classes defined in your application in such a way that each order instance has multiple services. The following template will be used to output the orders along with the services they have using the API:

The Word document that will be generated in the result of the above template will contain the following listing:

The perfect output, isn’t it? No, not at all. You would have noticed that the numbering of the list is disturbed. Yes, the numbering sequence is continued and it hasn’t restarted for the second list. Well, this is the expected behavior when you generate the numbered list using this template.

So how would you deal with such a situation when you want to restart the list’s numbering? Well, believe me, it is as simple as a pie. Just place a restartNum tag before the inner foreach and you are done.

This is how the updated version of the template will look like. We have now placed restartNum tag to restart the list numbering for each order.

And what we have got in the output is:

Perfect!

At the moment, you can restart the list numbering within the Word Processing documents as well as email messages with HTML and RTF bodies.

So if you want to have this feature in your application, just download and integrate v19.7 of GroupDocs.Assembly for .NET or Java. For working code samples, download or clone the examples project from the GitHub repository. Cheers!

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

Control Documents Comparison Sensitivity

Integrate GroupDocs.Comparison for .NET 19.6 in your project and take control of documents comparison sensitivity. Detecting source and target documents style changes or inserted/deleted items and then highlighting them in the resultant file is a common yet major feature.

But we have something new, something enormous for you. You can now get detailed comparison of the documents. In ComparisonSettings class we added SensitivityOfComparison method using that you can set sensitivity of documents comparison. Let’s see its implementation and then details.

This option defines limit in percentage, when element is detected as deleted or inserted. There are three values/percentages.

Minimal value
Minimal value is 0, comparison process does not occur for any length of sequences of two compared objects.

Value by default
The default percentage is 75, comparison occurs when the percentage of deleted or inserted elements in relation to all elements does not exceed 75%.

Maximum value
That is 100%. Comparison occurs at any length of a common sub-sequence of two compared objects.

Now let’s understand this with a use-case. Suppose we have two words:

  1. oneSource
  2. twoTarget

These two words have very small common sub-sequence. Therefore, when comparing them at 75% accuracy, it is not taken into account and we get a completely removed and inserted word as follows:

(twoTarget)[oneSource]

But at 100% accuracy, this sub-sequence will be treated or represented in a different way, despite the fact that it consists of two letters.

(tw)o[n](Targ)e[Source](t)

Isn’t it amazing? You can now get briefed comparison results by just controlling the sensitivity.

Let’s see the major issues that are now resolved in this release:

  • Duplicate Images in Result file in PDF
  • PDF comparison has overlapping and mangled output
  • Text got overlapped with other text or images
  • Merged Documents and then comparing them fails

You must give a try to GroupDocs.Comparison for .NET API and share your feedback and concerns on forum. Download latest version of the API here.



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

Get Image Representation of Document Pages

Getting image representation of document pages is one of the most successful feature that is already implemented in .NET version of the API. Keeping your interest in view, we’ve now implemented this feature for Java developers. GroupDocs.Comparison for Java 19.6 allows you to save document comparison results in image format as well.
What does it take to implement such a feature?
You just have to pass the output folder path to convertToImages method and API will take care of conversion mechanism itself.
Let’s have a look at the implementation:

Is there a way to set document size when comparing image with different formats?
We added a class OriginalSize using that you can set document size when comparing image with different formats, this size will be used when document is converted to the picture. Given below are the methods:

  • getHeight()
  • getWidth()
  • setHeight(int value)
  • setWidth(int value)

There are also bug fixes and improvements introduced in this release. Let’s have a look at the prominent ones.


Bug Fixes

  • Font detection exception
  • Word separation exception
  • Html MarkDeletedInsertedContentDeep Bug
  • Deleted items in comparison output is not as expected
  • Incorrect difference info in PDF

Improvements

  • Improve HTML aligner
  • TableFormatSetter for Slides is improved now
  • Html Anchors comparing
  • StyleSheet Comparer for Html

We’d recommend you to download and integrate this release in your project and enhance your document comparison experience. Do share your feedback or concerns on forum.


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

Viewing CAD Documents

CAD (Computer-Aided Design) files may contain 2D or 3D designs. They are generated by CAD software programs, which can be used to create models or architectural plans. 2D CAD files are often referred to as drawings, while 3D files are often called models, parts, or assemblies.

The AutoCAD is arguably the most prevalent CAD software on the market. It’s used by professionals and hobbyists alike. If you work with CAD, you’re likely to already be familiar with some of AutoCAD’s most common file formats, such as DWG and DXF

Render the CAD Files using GroupDocs.Viewer

The CAD file formats such as .dwg, .dgn, .dxf, .dwf, .ifc and .stl are also included in the wide range of GroupDocs.Viewer API’s supported file formats

Let’s pick a .dwg file and discuss some of the cases to view the using GroupDocs.Viewer API.

When CAD documents are rendered, the size of the rendering result is adjusted by API automatically depending on the size of the initial document.

You can also adjust the size of the resulting document by setting CadOptions in the following way.

  • Create ViewerHandler
  • Create ImageOptions
  • Set ImageOptions.CadOptions.Heightand ImageOptions.CadOptions.Width properties
  • Call GetPages

The Following code sample demonstrates it.

Java guys will write the code like below:

Rendering CAD Model along with Layouts

Representation of a CAD File with non-empty layouts

When CAD documents are rendered, by default we get only Model representation. In order to render Model and all non-empty Layouts within CAD document, the property CadOptions.RenderLayouts of ImageOptions and HtmlOptions is used.

Following are the steps to render all the non-empty layouts along with the Model.

  • Create HtmlOptions/ImageOptions 
  • Set CadOptions.RenderLayouts of HtmlOptions/ImageOptions to true
  • Call GetPages

The following code sample shows how to render layouts along with the Model of a CAD document.

Java guys will write the code like below:

Working with Layers

Using layers in CAD documents is a way of organizing objects in the drawing by associating them with a specific function or a purpose. For example, when we have a complex drawing of the building, all objects can be divided (associated) into several layers – e.g. electrical, water plumbing, furniture, walls and so on. According to your needs, you can temporarily hide or show some of the objects by turning off their layers. GroupDocs.Viewer allows you to get the list of layers from the drawing and supports rendering specified layers.

Getting List of Layers

The following are the steps to get the list of layer names from a CAD document.

  • Create ViewerHandler (ViewerHtmlHandler or ViewerImageHandler)
  • Get document’s information in DocumentInfoContainer object using GetDocumentInfo method
  • Cast the DocumentInfoContainer object returned by GetDocumentInfo with CadDocumentInfoContainer
  • Access each layer using CadDocumentInfoContainer.Layers collection

The following code sample shows how to get the list of the layers in a CAD document.

Java guys will write the code like below:

Rendering Specific Layers

After you have got the list of layers contained in the drawing, you can specify those that you want to render by adding layer names into the CadOptions.Layers property of corresponding RenderOptions (ImageOptions or HtmlOptions). Please note, when you do not specify layers, all layers are rendered. 

The following code sample shows how to render a specific layer of a CAD document.

Java guys will write the code like below:

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

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