Skip to main content Skip to footer

What's New in Document Solutions for Word v7

v7.1 - April 17, 2024

Document Solutions for Word (DsWord)

Add Online Video in Word Documents

Integrating online videos into Word documents enhances dynamic visual elements, making complex concepts clearer. Additionally, it facilitates versatile content creation, promoting interactive and informative documentation for diverse purposes, from educational materials to business reports. DsWord presents the WebVideoProperties class, empowering users to customize the video player's HTML content and define its dimensions. This facilitates the seamless integration of online videos into Word documents, enabling direct playback within the document for a richer multimedia experience. The class offers the SetUrl method with three overloads, allowing users to specify the video's input URL, title, height, and width. This method generates the appropriate EmbeddedHTML string internally, providing a convenient way for users to define these parameters that may be challenging to write directly.

The following code adds an online video to the Word document:

var dsdoc = new GcWordDocument();
dsdoc.Load("wetlands.docx");
var pic = dsdoc.Body.Paragraphs[3].AddRun().AddPicture();
// Poster frame image.
byte[] imageBytes = File.ReadAllBytes("Wetlands.jpg");
pic.ImageData.SetImage(imageBytes, contentType: "image/jpeg");
pic.ImageData.WebVideoProperties.SetUrl("https://www.youtube.com/watch?v=k9UbKlBc3W4", "title", 60, 60);

Programmatically add online video in Word documents using C#

Help | Demo


v7 -December 13, 2023

Important Information: A Shift from ‘GrapeCity Documents’ to Document Solutions

In tandem with our commitment to continuous improvement, GrapeCity Documents has rebranded to Document Solutions. This change extends to the APIs and controls within the Document Solutions suite. Below, you'll find the updated nomenclature:

Document Solutions for Word (DsWord) previously GrapeCity Documents for Word (GcWord).

We've made it easy to upgrade your existing packages to the new packages using the Documents Migration tool. This tool is included in the trial Downloads zip file found on the above product links. For the v7.0 release cycle, packages with the previous product and/or company names will be provided separately, ensuring access to the same v7 new feature updates. This approach is designed to facilitate a seamless transition for users.

It's important to emphasize that despite the adoption of new package names, only the package names themselves are altered. The namespace and type names remain unchanged, eliminating the need for any modifications in your C#/VB user codes.

Picture Effects in Word .docx

In the ever-evolving landscape of document creation, the need for dynamic and visually appealing content is paramount. In response to the demand for versatile and customizable document elements, DsWord v7 introduces a robust set of features that allow users to apply a diverse range of effects to pictures. This expansion not only enhances the visual appeal of documents but also streamlines the process of incorporating Microsoft Word-supported pictures effects through code. Using these effects, you can perform following programmatically on images -

  • Change picture brightness and contrast
  • Recolor with preset
  • Change image color
  • Set transparent color
  • Overlay a specific color tint onto a picture.
  • and much more.

Following new API has been introduced -

  • RecolorType enum - Specifies the type of an image color change.
  • ImageEffectType enum - Specifies the image effect type.
  • UserColor class - Represents an extended color.
  • WebVideoProperties class - Represents the properties for displaying an online video to the user.
  • ImageEffect class - Represents a base class for image effects.
  • AlphaBiLevel class - Represents an Alpha bi-level effect.
  • AlphaCeiling class - Represents an alpha ceiling effect.
  • AlphaFloor class - Represents an alpha floor effect.
  • AlphaInverse class - Represents an alpha inverse effect.
  • AlphaModulation class - Represents an alpha modulate fixed effect.
  • AlphaModulationComplex class - Represents an alpha modulate complex effect.
  • AlphaReplace class - Represents an alpha replace effect.
  • BiLevel class - Represents a bi-level (black/white) effect.
  • ColorChange class - Represents a color change effect.
  • ColorReplacement class - Represents a solid color replacement effect.
  • Duotone class - Represents a duotone effect.
  • Grayscale class - Represents a gray scale effect.
  • HslEffect class - Represents a hue/saturation/luminance effect.
  • Luminance class - Represents a luminance effect.
  • Tint class - Represents a tint effect.
  • ImageEffectList class - Represents list of image effects.
  • EmbeddedImageData class - Represents the embedded image data.
  • PicturePreset enum addition - Picture, slightly rotated counterclockwise, with white border.

New API additions and changes to -

  • ImageData class  
  • Blur class  
  • FillOverlay class 

In following example, an image is added to a Word document and is recolored to Grayscale using DsWord API’s Picture.ImageData.RecolorType enum.

Apply picture effects to Word Docx programmatically using .NET Word API

Have a look on following resources to find more samples on applying the new effects on pictures.

Help | Demo 

New CanAdd.. methods in Content Objects, Section and Body Classes

In v7 release, you can also now use ‘CanAddCanAdd(ContentObjectType) and CanAddContentControl(ContentControlType) for ContentObject, Section and Body classes to check whether a content object can be added to the end of another content object without raising an exception. It makes it easier to determine this earlier while coding with DsWord so that the process of adding content objects at the right locations becomes easy without causing errors later. 

Example: Following code checks whether a string needs to be added to a RichText control as a paragraph or as a run.

var doc = new GcWordDocument();
var p = doc.Body.Paragraphs.Add();
var cc = p.AddContentControl(ContentControlType.RichText).Content;
if (cc.CanAdd(typeof(Paragraph))) // returns false since the content control was created on inline level
   cc.AddParagraph("Rich text");
else
   cc.AddRun("Rich text");

Help

Select Product Version...