HtmlSaveOptions.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/nullable.h>
5 #include <system/multicast_delegate.h>
6 #include <system/array.h>
7 #include <cstdint>
8 
9 #include "Aspose.PDF.Cpp/UnifiedSaveOptions.h"
10 #include "Aspose.PDF.Cpp/SaveOptions.h"
11 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
12 
13 namespace Aspose
14 {
15 namespace Pdf
16 {
17 enum class Direction;
18 class HtmlConverter;
19 enum class HtmlDocumentType;
20 namespace Tests
21 {
22 namespace HTML
23 {
24 class Pdf2HtmlConverterTests;
25 } // namespace HTML
26 class RegressionTests_v11_7;
27 } // namespace Tests
28 namespace Text
29 {
30 class FontSourceCollection;
31 } // namespace Text
32 } // namespace Pdf
33 } // namespace Aspose
34 namespace System
35 {
36 namespace IO
37 {
38 class Stream;
39 } // namespace IO
40 } // namespace System
41 
42 namespace Aspose {
43 
44 namespace Pdf {
45 
50 {
51  typedef HtmlSaveOptions ThisType;
55 
56  typedef ::System::BaseTypesInfo<BaseType, BaseType1, BaseType2> ThisTypeBaseTypesInfo;
57  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
58 
59  friend class Aspose::Pdf::HtmlConverter;
60  friend class Aspose::Pdf::Tests::RegressionTests_v11_7;
61  friend class Aspose::Pdf::Tests::HTML::Pdf2HtmlConverterTests;
62 
63 public:
64 
69  enum class FontSavingModes
70  {
74  AlwaysSaveAsWOFF = 0,
78  AlwaysSaveAsTTF = 1,
82  AlwaysSaveAsEOT = 2,
87  SaveInAllFormats = 3,
91  DontSave = 4
92  };
93 
98  {
104  NoAdditionalProcessing,
116  TryCorrectResultHtml
117  };
118 
123  {
128  UseEmUnitsAndCompensationOfRoundingErrorsInCss,
132  UsePixelUnitsInCssLetterSpacingForIE
133  };
134 
140  enum class HtmlImageType
141  {
145  Jpeg = 0,
149  Png = 1,
153  Bmp = 2,
157  Gif = 3,
161  Tiff = 4,
165  Svg = 5,
169  ZippedSvg = 6,
173  Unknown = 7
174  };
175 
180  enum class ImageParentTypes
181  {
185  HtmlPage = 0,
189  SvgImage = 1
190  };
191 
198  {
204  AsPngImagesEmbeddedIntoSvg,
210  AsExternalPngFilesReferencedViaSvg,
217  AsEmbeddedPartsOfPngPageBackground
218  };
219 
226  {
232  WriteAllHtml,
237  WriteOnlyBodyContent
238  };
239 
246  {
253  EmbedAllIntoHtml,
260  EmbedCssOnly,
267  NoEmbedding
268  };
269 
273  enum class FontEncodingRules : uint8_t
274  {
278  Default,
286  DecreaseToUnicodePriorityLevel
287  };
288 
289 
290 public:
291 
308  using ResourceSavingStrategy = System::MulticastDelegate<System::String(System::SharedPtr<SaveOptions::ResourceSavingInfo>)>;
309 
325  using HtmlPageMarkupSavingStrategy = System::MulticastDelegate<void(System::SharedPtr<HtmlSaveOptions::HtmlPageMarkupSavingInfo>)>;
326 
334  class CssSavingInfo;
335  using CssSavingStrategy = System::MulticastDelegate<void(System::SharedPtr<HtmlSaveOptions::CssSavingInfo>)>;
336 
344  class CssUrlRequestInfo;
345  using CssUrlMakingStrategy = System::MulticastDelegate<System::String(System::SharedPtr<HtmlSaveOptions::CssUrlRequestInfo>)>;
346 
347 
348 public:
349 
355  class ASPOSE_PDF_SHARED_CLASS CssSavingInfo : public System::Object
356  {
357  typedef CssSavingInfo ThisType;
358  typedef System::Object BaseType;
359 
360  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
361  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
362 
363  friend class Aspose::Pdf::HtmlConverter;
364 
365  public:
366 
373  int32_t CssNumber;
385 
386  protected:
387 
397  // Ctors
398  CssSavingInfo();
399 
400  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(CssSavingInfo, CODEPORTING_ARGS());
401 
402  };
403 
410  class ASPOSE_PDF_SHARED_CLASS HtmlPageMarkupSavingInfo : public System::Object
411  {
412  typedef HtmlPageMarkupSavingInfo ThisType;
413  typedef System::Object BaseType;
414 
415  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
416  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
417 
418  friend class Aspose::Pdf::HtmlConverter;
419 
420  public:
421 
463 
464  protected:
465 
467 
468  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(HtmlPageMarkupSavingInfo, CODEPORTING_ARGS());
469 
470  };
471 
477  class ASPOSE_PDF_SHARED_CLASS CssUrlRequestInfo : public System::Object
478  {
479  typedef CssUrlRequestInfo ThisType;
480  typedef System::Object BaseType;
481 
482  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
483  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
484 
485  public:
486 
493 
497  ASPOSE_PDF_SHARED_API CssUrlRequestInfo();
498 
499  };
500 
507  {
508  typedef HtmlImageSavingInfo ThisType;
510 
511  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
512  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
513 
514  public:
515 
545 
549  ASPOSE_PDF_SHARED_API HtmlImageSavingInfo();
550 
551  };
552 
553 
554 public:
555 
660 
667  ASPOSE_PDF_SHARED_API HtmlDocumentType get_DocumentType() const;
674  ASPOSE_PDF_SHARED_API void set_DocumentType(HtmlDocumentType value);
683  ASPOSE_PDF_SHARED_API bool get_CompressSvgGraphicsIfAny() const;
692  ASPOSE_PDF_SHARED_API void set_CompressSvgGraphicsIfAny(bool value);
693 
711 
725  ASPOSE_PDF_SHARED_API bool get_SplitCssIntoPages() const;
739  ASPOSE_PDF_SHARED_API void set_SplitCssIntoPages(bool value);
740 
753 
759  ASPOSE_PDF_SHARED_API bool get_SplitIntoPages() const;
765  ASPOSE_PDF_SHARED_API void set_SplitIntoPages(bool value);
766 
788 
801  ASPOSE_PDF_SHARED_API System::ArrayPtr<int32_t> get_ExplicitListOfSavedPages() override;
814  ASPOSE_PDF_SHARED_API void set_ExplicitListOfSavedPages(System::ArrayPtr<int32_t> value) override;
819  ASPOSE_PDF_SHARED_API bool get_FixedLayout() const;
824  ASPOSE_PDF_SHARED_API void set_FixedLayout(bool value);
829  ASPOSE_PDF_SHARED_API int32_t get_ImageResolution() const;
834  ASPOSE_PDF_SHARED_API void set_ImageResolution(int32_t value);
841  ASPOSE_PDF_SHARED_API System::String get_DefaultFontName() const;
848  ASPOSE_PDF_SHARED_API void set_DefaultFontName(System::String value);
854  ASPOSE_PDF_SHARED_API bool get_IgnoreResourceFontErrors() const;
860  ASPOSE_PDF_SHARED_API void set_IgnoreResourceFontErrors(bool value);
865  ASPOSE_PDF_SHARED_API int32_t get_BatchSize() override;
870  ASPOSE_PDF_SHARED_API void set_BatchSize(int32_t value) override;
875  ASPOSE_PDF_SHARED_API System::Nullable<float> get_IgnoredTextFontSize() const;
880  ASPOSE_PDF_SHARED_API void set_IgnoredTextFontSize(System::Nullable<float> value);
888  ASPOSE_PDF_SHARED_API System::SharedPtr<Text::FontSourceCollection> get_FontSources() const;
889 
913 
925  ASPOSE_PDF_SHARED_API int32_t get_AdditionalMarginWidthInPoints() const;
937  ASPOSE_PDF_SHARED_API void set_AdditionalMarginWidthInPoints(int32_t value);
943  ASPOSE_PDF_SHARED_API bool get_UseZOrder() const;
949  ASPOSE_PDF_SHARED_API void set_UseZOrder(bool value);
956  ASPOSE_PDF_SHARED_API bool get_ConvertMarkedContentToLayers() const;
963  ASPOSE_PDF_SHARED_API void set_ConvertMarkedContentToLayers(bool value);
969  ASPOSE_PDF_SHARED_API float get_MinimalLineWidth() const;
975  ASPOSE_PDF_SHARED_API void set_MinimalLineWidth(float value);
982  ASPOSE_PDF_SHARED_API bool get_PreventGlyphsGrouping() const;
989  ASPOSE_PDF_SHARED_API void set_PreventGlyphsGrouping(bool value);
995  ASPOSE_PDF_SHARED_API bool get_SimpleTextboxModeGrouping() const;
1001  ASPOSE_PDF_SHARED_API void set_SimpleTextboxModeGrouping(bool value);
1005  ASPOSE_PDF_SHARED_API bool get_FlowLayoutParagraphFullWidth() const;
1009  ASPOSE_PDF_SHARED_API void set_FlowLayoutParagraphFullWidth(bool value);
1015  ASPOSE_PDF_SHARED_API bool get_RenderTextAsImage() const;
1021  ASPOSE_PDF_SHARED_API void set_RenderTextAsImage(bool value);
1025  ASPOSE_PDF_SHARED_API System::String get_Title() const;
1029  ASPOSE_PDF_SHARED_API void set_Title(System::String value);
1030 
1034  ASPOSE_PDF_SHARED_API HtmlSaveOptions();
1039  ASPOSE_PDF_SHARED_API HtmlSaveOptions(HtmlDocumentType documentType);
1044  ASPOSE_PDF_SHARED_API HtmlSaveOptions(bool fixedLayout);
1050  ASPOSE_PDF_SHARED_API HtmlSaveOptions(HtmlDocumentType documentType, bool fixedLayout);
1051 
1052 protected:
1053 
1057  Aspose::Pdf::Direction get_Direction() const;
1061  void set_Direction(Aspose::Pdf::Direction value);
1062 
1063  void CheckParametersConsistensyAndThrowExceptionOtherwise(bool targetIsStream);
1064  void ResetInternals();
1065 
1066 private:
1067 
1068  System::ArrayPtr<int32_t> _explicitListOfSavedPages;
1069  HtmlDocumentType _documentType;
1070  bool _fixedLayout;
1071  int32_t _imageResolution;
1072  System::String _defaultFontName;
1073  int32_t _batchSize;
1074  bool _ignoreResourceFontErrors;
1079  System::Nullable<float> _ignoredTextFontSize;
1080  bool _compressSVGIfAny;
1081  bool _splitCssIntoPages;
1082  bool _splitIntoPages;
1084  int32_t _additionalPageMarginWidth;
1085  bool _useZOrder;
1086  bool pr_ConvertMarkedContentToLayers;
1087  float pr_MinimalLineWidth;
1088  bool pr_PreventGlyphsGrouping;
1089  bool _simpleTextboxModeGrouping;
1090  bool pr_FlowLayoutParagraphFullWidth;
1091  bool pr_RenderTextAsImage;
1092  System::String pr_Title;
1093  Aspose::Pdf::Direction pr_Direction;
1094 
1095  void CheckStreamSavingParamsConsistency();
1096  void CheckFileSavingParamsConsistency();
1097 
1098 };
1099 
1100 } // namespace Pdf
1101 } // namespace Aspose
1102 
1103 
If SplitToPages property of HtmlSaveOptions, then several HTML-files (one HTML file per converted pag...
Definition: HtmlSaveOptions.h:410
System::SharedPtr< System::IO::Stream > ContentStream
Set by converter. Represents binary content of saved CSS
Definition: HtmlSaveOptions.h:384
This class represents set of data that related to custom saving of CSS during conversion of PDF to HT...
Definition: HtmlSaveOptions.h:355
RasterImagesSavingModes
Converted PDF can contain raster images(.png, *.jpeg etc.) This enum defines methods of how raster im...
Definition: HtmlSaveOptions.h:197
System::String SupposedFileName
Set by converter. Supposed file name that goes from converter to code of custom method Can be used in...
Definition: HtmlSaveOptions.h:427
This class represents saving options for saving that uses unified conversion way (with unified intern...
Definition: UnifiedSaveOptions.h:108
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Save options for export to Html format
Definition: HtmlSaveOptions.h:49
int32_t HtmlHostPageNumber
Set by converter. If set SplitToPages property, then several HTML-files(one HTML file per converted p...
Definition: HtmlSaveOptions.h:452
int32_t PdfHostPageNumber
Set by converter. If SplitToPages property set, then several HTML-files(one HTML file per converted p...
Definition: HtmlSaveOptions.h:441
HtmlSaveOptions::ResourceSavingStrategy CustomResourceSavingStrategy
This field can contain saving strategy that must be used (if present) during conversion for customize...
Definition: HtmlSaveOptions.h:620
System::SharedPtr< SaveOptions::MarginInfo > PageMarginIfAny
This attribute represents set of extra page margin (if any) in result HTML document around area that ...
Definition: HtmlSaveOptions.h:602
HtmlSaveOptions::CssUrlMakingStrategy CustomStrategyOfCssUrlCreation
This field can contain custom method that returns URL (Or URL template if multipage generation is on ...
Definition: HtmlSaveOptions.h:659
int32_t PdfHostPageNumber
Tells to custom code to what page of original PDF document pertains saved image Since it&#39;s possible t...
Definition: HtmlSaveOptions.h:538
int32_t HtmlHostPageNumber
Tells to custom code to what page of generated set of HTML page-files pertains saved image...
Definition: HtmlSaveOptions.h:544
FontEncodingRules
This enumeration defines rules which tune encoding logic
Definition: HtmlSaveOptions.h:273
System::String CssClassNamesPrefix
When PDFtoHTML converter generates result CSSs, CSS class names (something like ".stl_01 {}" ... ".stl_NN {}) are generated and used in result CSS. This property allows forcibly set class name prefix For example, if You want that all class names start with &#39;my_prefix_&#39; (i.e. were something like &#39;my_prefix_1&#39; ... &#39;my_prefix_NNN&#39; ) , then just assign &#39;my_prefix_&#39; to this property before conversion. If this property will stay untouched(i.e. null will be leaved as value ), then converter will generate class names itself (it wil be something like ".stl_01 {}" ... ".stl_NN {}")
Definition: HtmlSaveOptions.h:752
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:64
HtmlSaveOptions::RasterImagesSavingModes RasterImagesSavingMode
Converted PDF can contain raster images This parameter defines how they should be handled during conv...
Definition: HtmlSaveOptions.h:783
Definition: Artifact.h:67
bool CustomProcessingCancelled
Should be set by custom code if it cannot or should not define URL that will be used in generated HTM...
Definition: HtmlSaveOptions.h:492
System::String SpecialFolderForSvgImages
Gets or sets path to directory to which must be saved only SVG-images if they are encountered during ...
Definition: HtmlSaveOptions.h:702
Defines conversion options related to a set of pages to convert.
Definition: UnifiedSaveOptions.h:83
This class represents set of data that related to external resource image file&#39;s saving during PDF to...
Definition: HtmlSaveOptions.h:506
System::MulticastDelegate< void(System::SharedPtr< UnifiedSaveOptions::ProgressEventHandlerInfo >)> ConversionProgressEventHandler
Definition: UnifiedSaveOptions.h:131
HtmlSaveOptions::ImageParentTypes ParentType
Saved image can pertain to HTML itself or can be extracted. from SVG embedded to HTML. This property can tell to custom code what&#39;s that type of parent of processed image. It set by converter and can be used in custom code to decide what should be done with that image (f.e. custom code can decide where to save image or how it must be referenced in parent&#39;s content).
Definition: HtmlSaveOptions.h:531
This class represents set of data that related to external resource file&#39;s saving that occures during...
Definition: SaveOptions.h:360
HtmlImageType
enumerates possible types of image files that can be saved as external resources during Pdf to Html c...
Definition: HtmlSaveOptions.h:140
Represents set of data that related to request from converter to custom code aimed to get desirable U...
Definition: HtmlSaveOptions.h:477
UnifiedSaveOptions::ConversionProgressEventHandler CustomProgressHandler
This handler can be used to handle conversion progress events f.e. it can be used to show progress ba...
Definition: HtmlSaveOptions.h:563
Definition: signed_info.h:13
HtmlSaveOptions::HtmlMarkupGenerationModes HtmlMarkupGenerationMode
Sometimes specific reqirments to generation of HTML markup are present. This parameter defines HTML p...
Definition: HtmlSaveOptions.h:777
HtmlSaveOptions::AntialiasingProcessingType AntialiasingProcessing
This parameter defines required antialiasing measures during conversion of compound background images...
Definition: HtmlSaveOptions.h:573
System::MulticastDelegate< void(System::SharedPtr< HtmlSaveOptions::CssSavingInfo >)> CssSavingStrategy
Definition: HtmlSaveOptions.h:335
This field represents an unknown type.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
HtmlSaveOptions::CssSavingStrategy CustomCssSavingStrategy
This field can contain saving strategy that must be used (if present) during conversion of Pdf to Htm...
Definition: HtmlSaveOptions.h:629
HtmlSaveOptions::FontSavingModes FontSavingMode
Defines font saving mode that will be used during saving of PDF to desirable format ...
Definition: HtmlSaveOptions.h:590
Represents a text type.
HtmlDocumentType
Represents enumeration of the Html document types.
Definition: HtmlDocumentType.h:11
svg image file type.
System::String SpecialFolderForAllImages
Gets or sets path to directory to which must be saved any images if they are encountered during savin...
Definition: HtmlSaveOptions.h:710
bool CustomProcessingCancelled
Should be set in custom code when necessary. This flag must be set to "true" in custom code if for so...
Definition: HtmlSaveOptions.h:462
Definition: AFRelationship.h:4
System::SharedPtr< System::IO::Stream > ContentStream
Set by converter. Represents saved HTML as stream
Definition: HtmlSaveOptions.h:432
HtmlSaveOptions::HtmlPageMarkupSavingStrategy CustomHtmlSavingStrategy
Result of conversion can contain one or several HTML-pages You can assign to this property delegate c...
Definition: HtmlSaveOptions.h:644
Defines conversion options related to pipeline configuration.
Definition: UnifiedSaveOptions.h:59
FontSavingModes
Enumerates modes that can be used for saving of fonts referenced in saved PDF.
Definition: HtmlSaveOptions.h:69
means loading of document in HTML format
Direction
Text direction.
Definition: Direction.h:20
System::ArrayPtr< System::String > ExcludeFontNameList
List of PDF embedded font names that not be embedded in HTML.
Definition: HtmlSaveOptions.h:610
System::String SupposedURL
Set by converter. Supposed file name that goes from converter to code of custom method Can be used in...
Definition: HtmlSaveOptions.h:379
LettersPositioningMethods
It enumerates possible modes of positioning of letters in words in result HTML
Definition: HtmlSaveOptions.h:122
HtmlSaveOptions::FontEncodingRules FontEncodingStrategy
Defines encoding special rule to tune PDF decoding for current document
Definition: HtmlSaveOptions.h:893
HtmlSaveOptions::HtmlImageType ImageType
Represents type of saved image referenced in HTML. Set by converter and can be used in custom code to...
Definition: HtmlSaveOptions.h:521
bool SaveFullFont
Indicates that full font will be saved, supports only True Type Fonts. By default SaveFullFont = fals...
Definition: HtmlSaveOptions.h:569
AntialiasingProcessingType
This enum describes possible antialiasing measures during conversion
Definition: HtmlSaveOptions.h:97
System::MulticastDelegate< System::String(System::SharedPtr< SaveOptions::ResourceSavingInfo >)> ResourceSavingStrategy
To this property You can assign delegate created from custom method that implements processing of ext...
Definition: HtmlSaveOptions.h:308
HtmlSaveOptions::LettersPositioningMethods LettersPositioningMethod
Sets mode of positioning of letters in words in result HTML
Definition: HtmlSaveOptions.h:606
System::MulticastDelegate< System::String(System::SharedPtr< HtmlSaveOptions::CssUrlRequestInfo >)> CssUrlMakingStrategy
Definition: HtmlSaveOptions.h:345
PartsEmbeddingModes
This enum enumerates possible modes of embedding of files referenced in HTML It allows to control whe...
Definition: HtmlSaveOptions.h:245
bool PagesFlowTypeDependsOnViewersScreenSize
If attribute &#39;SplitOnPages=false&#39;, than whole HTML representing all input PDF pages will be put into ...
Definition: HtmlSaveOptions.h:906
means saving without change of format, i.e. as PDF use it please instead of &#39;SaveFormat.None&#39;, that is obsolete one
ImageParentTypes
Enumerates possible types of image&#39;s parents Image can pertain to HTML page or to SVG parent image ...
Definition: HtmlSaveOptions.h:180
bool SaveShadowedTextsAsTransparentTexts
Pdf can contain texts that are shadowed by another elements (f.e. by images) but can be selected to c...
Definition: HtmlSaveOptions.h:586
HtmlSaveOptions::PartsEmbeddingModes PartsEmbeddingMode
It defines whether referenced files (HTML, Fonts,Images, CSSes) will be embedded into main HTML file ...
Definition: HtmlSaveOptions.h:771
bool SaveTransparentTexts
Pdf can contain transparent texts that can be selected to clipboard (usually it happen when document ...
Definition: HtmlSaveOptions.h:579
bool RemoveEmptyAreasOnTopAndBottom
Defines whether in created HTML will be removed top and bottom empty area without any content (if any...
Definition: HtmlSaveOptions.h:787
int32_t CssNumber
Set by converter. During conversion several CSS-files are created . This properties shows ordinal of ...
Definition: HtmlSaveOptions.h:373
System::MulticastDelegate< void(System::SharedPtr< HtmlSaveOptions::HtmlPageMarkupSavingInfo >)> HtmlPageMarkupSavingStrategy
Definition: HtmlSaveOptions.h:325
bool TrySaveTextUnderliningAndStrikeoutingInCss
PDF itself does not contain underlining markers for texts. It emulated with line situated under text...
Definition: HtmlSaveOptions.h:912
Whole PDF file will be submitted.
System::SharedPtr< SaveOptions::BorderInfo > PageBorderIfAny
This attribute represents set of settings used for drawing border (if any) in result HTML document ar...
Definition: HtmlSaveOptions.h:597
HtmlMarkupGenerationModes
Sometimes specific reqirments to created HTML are present. This enum defines HTML preparing modes tha...
Definition: HtmlSaveOptions.h:225