GrapeCity Documents for PDF v3.2 - August 13, 2020

Extract Text Paragraphs

GrapeCity Documents

In addition to searching and extracting lines of text, GcPdf now allows extracting entire text paragraphs from PDF documents.

Highlights of this new feature include:

Now the text search works across line breaks. Text split between separate PDF text rendering operators (but appearing in the same paragraph) can also be searched and extracted. The FindText() method will now return an array of Quadrilaterals because text search can occur across lines' bounds.

Enhanced Text Extraction Filters Redundant Text Lines

In many PDF documents, text renders multiple times in the same location, but visually it does not appear repeated in the PDF. Previously, extracting such text returned these redundant lines in the search results. With the latest release, search results will return only unique occurrences of the lines that are logically duplicated in the file.

GrapeCity Documents

Text Paragraphs in Tables

Tables with multi-line text in cells are sometimes rendered as single lines across all cells in a table row.

So a table row may look like this:

GrapeCity Documents

But a PDF operator renders it as:

Column 1 .. Column 2,

Row 1 .. Row 1

With GcPdf v3.2, "Column 1, Row 1" is recognized correctly as a paragraph.

A new member is added to ITextMap: a Paragraphs feature. This feature returns a collection of ITextParagraphobjects associated with this text map.

The following code shows how to extract text paragraphs from a page in PDF Document, through a simple collection of Paragraphs on a page.

// Print all paragraphs found on a page:
            var doc = new GcPdfDocument();
            using (var fs = File.OpenRead("Wetlands.pdf"))
            {
                doc.Load();
                var map = doc.Pages[0]; // assume that the document has at least one page
                foreach (var par in map.Paragraphs)
                    Console.WriteLine(par.GetText());
            }
            

Help | Demo

Outline (Remove) Fonts in a PDF

When a print supplier does not have access to fonts used in the PDF, the fonts must be removed before printing. GcPdf v3.2 includes page.Graphics.DrawTextAsPath. This Boolean property outlines the text and removes the fonts. The resulting PDF will look exactly like the original but with the glyphs rendered as graphics paths. This property can be used to manipulate the paths or to make it impossible to copy or search the text.

GrapeCity Documents

Visit Demo

GrapeCity Documents PDF Viewer v3.2 - August 13, 2020

Searching long documents with specific search terms or patterns is made easier with GrapeCity’s Javascript PDF Viewer. It displays the total number of search results.

Here is an example:

Proximity search

Certain words in a document may not be concurrent. The proximity search in GcPdfViewer helps find two or more words that aren’t next to each other with the new AROUND(N) operator. This support is consistent with Google's proximity search.

For example, a search for information such as 'graduation' at 'Duke University' in the year '2015', becomes: graduation AROUND(3) DUKE University AROUND(3) 2015. This will look for information that includes these words with the maximum count of words apart, specified in the AROUND(n) operator.

Help | Demo (Open Search button from left panel)

Starts/Ends With

GrapeCity Documents

Search for words starting with or ending with certain combinations of letters. Specify the query to search at the beginning or end of the word. The search will return words starting or ending with the search query.

Help | Demo (Open Search button from left panel)

GrapeCity Documents

Specifying words with a Wildcard is an advanced search technique that maximizes search results. Supported wildcards are "*", matching any number of characters and "?", matching a single character once or zero times.

Help | Demo (Open Search button from left panel)

Highlight All

GrapeCity Documents

GcPdfViewer can now highlight all search results at once using the Highlight All option. You can also change the default highlight color using the 'useCanvasForSelection' option:

var viewer = new GcPdfViewer('#root',
            {  useCanvasForSelection:
              { selectionColor: 'rgba(0, 0, 195, 0.25)',
                highlightColor: 'rgba(255, 0, 0, 0.35)',
                inactiveHighlightColor: "rgba(180, 0, 170, 0.35)" 
              }
            });
            

Visit Help | Demo (Open Search button from left panel)

Text Annotation Comment/Reply Tool

GrapeCity Documents

Review PDF documents in collaboration with other members. The PDF Editor now includes the Text Annotation Comment/Reply tool to add review comments, user names, and status of the comment.

