TableAbsorber.h
1
#pragma once
2
// Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3
//using System.Runtime.Remoting;
4
5
#include <system/collections/keyvalue_pair.h>
6
#include <system/array.h>
7
#include <cstdint>
8
9
#include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
10
11
namespace
Aspose
12
{
13
namespace
Font
14
{
15
class
TransformationMatrix;
16
}
// namespace Font
17
namespace
Pdf
18
{
19
class
BaseOperatorCollection;
20
class
Document
;
21
class
Operator;
22
class
Page
;
23
class
Rectangle;
24
class
Resources;
25
class
Table;
26
namespace
Text
27
{
28
class
AbsorbedCell;
29
class
AbsorbedRow;
30
class
AbsorbedTable;
31
class
TextFragment;
32
class
TextPostReplaceFixer;
33
class
TextSearchOptions;
34
}
// namespace Text
35
}
// namespace Pdf
36
}
// namespace Aspose
37
namespace
System
38
{
39
namespace
Collections
40
{
41
namespace
Generic
42
{
43
template
<
typename
>
class
IList;
44
template
<
typename
>
class
List
;
45
template
<
typename
,
typename
>
class
SortedList
;
46
template
<
typename
>
class
Stack
;
47
}
// namespace Generic
48
}
// namespace Collections
49
}
// namespace System
50
51
namespace
Aspose
{
52
53
namespace
Pdf {
54
55
namespace
Text {
56
63
class
ASPOSE_PDF_SHARED_CLASS
TableAbsorber
:
public
System::Object
64
{
65
typedef
TableAbsorber
ThisType
;
66
typedef
System::Object
BaseType
;
67
68
typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
69
ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
70
71
friend
class
Aspose::Pdf::Text::TextPostReplaceFixer;
72
friend
class
Aspose::Pdf::Text::TextFragment
;
73
74
public
:
75
82
virtual
ASPOSE_PDF_SHARED_API
System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>
get_TextSearchOptions();
89
virtual
ASPOSE_PDF_SHARED_API
void
set_TextSearchOptions(
System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>
value);
93
virtual
ASPOSE_PDF_SHARED_API
System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<AbsorbedTable>
>> get_TableList();
99
ASPOSE_PDF_SHARED_API
bool
get_UseFlowEngine()
const
;
105
ASPOSE_PDF_SHARED_API
void
set_UseFlowEngine(
bool
value);
106
114
ASPOSE_PDF_SHARED_API
TableAbsorber
(
System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>
textSearchOptions);
121
ASPOSE_PDF_SHARED_API
TableAbsorber
();
122
129
virtual
ASPOSE_PDF_SHARED_API
void
Visit(
System::SharedPtr<Page>
page);
136
ASPOSE_PDF_SHARED_API
void
Visit(
System::SharedPtr<Document>
pdf);
144
ASPOSE_PDF_SHARED_API
void
Remove(
System::SharedPtr<AbsorbedTable>
table);
154
ASPOSE_PDF_SHARED_API
void
Replace(
System::SharedPtr<Page>
page,
System::SharedPtr<AbsorbedTable>
oldTable,
System::SharedPtr<Table>
newTable);
155
156
protected
:
157
164
System::ArrayPtr<System::SharedPtr<Rectangle>
> GetCellsToRectArray(
System::SharedPtr<Page>
page);
165
166
private
:
167
168
static
const
int32_t MinimalOpenCellDimension;
169
System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>
_textSearchOptions;
170
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AbsorbedTable>
>> _tables;
171
bool
_useFlowEngine;
172
System::SharedPtr<Page>
_page;
173
System::SharedPtr<BaseOperatorCollection>
_operators;
174
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Aspose::Pdf::Rectangle>
>> _initialRects;
175
System::SharedPtr<System::Collections::Generic::List<System::Collections::Generic::KeyValuePair<System::SharedPtr<Rectangle>
,
System::SharedPtr<Operator>
>>> _tableOps;
176
System::SharedPtr<Rectangle>
_potentialRect;
177
System::SharedPtr<System::Collections::Generic::Stack<System::SharedPtr<Aspose::Font::TransformationMatrix>
>> _transformationMatrices;
178
System::SharedPtr<Aspose::Font::TransformationMatrix>
_currentMatrix;
179
180
void
Init();
181
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AbsorbedCell>
>> VisitForCells(
System::SharedPtr<Page>
page);
182
void
ParsePageContent(
System::SharedPtr<Page>
page);
183
void
ParseOperators(
System::SharedPtr<BaseOperatorCollection>
operators,
System::SharedPtr<Resources>
resources);
184
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AbsorbedTable>
>> GetTablesFromRows(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<AbsorbedRow>
>> rows, int32_t pageNum);
185
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AbsorbedRow>
>> GetRowsFromCells(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<AbsorbedCell>
>> cells);
186
static
bool
IsSameRow(
System::SharedPtr<AbsorbedRow>
currentRow,
System::SharedPtr<AbsorbedCell>
currentCell,
System::SharedPtr<Rectangle>
& mergedCell);
187
static
void
ExpandLines(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> lines);
188
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AbsorbedCell>
>> GetCells(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> horizontalLines,
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> verticalLines);
189
static
void
ParseCells(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> horizontalLines,
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> verticalLines,
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<AbsorbedCell>
>> cells, int32_t hIndex, int32_t vIndex, int32_t hNextIndex, int32_t vNextIndex);
190
static
System::SharedPtr<Rectangle>
GetIntersection(
System::SharedPtr<Rectangle>
hLine,
System::SharedPtr<Rectangle>
vLine);
191
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Rectangle>
>> AggregateVLines(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> vLineFragList);
192
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Rectangle>
>> AggregateHLines(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> hLineFragList);
193
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Rectangle>
>> SortHFragments(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> unsorted);
194
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Rectangle>
>> SortVFragments(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> unsorted);
201
static
System::SharedPtr<System::Collections::Generic::SortedList<double, System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Rectangle>
>>>> GetRangesSortedByPrimaryCoordinate(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> unsorted,
bool
IsAbscissa);
202
static
void
GetLineFragments(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> rectangles,
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>>& hLineFragList,
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>>& vLineFragList);
203
void
FillWithText(
System::SharedPtr<Page>
page);
204
void
ClearTextFragments(
System::SharedPtr<Page>
page);
205
void
NoOpPath();
206
void
OpStroke(
System::SharedPtr<Operator>
op);
207
void
OpFill(
System::SharedPtr<Operator>
op);
208
void
OpRe(
System::SharedPtr<Operator>
op);
209
void
OpPoint(
System::SharedPtr<Operator>
op);
210
void
OpLine(
System::SharedPtr<Operator>
op);
214
void
Q(int32_t opIndex,
System::SharedPtr<Operator>
op);
218
void
q(int32_t opIndex,
System::SharedPtr<Operator>
op);
219
void
cm(
System::SharedPtr<Operator>
op);
220
void
opDo(
System::SharedPtr<Operator>
op,
System::SharedPtr<Resources>
resources);
221
bool
RemoveTableOpsFromRectange(
System::SharedPtr<Rectangle>
rect,
System::SharedPtr<Page>
page);
222
223
};
224
225
}
// namespace Text
226
}
// namespace Pdf
227
}
// namespace Aspose
228
229
System::Collections::Generic::List
class ASPOSECPP_SHARED_CLASS List
Definition:
ienumerable.h:17
Aspose::Pdf::Text::TextFragment
Represents fragment of Pdf text.
Definition:
TextFragment.h:173
System::Object
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition:
object.h:64
System
Definition:
Artifact.h:67
System::Drawing::GraphicsUnit::Document
1/300 of an inch.
System::SmartPtr
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition:
fwd.h:22
Aspose::Pdf::FieldValueType::Text
Represents a text type.
Aspose
Definition:
AFRelationship.h:4
System::Collections::Generic::Stack
Stack class forward declaration.
Definition:
ImagePlacementAbsorber.h:47
System::Collections::Generic::List
List forward declaration.
Definition:
Artifact.h:74
System::Drawing::Drawing2D::CoordinateSpace::Page
The coordinates are in the page coordinate context.
System::Collections::Generic::SortedList
Sorted list wrapping FlatMap structure. Objects of this class should only be allocated using System::...
Definition:
TableAbsorber.h:45
Aspose::Pdf::Text::TableAbsorber
Represents an absorber object of table elements. Performs search and provides access to search result...
Definition:
TableAbsorber.h:63
Aspose::Pdf::Facades::SubmitFormFlag::Pdf
Whole PDF file will be submitted.