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 Engine
29 namespace Facades
30 {
31 class PdfFileMend;
32 } // namespace Facades
33 class Page;
34 class PageGenerator;
35 namespace Tests
36 {
37 namespace Text
38 {
39 class TextBuilderTests;
40 class TextParagraphAbsorberTests;
41 } // namespace Text
42 } // namespace Tests
43 namespace Text
44 {
45 class TextFragment;
46 class TextParagraph;
47 } // namespace Text
48 class TextStamp;
49 class XfaToPdfConverter;
50 class XForm;
51 } // namespace Pdf
52 } // namespace Aspose
53 namespace System
54 {
55 namespace Collections
56 {
57 namespace Generic
58 {
59 template <typename> class List;
60 } // namespace Generic
61 } // namespace Collections
62 } // namespace System
63 
64 namespace Aspose {
65 
66 namespace Pdf {
67 
68 namespace Text {
69 
73 class ASPOSE_PDF_SHARED_CLASS TextBuilder final : public System::Object
74 {
75  typedef TextBuilder ThisType;
76  typedef System::Object BaseType;
77 
78  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
79  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
80 
81  friend class Aspose::Pdf::ApsToPdfConverter;
82  friend class Aspose::Pdf::PageGenerator;
84  friend class Aspose::Pdf::TextStamp;
85  friend class Aspose::Pdf::XfaToPdfConverter;
86  friend class Aspose::Pdf::Tests::Text::TextBuilderTests;
87  friend class Aspose::Pdf::Tests::Text::TextParagraphAbsorberTests;
88 
89 public:
90 
98  ASPOSE_PDF_SHARED_API TextBuilder(System::SharedPtr<Aspose::Pdf::Page> page);
108 
115  ASPOSE_PDF_SHARED_API void AppendParagraph(System::SharedPtr<TextParagraph> textParagraph);
122  ASPOSE_PDF_SHARED_API void AppendText(System::SharedPtr<TextFragment> textFragment);
127  ASPOSE_PDF_SHARED_API void AppendText(System::SharedPtr<System::Collections::Generic::List<System::SharedPtr<TextFragment>>> textFragments);
128 
129 protected:
130 
132 
134  System::SharedPtr<Aspose::Pdf::Page> get_Page() const;
135 
137 
138  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(TextBuilder, CODEPORTING_ARGS(System::SharedPtr<XForm> xForm));
139  void AppendText(System::SharedPtr<TextFragment> textFragment, bool savePreviousState);
143  //[Obfuscation(Feature = "virtualization", Exclude = false)]
144  void AppendText(System::SharedPtr<TextFragment> textFragment, int32_t rotation, bool savePreviousState);
150  //[Obfuscation(Feature = "virtualization", Exclude = false)]
151  void AppendParagraph(System::SharedPtr<TextParagraph> textParagraph, int32_t rotation);
152 
153 private:
154 
158  int32_t itemsAdded;
160 
161  void ProcessFragmentForSpecialCharacterPosition(System::SharedPtr<TextFragment> fragment);
162 
163 };
164 
165 } // namespace Text
166 } // namespace Pdf
167 } // namespace Aspose
168 
169 
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:67
Definition: signed_info.h:13
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
Represents a text type.
Appends text object to Pdf page.
Definition: TextBuilder.h:73
Definition: AFRelationship.h:4
Represents textual stamp.
Definition: TextStamp.h:69
List forward declaration.
Definition: Artifact.h:74
The coordinates are in the page coordinate context.
System::SharedPtr< Document > _document
Definition: TextBuilder.h:131
Whole PDF file will be submitted.