Features included in this support:

  • Add sticky notes anywhere on the document through the context menu in the annotation’s toolbar
  • Add comments anonymously or set the user name in the property panel
  • Once set, the user name is stored on the client and used in subsequent replies
  • Edit existing notes or delete comments
  • Add a reply to the initial comment
  • Set review status for the note in UI or program to one of the following: accepted, canceled, rejected, or completed

Enable the ability to add replies or edit/remove existing replies. Configure the SupportApi project, and make sure it is connected to GrapeCity Documents for PDF (GcPdf) on the server.

If the annotation comment/reply tool is enabled without SupportApi, the tool works in read-only mode. Here’s a Demo.

Visit Help | Demo

Copy, Paste, and Clone Form Fields/Annotations in PDF Editor

GrapeCity Documents

For complex form design, use similar properties in all the form fields without manually setting them in each field. Copy and paste fields on the PDF form using the shortcut keys or clone the field using the Clone button in the Properties panel. Or copy and paste or clone annotations in the PDF Editor.

Visit Help | Demo

Align PDF Form Fields and Annotations

GrapeCity Documents

GrapeCity Documents PDF Editor now includes snap lines and snap margins to check the alignment of form fields and annotations in relation to each other. This allows users to align two elements (fields/annotations) to the same location within the document while designing PDF forms. Other features include:

  1. Enable or disable snap alignment change alignment precision
  2. Snap to margins of a page or a control
  3. Enable, disable horizontal/vertical snap margin
  4. Use the keyboard shortcuts to snap horizontally or vertically
  5. Use keyboard shortcuts to increase or decrease the size of the fields

Visit Help | Demo

Custom Context Menu

GrapeCity Documents

Customize the context menu of GcPdfViewer and search selected text with any search engine.
Visit Demo

GcPDF v3.1 - March 26, 2020

Redact Content from PDF Files

Redaction in PDF Documents is an essential function to hide or remove specific confidential information before it is distributed over the web or printed. Since a PDF is not editable, redaction becomes vital to hide or remove the content that is not supposed to be shared. Also, users should not be able to copy/paste the redacted content in other documents. With the new release, GcPdf adds GcPdfDocument.Redact method to remove the content marked for redaction. You can remove content from multiple regions from a PDF document at one go or choose to remove material from a specific area.

With GcPdf, you can find all instances of text like a password, SSN, Name, Address, or some other sensitive info and mark the content for redaction or removal from the document. You can also provide OverlayText and OverlayFillColor that will appear over the redacted content, once removed from the PDF.

Applying redaction is a feature not easily found in many PDF readers, including the readers available for free. With the new Redact method, you may not have to open each PDF manually in a third-party PDF reader and remove content. Just use the GcPdf API to remove the content in a batch of PDF documents. Also, you get the power of using all supported PDF Features in an API necessary to perform redactions in a report.

The following PDF document redacts the customer's information to share it across for review to other members of the organization.

With GcPdf, the redactions can be of any kind. You can change the content with color and add a replacement text, and render it on that location. Also, GcPdf's apply redaction feature will completely wipe out the content from the PDF so that it cannot be fetched with any other PDF tools. This can be difficult to do through a UI in Acrobat (the free version of which does not include the Apply redaction feature).

With the new release, our JavaScript-based GrapeCity Documents PDF Viewer includes a feature to redact content from PDF Documents (through annotation editing tools), which are configured by connecting the viewer to GcPdf on the server.

Read the full Annotation, Redact, and Form Editor for PDFs release article.

Visit our demo for more details.

Help | Demo

Extract Signature Information from a Signature in an Existing PDF

Sometimes, you may need to extract signature information from a digitally signed PDF document and use that information to check the validity of a signature.

GcPdf introduces Signature.Content property that allows you to retrieve additional information from Signature's binary data. The information provides the parameters from its issuance and can be informational. However, you may need to verify the specific fields in the certificate. For example, a serial number lets you to know if you are referencing the correct certificate (it is always helpful to keep a check on the validity of the certificate).

The Not After, Not Before fields help troubleshoot other problems that may occur due to the binding dates of the certificate.

The following are the main fields (in addition to many other fields) that you can extract from a certificate:

  • Issuer
  • IssuerName
  • NotAfter
  • NotBefore
  • PrivateKey
  • PublicKey
  • RawData
  • SerialNumber
  • SignatureAlgorithm
  • Subject
  • SubjectName
  • Thumbprint
  • Version

