# US 2022/0284724 A1 · Systems and methods for extracting text from portable document format data

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0284724 A1
- Document ID: US20220284724A1
- Status: Published application
- Kind: A1
- Application number: 17/682,402
- Filed: 2022-02-28
- Published: 2022-09-08
- Earliest claimed: 2021-03-02
- Assignees: Canva Pty Ltd
- Applicants: Canva Pty Ltd
- Inventors: Stephan Schwiebert; Velislava Yanchina; Henry Iguaro; Andrew Bennett
- Web page: https://patentgrep.com/patent/US20220284724A1

## CPC

- G06V 30/158: {using character size, text spacings or pitch estimation}
- G06F 40/109: Font handling; Temporal or kinetic typography
- G06F 40/151: Transformation
- G06T 3/60: Rotation of whole images or parts thereof
- G06T 11/60: Creating or editing images; Combining images with text
- G06V 30/414: Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text
- G06V 30/416: Extracting the logical structure, e.g. chapters, sections or page numbers; Identifying elements of the document, e.g. authors
- G06T 2210/12: Bounding box
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

Described herein is a computer implemented method. The method includes receiving data for an area of text of a document, the area of text containing a plurality of glyphs. A processing unit groups the glyphs into a plurality of lines based on glyph position information and for each line determines one or more paragraph attributes, wherein a difference in the one or more paragraph attributes between different lines indicates a likelihood that the different lines are in different paragraphs. Responsive to determining the one or more paragraph attributes, the plurality of lines are grouped into one or more paragraphs and an editable document is generated that contains text in paragraphs that corresponds to the one or more paragraphs.

## Claims

### Claim 1

A computer implemented method including:
receiving, at a computer processing system including a processing unit, data for an area of text of a document, the area of text containing a plurality of glyphs, each glyph associated with position information defining a position of the glyph in the document; and
by the processing unit:
grouping the glyphs into a plurality of lines based on the position information;
for each line determining one or more paragraph attributes, wherein a difference in the one or more paragraph attributes between different lines indicates a likelihood that the different lines are in different paragraphs;
responsive to the determination of the one or more paragraph attributes, grouping the plurality of lines into one or more paragraphs; and
generating an editable document containing text in paragraphs that corresponds to the one or more paragraphs.

### Claim 2 (depends on 1)

The computer implemented method of claim 1, further including, by the processing unit, prior to grouping the plurality of lines into one or more paragraphs:
determining a baseline for each of the plurality of lines; and
normalizing differences between the determined baselines.

### Claim 3 (depends on 2)

The computer implemented method of claim 2, wherein normalizing the differences between the determined baselines includes determining that adjacent lines in the plurality of lines are spaced apart beyond a threshold amount and responsive to the determination, adding one or more blank lines between the adjacent lines.

### Claim 4 (depends on 3)

The computer implemented method of claim 3, wherein the plurality of lines are horizontal lines and the method includes determining a font of the one or more blank lines as equal to a font of an upper line

### Claim 5 (depends on 1)

The computer implemented method of claim 1, wherein grouping the glyphs into a plurality of lines based on the position information includes determining a bounding box for each glyph based on the position information and grouping the glyphs based on positions of the determined bounding boxes.

### Claim 6 (depends on 5)

The computer implemented method of claim 5, further including by the processing unit:
reverting a rotation parameter of the glyphs in the data to a common rotation prior to determining the bounding box for each glyph.

### Claim 7 (depends on 1)

The computer implemented method of claim 1, wherein the one or more paragraph attributes include at least one of: font style of the glyphs in the line; font size of the glyphs and character spacing of the glyphs.

### Claim 8 (depends on 1)

The computer implemented method of claim 1, wherein:
the one or more paragraph attributes include at least two of: font style of the glyphs in the line; font size of the glyphs and character spacing of the glyphs; and
grouping the plurality of lines into one or more paragraphs includes allocating adjacent lines to different paragraphs if any one of the two or more paragraph attributes is different between the adjacent lines.

