Skip to main content Skip to footer

What's New in Document Solutions for PDF v7

DsPdf v7 - December 13, 2023

Document Solutions for PDF (DsPdf)

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 PDF (DsPdf) (previously GrapeCity Documents for PDF (GcPdf))

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 immediate modifications in your C#/VB user codes.

New Caret Annotation

Introducing the Caret Annotation in DsPdf, a powerful tool for reviewing PDF documents. The CaretAnnotation class enables precise pointing out of missing content or necessary changes programmatically. This is specially required if you need to add a CaretAnnotation at several places in the document programmatically.

Example: Following code finds a particular text and adds a CaretAnnotation after the text.

using (FileStream fs = new FileStream(@"Wetlands.pdf", FileMode.Open, FileAccess.Read))
{
        GcPdfDocument doc = new GcPdfDocument();
        doc.Load(fs);

        var page = doc.Pages[0];
        var tm = page.GetTextMap();
        // insert the CaretAnnotation after "The Importance" text
        tm.FindText(new FindTextParams("The Importance", false, true), (fp_) =>
        {
                // r - bounds of the found text
                var r = fp_.Bounds[0].ToRect();
                // create the CaretAnnotation and add it to the page
                CaretAnnotation ca = new CaretAnnotation();
                ca.Page = page;
                // in this code annotation size is hardcoded, you can make a code
                // which will adjust size of the annotation depending on height of the found text fragment
                ca.Rect = new System.Drawing.RectangleF(r.Right - 4, r.Bottom - 8, 8, 8);
         });

         doc.Save(@"doc.pdf");
}

New Caret Annotation in C# .NET PDF

Custom Time-Stamps

In certain scenarios, a service may not be able to connect and return a required timestamp from the client due to security reasons. In these scenarios, a customized timestamp service may be required to send a valid timestamp token back to the client. The client then utilizes the timestamp token to sign the PDF file, ensuring compliance with various PAdES B-T/B-LT/B-LTA levels. In short, the requirement is to customize the generation of time-stamp tokens while signing a PDF document using the PDF API. You can now accomplish the same using DsPdf in v7. The new ITimeStampGenerator interface empowers users to generate personalized time-stamp tokens seamlessly by assigning it to TimeStamp property of SignatureProperties and TimeStampProperties classes. 

Example: Following code helps generating a signature with a customized time-stamp token.

// generate the signature with time-stamp token
X509Certificate2 crt = new X509Certificate2(@"User.pfx", "**");
using (FileStream fs = new FileStream(@"EmployeeTimeSheet.pdf", FileMode.Open))
{
        GcPdfDocument doc = new GcPdfDocument();
        doc.Load(fs);

        SignatureProperties sp = new SignatureProperties();
        sp.SignatureBuilder = new Pkcs7SignatureBuilder()
        {
                    CertificateChain = new X509Certificate2[] { crt },
        };
        sp.TimeStamp = new TimeStampGenerator()
        {
              ServerUrl = @"http://ts.ssl.com",
        };
        sp.SignatureField = doc.AcroForm.Fields[0];
        doc.Sign(sp, "signed.pdf");
}

Custom Time-stamps in .NET PDF API

Help 

Document Solutions PDF Viewer (DsPdfViewer)

Floating Search Bar

DsPdfViewer, included with Document Solutions for PDF, has been supporting many advanced features to work with PDF documents, one of which is advanced search. Searching long documents with specific search terms or patterns is made easier with DsPdfViewer. DsPdfViewer’s search panel has many advanced search options and helps narrow down the scope of a search query.

In this release, DsPdfViewer introduces a Floating Text Search Bar, enhancing the search capabilities of the viewer. This feature allows users to search through documents seamlessly, providing a dynamic and user-friendly search experience. The Search icon is available by default in the toolbar of DsPdfViewer. Floating Text Search Bar is available by default in the toolbar of DsPdfViewer.

Usage:

  • Press Ctrl+F to open the floating text search bar
  • Begin typing to initiate the search, with results displayed

Note: As you start typing, the search mechanism will automatically begin searching for matches within the document, highlighting or displaying results in real-time as you type. This dynamic search process allows for immediate feedback and helps you quickly locate the relevant content you are looking for.

Floating Search Bar in JavaScript PDF Viewer

Navigate search results using the 'Previous' and 'Next' buttons.

Customize search preferences. Note: Click on the 'Settings' button to open the search settings menu, where you can customize and fine-tune your search preferences.

JS PDF Viewer Floating Search Bar Settings

Close the floating search bar by either clicking the close button or pressing the ESC key when the search input is focused.

Close Floating Search Bar in JS PDF Viewer

Apply through code

A new option, useFloatingSearchBar, has been introduced. When ‘true’, it enables the use of a floating search bar in place of the sidebar search panel. To use the sidebar search panel instead of the floating search bar, set the useFloatingSearchBar option to ‘false’

Here is how you can disable floating search bar option (revert to using the docked search panel):

var viewer = new DsPdfViewer("#root", { useFloatingSearchBar: false });

Help | Demo

Select Product Version...