Visit Help

GcPDF Viewer v3.1 - March 26, 2020

New Editing Tools

Do you have a PDF report that you want to send for review to your stakeholders who would need to make changes to the document?

Do you need to modify PDF documents online and save it on the client without wait time to the server?

Do you need to design a feedback PDF form so your customers can fill it out and submit, using only a single tool?

This release offers a tool that allows you to view, review, edit PDF documents, design PDF Forms, save, and submit PDF Forms from a single viewer. The enhanced PDF Viewer includes several new editing tools: Annotation Editor, a Form Editor, and additional editing features.

These new features allow you to create a full workflow of loading, editing, designing, reviewing, and saving PDF documents and PDF forms within your apps.

GcPDF v3 - October 30, 2019

With this release, GcPdf adds additional features to program PDF documents in .NET Core applications. The main highlight of this release is the ability to convert HTML content to PDF.

Rendering HTML Content to a PDF

Render HTML Content to PDF

If you want to save desktop web pages (or if you try to print directly) you may experience the following issues:

  • CSS styles responsible for displaying pages effectively on any device may not render well
  • Background images are sometimes lost
  • Layout and flow of pages may not be the same upon printing

Why Convert HTML to PDF?

Example: An eCommerce site presents a customer invoice on the web page shopping cart and then prints the invoice to include with the order. As mentioned above, there may be issues when printing HTML content directly to a printer, or sharing the HTML with customers. The formatting may not be preserved, and the layout and styles may not be supported, if the HTML invoice is viewed offline.

A PDF format is a preferred choice for viewing and document sharing. PDF formats are the most reliable document format to view web content offline, since the document format is preserved regardless of platform or device. The invoice HTML conversion needs an automated process, as several invoices are generated through the day.

Developing such applications would benefit from an API that can convert the HTML content to a PDF.

GrapeCity Documents for HTML

You can now convert HTML content to PDF using the new GrapeCity Documents for HTML (GcHtml) package (a utility package for GcPdf and GcImaging) available with the GcPdf/GcImaging packages. It is a platform independent package that allows you to convert HTML content to PDF documents or images (PNG or JPEG).

It provides a set of extension methods DrawHtml() and MeasureHtml() to draw or measure HTML content on an instance of GcPdfGraphics. This helps to insert HTML fragments into PDF documents along with other content. HTML rendering is done using the industry standard Chrome web browser engine working in headless mode, offering advantages of rendering HTML to PDF on any platform (Windows, Linux, and macOS). Users can additionally set various PDF settings while converting HTML to PDF. There is no additional license required to run GcHtml.

The package: GrapeCity.Documents.Html includes the GcHtmlRenderer class, the main class that can render HTML content in PDF Pages.

Internally, it uses one of 3 system-dependent HTML engine packages:

  • GrapeCity.Documents.Html.Windows.X64
  • GrapeCity.Documents.Html.Mac.X64
  • GrapeCity.Documents.Html.Linux.X64

GcHtml will automatically select the correct system-dependent engine package at runtime, but that package must be referenced by your project so that GcHtml can find it. You can add references to all three platform packages to your project, or only target one or two platforms, just add the relevant packages for the target platforms.

Key Features

  • Multi-platform package to render HTML content on Windows, macOS or Linux
  • Renders HTML content from a page/URI source or HTML string to PDF
  • Supports:
    • Images
    • Hyperlinks
    • CSS
    • JavaScript
    • HTML5
    • Page breaks
    • SVG
    • HTML tables
  • Supports PDF settings:
    • Default background
    • No background
    • Page height
    • Page width
    • IgnoreCSSPageSize
    • Landscape
    • Scale
    • Page ranges to specify which pages should be rendered in the output PDF file
    • DisplayHeaderFooter
    • Define Header/Footer templates
  • Split long HTML content into multiple pages
  • Specify page margins

Getting started with HTML to PDF conversion

Also visit:

Help | GcHtml Architecture | Demo

Import Form Data Submitted from the Client to PDF

GcPdf adds new GcPdfDocument.ImportFormDataFromCollection() method. This method makes it easy to take field names/value lists sent by a form submit and imports it into similarly structured PDF Forms. Almost no code is needed to manipulate that data.

Visit our Demo for more details.