### Claim 9 (depends on 1)

The computer implemented method of claim 1, wherein the one or more paragraph attributes includes a leading spacing.

### Claim 10 (depends on 1)

The computer implemented method of claim 1, further including by the one or processors determining an alignment of each of the plurality of lines relative to the area of text, wherein the one or more paragraph attributes includes the determined alignment.

### Claim 11 (depends on 1)

The computer implemented method of claim 1, further including by the processing unit determining that a complete first word in a first line of the plurality of lines would fit within a second line that is an adjacent and preceding line in the plurality of lines and in response grouping the first line into a different paragraph to the second line.

### Claim 12 (depends on 1)

The computer implemented method of claim 1, further including determining the area by:
accessing, by a computer system including a processing unit, portable document format (PDF) data defining a plurality of glyphs;
sorting, by the processing unit the plurality of glyphs into one or more glyph sets;
calculating, for each glyph, an expanded glyph bounding box;
processing a particular glyph set to determine a distinct group of glyphs, the distinct group of glyphs including one or more glyphs from the particular glyph set which have collectively overlapping expanded bounding boxes.

### Claim 13

A computer processing system including:
a processing unit;
a communication interface; and
non-transitory computer-readable storage medium storing instructions, which when executed by the processing unit, cause the processing unit to:
receive data for an area of text of a document, the area of text containing a plurality of glyphs, each glyph associated with position information defining a position of the glyph in the document;
group the glyphs into a plurality of lines based on the position information;
for each line determine one or more paragraph attributes, wherein a difference in the one or more paragraph attributes between different lines indicates a likelihood that the different lines are in different paragraphs;
responsive to the determination of the one or more paragraph attributes, group the plurality of lines into one or more paragraphs; and
generate an editable document containing text in paragraphs that corresponds to the one or more paragraphs.

### Claim 14 (depends on 13)

The computer processing system of claim 13, wherein prior to grouping the plurality of lines into one or more paragraphs execution of the instructions causes the processing unit to:
determine a baseline for each of the plurality of lines; and
normalize differences between the determined baselines.

### Claim 15 (depends on 14)

The computer processing system of claim 14, wherein normalizing the differences between the determined baselines includes determining that adjacent lines in the plurality of lines are spaced apart beyond a threshold amount and responsive to the determination, adding one or more blank lines between the adjacent lines.

### Claim 16 (depends on 15)

The computer processing system of claim 15, wherein the plurality of lines are horizontal lines and the method includes determining a font of the one or more blank lines as equal to a font of an upper line

### Claim 17 (depends on 13)

The computer processing system of claim 13, wherein grouping the glyphs into a plurality of lines based on the position information includes determining a bounding box for each glyph based on the position information and grouping the glyphs based on positions of the determined bounding boxes.

### Claim 18 (depends on 17)

The computer processing system of claim 17, wherein execution of the instructions further causes the processing unit to:
revert a rotation parameter of the glyphs in the data to a common rotation prior to determining the bounding box for each glyph.

### Claim 19 (depends on 13)

The computer processing system of claim 13, wherein the one or more paragraph attributes include at least one of: font style of the glyphs in the line; font size of the glyphs and character spacing of the glyphs.

### Claim 20

A non-transitory storage medium storing instructions executable by a processing unit to cause the processing unit to:
receive data for an area of text of a document, the area of text containing a plurality of glyphs, each glyph associated with position information defining a position of the glyph in the document;
group the glyphs into a plurality of lines based on the position information;
for each line determine one or more paragraph attributes, wherein a difference in the one or more paragraph attributes between different lines indicates a likelihood that the different lines are in different paragraphs;
responsive to the determination of the one or more paragraph attributes, group the plurality of lines into one or more paragraphs; and
generate an editable document containing text in paragraphs that corresponds to the one or more paragraphs.
