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
namespace
Operators
23
{
24
class
ConcatenateMatrix;
25
class
LineTo;
26
class
MoveTo;
27
class
Re;
28
}
// namespace Operators
29
class
Page
;
30
class
Rectangle;
31
class
Resources;
32
class
Table;
33
namespace
Text
34
{
35
class
AbsorbedCell;
36
class
AbsorbedRow;
37
class
AbsorbedTable;
38
class
TextFragment;
39
class
TextPostReplaceFixer;
40
class
TextSearchOptions;
41
}
// namespace Text
42
}
// namespace Pdf
43
}
// namespace Aspose
44
namespace
System
45
{
46
namespace
Collections
47
{
48
namespace
Generic
49
{
50
template
<
typename
>
class
IList;
51
template
<
typename
>
class
List
;
52
template
<
typename
,
typename
>
class
SortedList
;
53
template
<
typename
>
class
Stack
;
54
}
// namespace Generic
55
}
// namespace Collections
56
}
// namespace System
57
58
namespace
Aspose
{
59
60
namespace
Pdf {
61
62
namespace
Text {
63
70
class
ASPOSE_PDF_SHARED_CLASS
TableAbsorber
:
public
System::Object
71
{
72
typedef
TableAbsorber
ThisType
;
73
typedef
System::Object
BaseType
;
74
75
typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
76
ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
77
78
friend
class
Aspose::Pdf::Text::TextPostReplaceFixer;
79
friend
class
Aspose::Pdf::Text::TextFragment
;
80
81
public
:
82
89
virtual
ASPOSE_PDF_SHARED_API
System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>
get_TextSearchOptions();
96
virtual
ASPOSE_PDF_SHARED_API
void
set_TextSearchOptions(
System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>
value);
100
virtual
ASPOSE_PDF_SHARED_API
System::SharedPtr<System::Collections::Generic::IList<System::SharedPtr<AbsorbedTable>
>> get_TableList();
106
ASPOSE_PDF_SHARED_API
bool
get_UseFlowEngine()
const
;
112
ASPOSE_PDF_SHARED_API
void
set_UseFlowEngine(
bool
value);
113
121
ASPOSE_PDF_SHARED_API
TableAbsorber
(
System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>
textSearchOptions);
128
ASPOSE_PDF_SHARED_API
TableAbsorber
();
129
136
virtual
ASPOSE_PDF_SHARED_API
void
Visit(
System::SharedPtr<Page>
page);
143
ASPOSE_PDF_SHARED_API
void
Visit(
System::SharedPtr<Document>
pdf);
151
ASPOSE_PDF_SHARED_API
void
Remove(
System::SharedPtr<AbsorbedTable>
table);
161
ASPOSE_PDF_SHARED_API
void
Replace(
System::SharedPtr<Page>
page,
System::SharedPtr<AbsorbedTable>
oldTable,
System::SharedPtr<Table>
newTable);
162
163
protected
:
164
171
System::ArrayPtr<System::SharedPtr<Rectangle>
> GetCellsToRectArray(
System::SharedPtr<Page>
page);
172
173
private
:
174
175
static
const
int32_t MinimalOpenCellDimension;
176
System::SharedPtr<Aspose::Pdf::Text::TextSearchOptions>
_textSearchOptions;
177
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AbsorbedTable>
>> _tables;
178
bool
_useFlowEngine;
179
System::SharedPtr<Page>
_page;
180
System::SharedPtr<BaseOperatorCollection>
_operators;
181
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Aspose::Pdf::Rectangle>
>> _initialRects;
182
System::SharedPtr<System::Collections::Generic::List<System::Collections::Generic::KeyValuePair<System::SharedPtr<Rectangle>
,
System::SharedPtr<Operator>
>>> _tableOps;
183
System::SharedPtr<Rectangle>
_potentialRect;
184
System::SharedPtr<System::Collections::Generic::Stack<System::SharedPtr<Aspose::Font::TransformationMatrix>
>> _transformationMatrices;
185
System::SharedPtr<Aspose::Font::TransformationMatrix>
_currentMatrix;
186
187
void
Init();
188
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AbsorbedCell>
>> VisitForCells(
System::SharedPtr<Page>
page);
189
void
ParsePageContent(
System::SharedPtr<Page>
page);
190
void
ParseOperators(
System::SharedPtr<BaseOperatorCollection>
operators,
System::SharedPtr<Resources>
resources);
191
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AbsorbedTable>
>> GetTablesFromRows(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<AbsorbedRow>
>> rows, int32_t pageNum);
192
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<AbsorbedRow>
>> GetRowsFromCells(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<AbsorbedCell>
>> cells);
193
static
bool
IsSameRow(
System::SharedPtr<AbsorbedRow>
currentRow,
System::SharedPtr<AbsorbedCell>
currentCell,
System::SharedPtr<Rectangle>
& mergedCell);
194
static
void
ExpandLines(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> lines);
195
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);
196
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);
197
static
System::SharedPtr<Rectangle>
GetIntersection(
System::SharedPtr<Rectangle>
hLine,
System::SharedPtr<Rectangle>
vLine);
198
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Rectangle>
>> AggregateVLines(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> vLineFragList);
199
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Rectangle>
>> AggregateHLines(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> hLineFragList);
200
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Rectangle>
>> SortHFragments(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> unsorted);
201
static
System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<Rectangle>
>> SortVFragments(
System::SharedPtr
<
System::Collections::Generic::List
<
System::SharedPtr<Rectangle>
>> unsorted);
208
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);
209
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);
210
void
FillWithText(
System::SharedPtr<Page>
page);
211
void
ClearTextFragments(
System::SharedPtr<Page>
page);
212
void
NoOpPath();
213
void
OpStroke(
System::SharedPtr<Operator>
op);
214
void
OpFill(
System::SharedPtr<Operator>
op);
215
void
OpRe(
System::SharedPtr<Aspose::Pdf::Operators::Re>
op);
216
void
OpPoint(
System::SharedPtr<Aspose::Pdf::Operators::MoveTo>
op);
217
void
OpLine(
System::SharedPtr<Aspose::Pdf::Operators::LineTo>
op);
221
void
Q(int32_t opIndex,
System::SharedPtr<Operator>
op);
225
void
q(int32_t opIndex,
System::SharedPtr<Operator>
op);
226
void
cm(
System::SharedPtr<Aspose::Pdf::Operators::ConcatenateMatrix>
op);
227
void
opDo(
System::SharedPtr<Operator>
op,
System::SharedPtr<Resources>
resources);
228
bool
RemoveTableOpsFromRectange(
System::SharedPtr<Rectangle>
rect,
System::SharedPtr<Page>
page);
229
230
};
231
232
}
// namespace Text
233
}
// namespace Pdf
234
}
// namespace Aspose
235
236
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:180
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:71
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:
SideBySidePdfComparer.h:24
Aspose::Pdf::FieldValueType::Text
Represents a text type.
Aspose
Definition:
AFRelationship.h:4
System::Collections::Generic::Stack
Stack class forward declaration.
Definition:
ImagePlacementAbsorber.h:49
System::Collections::Generic::List
List forward declaration.
Definition:
Artifact.h:78
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:52
Aspose::Pdf::Text::TableAbsorber
Represents an absorber object of table elements. Performs search and provides access to search result...
Definition:
TableAbsorber.h:70
Aspose::Pdf::Facades::SubmitFormFlag::Pdf
Whole PDF file will be submitted.