# US 2022/0284175 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/0284175 A1
- Document ID: US20220284175A1
- Status: Published application
- Kind: A1
- Application number: 17/682,718
- 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
- Web page: https://patentgrep.com/patent/US20220284175A1

## CPC

- G06F 40/166: Editing, e.g. inserting or deleting
- G06V 30/414: Extracting the geometrical structure, e.g. layout tree; Block segmentation, e.g. bounding boxes for graphics or text
- G06F 40/109: Font handling; Temporal or kinetic typography
- G06F 40/151: Transformation
- G06F 40/205: Parsing
- G06F 40/279: Recognition of textual entities
- G06V 30/10: Character recognition
- G06V 30/158: {using character size, text spacings or pitch estimation}
- G06F 40/10: Text processing (natural language analysis G06F40/20; semantic analysis G06F40/30; processing or translation of natural language G06F40/40)
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

Described herein is a computer implemented method. The method includes accessing, by a computer system including a processing unit, portable document format (PDF) data defining a plurality of glyphs, sorting the plurality of glyphs into one or more glyph sets, and calculating an expanded glyph bounding box for each glyph. Each glyph set is processed to determine one or more text areas, each text area being associated with one or more glyphs from the glyph set which have collectively overlapping expanded bounding boxes.

## Claims

### Claim 1

A computer implemented method including:
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 each of the one or more glyph sets to determine, for each glyph set, one or more text areas, each text area being associated with one or more glyphs, and wherein processing a given glyph set to determine one or more text areas includes:
identifying distinct groups of glyphs from the particular glyph set, each distinct group of glyphs including one or more glyphs from the particular glyph set which have collectively overlapping expanded bounding boxes; and
associating each distinct group of glyphs from the given glyph set with a separate text area.

### Claim 2 (depends on 1)

The computer implemented method of claim 1, wherein the expanded bounding boxes of glyphs from a given glyph set that have been associated with one text area do not overlap with expanded bounding boxes of other glyphs from the given glyph set.

### Claim 3 (depends on 1)

The computer implemented method of claim 1, wherein each glyph set has one or more set values, and wherein sorting the plurality of glyphs into the one or more glyph sets includes, for each glyph from the plurality of glyphs:
determining one or more grouping attribute values for the glyph; and
associating the glyph with a glyph set that has one or more set attribute values that correspond to the particular glyph's one or more groping attribute values.

### Claim 4 (depends on 3)

The computer implemented method of claim 3, wherein the one or more grouping attribute values include one or more of: a font type attribute value; a font size attribute value; a rotation attribute value.

### Claim 5 (depends on 1)

The computer implemented method of claim 1, further including calculating a bounding box for each text area, the bounding box for a particular text area calculated based on the expanded bounding boxes of the glyphs which have been associated with the particular text area.

### Claim 6 (depends on 1)

The computer implemented method of claim 1, wherein calculating the expanded glyph bounding box for a given glyph includes:
calculating an initial bounding box based on the PDF data; and
applying an expansion factor to the initial bounding box to calculate the expanded bounding box.

### Claim 7 (depends on 6)

The computer implemented method of claim 6, wherein applying an expansion factor to the initial bounding box includes applying a horizontal expansion factor to horizontally expand the initial bounding box and applying a vertical expansion factor to vertically expand the initial bounding box, the horizontal expansion factor being different to the vertical expansion factor.

### Claim 8 (depends on 6)

The computer implemented method of claim 6, wherein the initial bounding box is a glyph space bounding box and calculating the expanded glyph bounding box further includes transforming the glyph space bounding box to a document space bounding box, the document space bounding box being in a coordinate space of a document the glyph is to be rendered in.

### Claim 9 (depends on 6)

The computer implemented method of claim 6, wherein the expanded glyph bounding box for a given glyph includes data from which a set of expanded glyph bounding box coordinates can be determined, the set of expanded glyph bounding box coordinates including a minimum x coordinate, a maximum x coordinate, a minimum y coordinate, and a maximum y coordinate.

### Claim 10 (depends on 9)

The computer implemented method of claim 9, wherein the minimum x coordinate and maximum x coordinate are based on a glyph width defined in the PDF data and associated with the glyph.

### Claim 11 (depends on 9)

The computer implemented method of claim 9, wherein the minimum y coordinate and maximum y coordinate are based on a glyph y coordinate and a glyph height, the glyph y coordinate being calculated based on a bounding box y value and a descent value that are defined in the PDF data and associated with the glyph.

### Claim 12 (depends on 11)

The computer implemented method of claim 11, wherein the glyph height is based on a CapHeight value defined in the PDF data and associated with the glyph.

### Claim 13 (depends on 11)

The computer implemented method of claim 11, wherein the glyph height is based on a bounding box height value defined in the PDF data and associated with the glyph and the descent value defined in the PDF data and associated with the glyph.

### Claim 14 (depends on 1)

The computer implemented method of claim 1, wherein:
processing each of the one or more glyph set to determine, for each glyph set, one or more text areas includes determining a first text area associated with glyphs from a first text set and determining a second text area associated with glyphs from a second text set; and
the method further includes:
determining if the first text area and the second text area are compatible;
in response to determining that the first text area and the second text area are compatible, determining if the first text area encompasses the second text area; and
in response to determining that the first text area fully contains the second text area, merging the first and second text areas into a single text area by:
associating the glyphs associated with the first text area with the single text area; and
associating the glyphs associated with second third text area with the single text area.

### Claim 15 (depends on 14)

The computer implemented method of claim 14, wherein the first text area and second text area are determined to be compatible if they are associated with glyphs that have the same rotation.

### Claim 16 (depends on 14)

The computer implemented method of claim 14, further including:
determining a particular attribute for which glyphs associated with the single text area have different values;
generating a common value for the particular attribute; and
associating the common value with the glyphs associated with the single text area.

### Claim 17 (depends on 16)

The computer implemented method of claim 16, wherein
the particular attribute is a font size attribute; and
generating a common value includes determining a font size based on the font sizes of the glyphs associated with the single text area.

### Claim 18 (depends on 16)

The computer implemented method of claim 16, wherein
the particular attribute is a font type attribute; and
generating a common value includes determining a font type based on the font types of the glyphs associated with the single text area.

### Claim 19

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:
access portable document format (PDF) data defining a plurality of glyphs;
sort the plurality of glyphs into one or more glyph sets;
calculate, for each glyph, an expanded glyph bounding box;
process each of the one or more glyph sets to determine, for each glyph set, one or more text areas, each text area being associated with one or more glyphs, and wherein processing a given glyph set to determine one or more text areas includes:
identifying distinct groups of glyphs from the particular glyph set, each distinct group of glyphs including one or more glyphs from the particular glyph set which have collectively overlapping expanded bounding boxes; and
associating each distinct group of glyphs from the given glyph set with a separate text area.

### Claim 20

A non-transitory storage medium storing instructions executable by a processing unit to cause the processing unit to:
access portable document format (PDF) data defining a plurality of glyphs;
sort the plurality of glyphs into one or more glyph sets;
calculate, for each glyph, an expanded glyph bounding box;
process each of the one or more glyph sets to determine, for each glyph set, one or more text areas, each text area being associated with one or more glyphs, and wherein processing a given glyph set to determine one or more text areas includes:
identifying distinct groups of glyphs from the particular glyph set, each distinct group of glyphs including one or more glyphs from the particular glyph set which have collectively overlapping expanded bounding boxes; and
associating each distinct group of glyphs from the given glyph set with a separate text area.
