PdfFileSanitization.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/array.h>
5 #include <cstdint>
6 
7 #include "Aspose.PDF.Cpp/Sanitization/IRecovery.h"
8 #include "Aspose.PDF.Cpp/Facades/Facade.h"
9 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
10 
11 namespace Aspose
12 {
13 namespace Pdf
14 {
15 class Document;
16 } // namespace Pdf
17 } // namespace Aspose
18 namespace System
19 {
20 namespace Collections
21 {
22 namespace Generic
23 {
24 template <typename> class List;
25 } // namespace Generic
26 } // namespace Collections
27 namespace IO
28 {
29 class Stream;
30 } // namespace IO
31 } // namespace System
32 
33 namespace Aspose {
34 
35 namespace Pdf {
36 
37 namespace Facades {
38 
44 {
47  typedef Aspose::Pdf::Sanitization::IRecovery BaseType1;
48 
49  typedef ::System::BaseTypesInfo<BaseType, BaseType1> ThisTypeBaseTypesInfo;
50  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
51 
52 public:
53 
57  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Collections::Generic::List<System::String>> get_Log() override;
61  ASPOSE_PDF_SHARED_API bool get_UseTrimTop() const;
65  ASPOSE_PDF_SHARED_API void set_UseTrimTop(bool value);
69  ASPOSE_PDF_SHARED_API bool get_UseTrimBottom() const;
73  ASPOSE_PDF_SHARED_API void set_UseTrimBottom(bool value);
77  ASPOSE_PDF_SHARED_API bool get_UseRebuildXrefAndTrailer() const;
81  ASPOSE_PDF_SHARED_API void set_UseRebuildXrefAndTrailer(bool value);
82 
86  ASPOSE_PDF_SHARED_API PdfFileSanitization();
87 
92  ASPOSE_PDF_SHARED_API void Save(System::String outputFile) override;
97  ASPOSE_PDF_SHARED_API void Save(System::SharedPtr<System::IO::Stream> outputStream) override;
102  ASPOSE_PDF_SHARED_API void BindPdf(System::String inputFile) override;
107  ASPOSE_PDF_SHARED_API void BindPdf(System::SharedPtr<System::IO::Stream> inputStream) override;
112  ASPOSE_PDF_SHARED_API void BindPdf(System::SharedPtr<Aspose::Pdf::Document> srcDoc) override;
117  ASPOSE_PDF_SHARED_API void Recover() override;
121  ASPOSE_PDF_SHARED_API void TrimTop() override;
125  ASPOSE_PDF_SHARED_API void TrimBottom() override;
129  ASPOSE_PDF_SHARED_API void RebuildXrefAndTrailer();
133  ASPOSE_PDF_SHARED_API void Close() override;
134 
135 private:
136 
140  static const int32_t IndexNotFound;
141  bool pr_UseTrimTop;
142  bool pr_UseTrimBottom;
143  bool pr_UseRebuildXrefAndTrailer;
144 
145  void MovePositionToStart(System::SharedPtr<System::IO::Stream> stream);
146  static int32_t IndexOf(System::ArrayPtr<uint8_t> array, System::String search);
147  static int32_t LastIndexOf(System::ArrayPtr<uint8_t> array, System::String search);
148 
149 };
150 
151 } // namespace Facades
152 } // namespace Pdf
153 } // namespace Aspose
154 
155 
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
class ASPOSECPP_SHARED_CLASS List
Definition: ienumerable.h:17
Base class for all saveable facades.
Definition: Facade.h:151
Definition: Artifact.h:67
Base facade class.
Definition: Facade.h:57
Represents sanitization and recovery API. Use it if you can&#39;t create/open documents in any other way...
Definition: PdfFileSanitization.h:43
The type that supports reliable, two-way, connection-based byte streams without duplication of data a...
This interface represents recovery API.
Definition: IRecovery.h:27
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
General facade interface that defines common facades methods.
Definition: IFacade.h:33
Definition: AFRelationship.h:4
means saving without change of format, i.e. as PDF use it please instead of &#39;SaveFormat.None&#39;, that is obsolete one
Whole PDF file will be submitted.