PdfBookmarkEditor.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/Facades/Facade.h"
8 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
9 
10 namespace Aspose
11 {
12 namespace Pdf
13 {
14 namespace Annotations
15 {
16 class IAppointment;
17 } // namespace Annotations
18 class Document;
19 namespace Facades
20 {
21 class Bookmark;
22 class Bookmarks;
23 } // namespace Facades
24 class OutlineItemCollection;
25 } // namespace Pdf
26 } // namespace Aspose
27 namespace System
28 {
29 namespace Drawing
30 {
31 class Color;
32 } // namespace Drawing
33 namespace IO
34 {
35 class Stream;
36 } // namespace IO
37 namespace Xml
38 {
39 class XmlTextReader;
40 class XmlTextWriter;
41 } // namespace Xml
42 } // namespace System
43 
44 namespace Aspose {
45 
46 namespace Pdf {
47 
48 namespace Facades {
49 
53 class ASPOSE_PDF_SHARED_CLASS PdfBookmarkEditor final : public Aspose::Pdf::Facades::SaveableFacade
54 {
57 
58  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
59  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
60 
61 public:
62 
68  ASPOSE_PDF_SHARED_API void CreateBookmarks();
76  ASPOSE_PDF_SHARED_API void CreateBookmarkOfPage(System::String bookmarkName, int32_t pageNumber);
83  ASPOSE_PDF_SHARED_API void CreateBookmarks(System::SharedPtr<Bookmark> bookmark);
92  ASPOSE_PDF_SHARED_API void CreateBookmarks(System::Drawing::Color color, bool boldFlag, bool italicFlag);
100  ASPOSE_PDF_SHARED_API void CreateBookmarkOfPage(System::ArrayPtr<System::String> bookmarkName, System::ArrayPtr<int32_t> pageNumber);
106  ASPOSE_PDF_SHARED_API void DeleteBookmarks();
113  ASPOSE_PDF_SHARED_API void DeleteBookmarks(System::String title);
121  ASPOSE_PDF_SHARED_API void ModifyBookmarks(System::String sTitle, System::String dTitle);
128  ASPOSE_PDF_SHARED_API System::SharedPtr<Bookmarks> ExtractBookmarks();
134  ASPOSE_PDF_SHARED_API System::SharedPtr<Bookmarks> ExtractBookmarks(bool upperLevel);
142  ASPOSE_PDF_SHARED_API System::SharedPtr<Bookmarks> ExtractBookmarks(System::String title);
150  ASPOSE_PDF_SHARED_API System::SharedPtr<Bookmarks> ExtractBookmarks(System::SharedPtr<Bookmark> bookmark);
159  ASPOSE_PDF_SHARED_API void ExtractBookmarksToHTML(System::String pdfFile, System::String cssFile);
166  ASPOSE_PDF_SHARED_API void ExportBookmarksToXML(System::String xmlFile);
171  ASPOSE_PDF_SHARED_API void ExportBookmarksToXML(System::SharedPtr<System::IO::Stream> stream);
178  ASPOSE_PDF_SHARED_API void ImportBookmarksWithXML(System::String xmlFile);
183  ASPOSE_PDF_SHARED_API void ImportBookmarksWithXML(System::SharedPtr<System::IO::Stream> stream);
184 
188  ASPOSE_PDF_SHARED_API PdfBookmarkEditor();
195  ASPOSE_PDF_SHARED_API PdfBookmarkEditor(System::SharedPtr<Aspose::Pdf::Document> document);
196 
204  static ASPOSE_PDF_SHARED_API void ExportBookmarksToHtml(System::String inPdfFile, System::String outHtmlFile);
205 
206 private:
207 
208  static void ModifyBookmarks(System::SharedPtr<OutlineItemCollection> outline, System::String srcTitle, System::String destTitle);
209  static void WriteHtmlOutlineHierarchy(System::SharedPtr<System::Xml::XmlTextWriter> writer, System::SharedPtr<OutlineItemCollection> outline, System::String destPdf);
211  static void WriteXmlOutlineHierarchy(System::SharedPtr<System::Xml::XmlTextWriter> writer, System::SharedPtr<OutlineItemCollection> outline);
212  static void WriteText(System::SharedPtr<System::Xml::XmlTextWriter> writer, System::String title);
216  static void AddChildItems(System::SharedPtr<Bookmarks> bms1, System::SharedPtr<Bookmarks> bms2);
217 
218 };
219 
220 } // namespace Facades
221 } // namespace Pdf
222 } // namespace Aspose
223 
224 
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Base class for all saveable facades.
Definition: Facade.h:151
Definition: Artifact.h:67
Base facade class.
Definition: Facade.h:57
Represents a class to work with PDF file&#39;s bookmarks including create, modify, export, import and delete.
Definition: PdfBookmarkEditor.h:53
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
means saving in XML format
General facade interface that defines common facades methods.
Definition: IFacade.h:33
Definition: AFRelationship.h:4
Represents a color. This type should be allocated on stack and passed to functions by value or by ref...
Definition: color.h:23
Whole PDF file will be submitted.