TextBuilder.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/object.h>
5 #include <cstdint>
6 
7 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
8 
9 namespace Aspose
10 {
11 namespace Pdf
12 {
13 class ApsToPdfConverter;
14 class BaseOperatorCollection;
15 class Document;
16 namespace Engine
17 {
18 namespace CommonData
19 {
20 namespace Text
21 {
22 namespace Segmenting
23 {
24 class TextSegmenter;
25 } // namespace Segmenting
26 } // namespace Text
27 } // namespace CommonData
28 namespace IO
29 {
30 namespace ConvertStrategies
31 {
32 class SearchablePdfConvertStrategy;
33 } // namespace ConvertStrategies
34 } // namespace IO
35 } // namespace Engine
36 namespace Facades
37 {
38 class PdfFileMend;
39 } // namespace Facades
40 class Page;
41 class PageGenerator;
42 namespace Tests
43 {
44 namespace Text
45 {
46 class TextBuilderTests;
47 class TextParagraphAbsorberTests;
48 } // namespace Text
49 } // namespace Tests
50 namespace Text
51 {
52 class TextFragment;
53 class TextParagraph;
54 } // namespace Text
55 class TextStamp;
56 class XfaToPdfConverter;
57 class XForm;
58 } // namespace Pdf
59 } // namespace Aspose
60 namespace System
61 {
62 namespace Collections
63 {
64 namespace Generic
65 {
66 template <typename> class List;
67 } // namespace Generic
68 } // namespace Collections
69 } // namespace System
70 
71 namespace Aspose {
72 
73 namespace Pdf {
74 
75 namespace Text {
76 
80 class ASPOSE_PDF_SHARED_CLASS TextBuilder final : public System::Object
81 {
82  typedef TextBuilder ThisType;
83  typedef System::Object BaseType;
84 
85  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
86  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
87 
88  friend class Aspose::Pdf::ApsToPdfConverter;
89  friend class Aspose::Pdf::Engine::IO::ConvertStrategies::SearchablePdfConvertStrategy;
90  friend class Aspose::Pdf::PageGenerator;
92  friend class Aspose::Pdf::TextStamp;
93  friend class Aspose::Pdf::XfaToPdfConverter;
94  friend class Aspose::Pdf::Tests::Text::TextBuilderTests;
95  friend class Aspose::Pdf::Tests::Text::TextParagraphAbsorberTests;
96 
97 public:
98 
106  ASPOSE_PDF_SHARED_API TextBuilder(System::SharedPtr<Aspose::Pdf::Page> page);
116 
123  ASPOSE_PDF_SHARED_API void AppendParagraph(System::SharedPtr<TextParagraph> textParagraph);
130  ASPOSE_PDF_SHARED_API void AppendText(System::SharedPtr<TextFragment> textFragment);
135  ASPOSE_PDF_SHARED_API void AppendText(System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<TextFragment>>> textFragments);
136 
137 protected:
138 
140 
142  System::SharedPtr<Aspose::Pdf::Page> get_Page() const;
143  const System::SharedPtr<BaseOperatorCollection>& get_Operators() const;
144 
146 
147  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(TextBuilder, CODEPORTING_ARGS(System::SharedPtr<XForm> xForm));
148  void AppendText(System::SharedPtr<TextFragment> textFragment, bool savePreviousState);
152  //[Obfuscation(Feature = "virtualization", Exclude = false)]
153  void AppendText(System::SharedPtr<TextFragment> textFragment, int32_t rotation, bool savePreviousState);
159  //[Obfuscation(Feature = "virtualization", Exclude = false)]
160  void AppendParagraph(System::SharedPtr<TextParagraph> textParagraph, int32_t rotation);
161 
162 private:
163 
166  int32_t itemsAdded;
169 
170  void ProcessFragmentForSpecialCharacterPosition(System::SharedPtr<TextFragment> fragment);
171 
172 };
173 
174 } // namespace Text
175 } // namespace Pdf
176 } // namespace Aspose
177 
178 
class ASPOSECPP_SHARED_CLASS List
Definition: ienumerable.h:17
Represents a class for adding texts and images on the pages of existing PDF document.
Definition: PdfFileMend.h:49
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:64
Definition: Artifact.h:71
Definition: signed_info.h:13
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: SideBySidePdfComparer.h:24
Represents a text type.
Appends text object to Pdf page.
Definition: TextBuilder.h:80
Definition: AFRelationship.h:4
Represents textual stamp.
Definition: TextStamp.h:69
List forward declaration.
Definition: Artifact.h:78
The coordinates are in the page coordinate context.
System::SharedPtr< Document > _document
Definition: TextBuilder.h:139
Whole PDF file will be submitted.