Share via


DocumentContent Class

public final class DocumentContent
extends AnalysisContent

Document content. Ex. text/plain, application/pdf, image/jpeg.

Method Summary

Modifier and Type Method and Description
static DocumentContent fromJson(JsonReader jsonReader)

Reads an instance of DocumentContent from the JsonReader.

List<DocumentAnnotation> getAnnotations()

Get the annotations property: List of annotations in the document.

int getEndPageNumber()

Get the endPageNumber property: End page number (1-indexed) of the content.

List<DocumentFigure> getFigures()

Get the figures property: List of figures in the document.

List<DocumentHyperlink> getHyperlinks()

Get the hyperlinks property: List of hyperlinks in the document.

AnalysisContentKind getKind()

Get the kind property: Content kind.

List<DocumentPage> getPages()

Get the pages property: List of pages in the document.

List<DocumentParagraph> getParagraphs()

Get the paragraphs property: List of paragraphs in the document.

List<DocumentSection> getSections()

Get the sections property: List of sections in the document.

List<DocumentContentSegment> getSegments()

Get the segments property: List of detected content segments.

int getStartPageNumber()

Get the startPageNumber property: Start page number (1-indexed) of the content.

List<DocumentTable> getTables()

Get the tables property: List of tables in the document.

LengthUnit getUnit()

Get the unit property: Length unit used by the width, height, and source properties.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from AnalysisContent

Methods inherited from java.lang.Object

Method Details

fromJson

public static DocumentContent fromJson(JsonReader jsonReader)

Reads an instance of DocumentContent from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of DocumentContent if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getAnnotations

public List<DocumentAnnotation> getAnnotations()

Get the annotations property: List of annotations in the document. Only if enableAnnotations and returnDetails are true.

Returns:

the annotations value.

getEndPageNumber

public int getEndPageNumber()

Get the endPageNumber property: End page number (1-indexed) of the content.

Returns:

the endPageNumber value.

getFigures

public List<DocumentFigure> getFigures()

Get the figures property: List of figures in the document. Only if enableLayout and returnDetails are true.

Returns:

the figures value.

getHyperlinks

public List<DocumentHyperlink> getHyperlinks()

Get the hyperlinks property: List of hyperlinks in the document. Only if returnDetails are true.

Returns:

the hyperlinks value.

getKind

public AnalysisContentKind getKind()

Get the kind property: Content kind.

Overrides:

DocumentContent.getKind()

Returns:

the kind value.

getPages

public List<DocumentPage> getPages()

Get the pages property: List of pages in the document.

Returns:

the pages value.

getParagraphs

public List<DocumentParagraph> getParagraphs()

Get the paragraphs property: List of paragraphs in the document. Only if enableOcr and returnDetails are true.

Returns:

the paragraphs value.

getSections

public List<DocumentSection> getSections()

Get the sections property: List of sections in the document. Only if enableLayout and returnDetails are true.

Returns:

the sections value.

getSegments

public List<DocumentContentSegment> getSegments()

Get the segments property: List of detected content segments. Only if enableSegment is true.

Returns:

the segments value.

getStartPageNumber

public int getStartPageNumber()

Get the startPageNumber property: Start page number (1-indexed) of the content.

Returns:

the startPageNumber value.

getTables

public List<DocumentTable> getTables()

Get the tables property: List of tables in the document. Only if enableLayout and returnDetails are true.

Returns:

the tables value.

getUnit

public LengthUnit getUnit()

Get the unit property: Length unit used by the width, height, and source properties. For images/tiff, the default unit is pixel. For PDF, the default unit is inch.

Returns:

the unit value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

DocumentContent.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to