Foxit PDF SDK

fs_optimization.h
Go to the documentation of this file.
1
15 #ifndef FS_PDFOPTIMIZATION_H_
16 #define FS_PDFOPTIMIZATION_H_
17
18 #include "common/fs_common.h"
19 #include "pdf/fs_pdfdoc.h"
20 #include "pdf/fs_pdfpage.h"
21
27 namespace foxit {
31 namespace addon {
35 namespace optimization {
36 class ImageSettings;
37 class MonoImageSettings;
38 class OptimizerSettings;
39 class OptimizeScannedPDFSettings;
40
42 class AuditSpaceSize FS_FINAL : public Object{
43 public:
45 AuditSpaceSize()
46 : content_streams(0)
47 , images(0)
48 , fonts(0)
49 , bookmarks(0)
50 , x_object_forms(0)
51 , structure_infos(0)
52 , acroforms(0)
53 , link_annots(0)
54 , named_destnations(0)
55 , color_space(0)
56 , pattern_infos(0)
57 , piece_infos(0)
58 , comments_and_3d_contents(0)
59 , shading_pattern_infos(0)
60 , extend_graphics_states(0)
61 , cross_ref_tables(0)
62 , thumbs(0)
63 , embed_files(0)
64 , web_infos(0) { }
65
73 AuditSpaceSize & operator = (const AuditSpaceSize & data) {
74 content_streams = data.content_streams;
75 images = data.images;
76 fonts = data.fonts;
77 bookmarks = data.bookmarks;
78 x_object_forms = data.x_object_forms;
79 named_destnations = data.named_destnations;
80 structure_infos = data.structure_infos;
81 acroforms = data.acroforms;
82 link_annots = data.link_annots;
83 color_space = data.color_space;
84 pattern_infos = data.pattern_infos;
85 piece_infos = data.piece_infos;
86 comments_and_3d_contents = data.comments_and_3d_contents;
87 shading_pattern_infos = data.shading_pattern_infos;
88 extend_graphics_states = data.extend_graphics_states;
89 cross_ref_tables = data.cross_ref_tables;
90 thumbs = data.thumbs;
91 embed_files = data.embed_files;
92 web_infos = data.web_infos;
93 return (*this);
94 }
95
101 uint32 content_streams;
102
108 uint32 images;
109
115 uint32 fonts;
116
122 uint32 bookmarks;
123
129 uint32 x_object_forms;
130
136 uint32 structure_infos;
137
143 uint32 acroforms;
144
150 uint32 link_annots;
151
157 uint32 named_destnations;
158
164 uint32 color_space;
165
171 uint32 pattern_infos;
172
178 uint32 piece_infos;
179
185 uint32 comments_and_3d_contents;
186
192 uint32 shading_pattern_infos;
193
199 uint32 extend_graphics_states;
200
206 uint32 cross_ref_tables;
207
213 uint32 thumbs;
214
220 uint32 embed_files;
221
227 uint32 web_infos;
228 };
229
234 class ImageCompressionCallback {
235 public:
241 virtual void Release() = 0;
242
252 virtual common::file::StreamCallback* GetTemporaryFileStream(const common::Bitmap& bitmap) = 0;
253
254 protected:
255 ~ImageCompressionCallback() {}
256 };
257
265 class Optimizer FS_FINAL : public Base {
266 public:
267 typedef foxit::addon::optimization::OptimizerSettings OptimizerSettings;
268 typedef foxit::addon::optimization::OptimizeScannedPDFSettings OptimizeScannedPDFSettings;
286 static common::Progressive Optimize(const pdf::PDFDoc& doc,const OptimizerSettings& settings,common::PauseCallback* pause);
287
307 static common::Progressive StartSubsetEmbedFont(const pdf::PDFDoc& doc, common::PauseCallback* pause);
308
330 static common::Progressive OptimizeScannedPDF(const pdf::PDFDoc& doc, const OptimizeScannedPDFSettings& settings, ImageCompressionCallback* image_compress_callback, common::PauseCallback* pause);
331
339 static AuditSpaceSize ComputeAuditSpace(const pdf::PDFDoc& doc);
340 };
341
348 class ImageSettings FS_FINAL : public Base {
349 public:
355 typedef enum _ImageCompressMode {
357 e_ImageCompressHigh = 10003,
359 e_ImageCompressjpeg = 10005,
361 e_ImageCompressjpeg2000 = 10006,
363 e_ImageCompressRetain = 10007,
365 e_ImageCompressZip = 10009
366 } ImageCompressMode;
367
373 typedef enum _ImageCompressQuality {
375 e_ImageCompressQualityMinimum = 1,
377 e_ImageCompressQualityLow = 2,
379 e_ImageCompressQualityMedium = 3,
381 e_ImageCompressQualityHigh = 4,
383 e_ImageCompressQualityMaximum = 5,
385 e_ImageCompressQualityLossless = 6
386 } ImageCompressQuality;
387
393 typedef enum _StretchMode {
395 e_StretchDefault = -1,
397 e_StretchOff = 0x00,
399 e_StretchInterpol = 0x20,
401 e_StretchDownsample = 0x04,
403 e_StretchBicubic = 0x80,
405 e_StretchNoSmooth = 0x100
406 } StretchMode;
407
415 ImageSettings();
416
417 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
418 explicit ImageSettings(FS_HANDLE handle);
419
421 ~ImageSettings();
422
428 ImageSettings(const ImageSettings& other);
429
437 ImageSettings& operator = (const ImageSettings& other);
445 bool operator == (const ImageSettings& other) const;
446
454 bool operator != (const ImageSettings& other) const;
455
463 bool IsEmpty() const;
464
476 void SetStretchMode(StretchMode mode);
477
489 void SetImageDPI(int32 dpi);
490
509 void SetImageDPILimit(int dpi_limit);
510
522 void SetCompressionMode(ImageCompressMode mode);
523
536 void SetQuality(ImageCompressQuality quality);
537
550 void SetBackgroundDownScale(int32 down_scale);
551
564 void SetForegroundDownScale(int32 down_scale);
565
581 void SetTextSensitivity(int32 text_sensitivity);
582
595 void SetTileSize(int size);
596 };
597
604 class MonoImageSettings FS_FINAL : public Base {
605 public:
611 typedef enum _MonoImageCompressMode {
613 e_ImageCompressCCITT3 = 10001,
615 e_ImageCompressCCITT4 = 10002,
617 e_ImageCompressHigh = 10003,
619 e_ImageCompressjbig2 = 10004,
621 e_ImageCompressRetain = 10007,
623 e_ImageCompressRunLength = 10008,
625 e_ImageCompressZip = 10009
626 } MonoImageCompressMode;
627
633 typedef enum _MonoImageCompressQuality {
635 e_ImageCompressQualityLossless = 1,
637 e_ImageCompressQualityLossy = 2,
639 e_ImageCompressQualityMinimum = 3,
641 e_ImageCompressQualityLow = 4,
643 e_ImageCompressQualityMedium = 5,
645 e_ImageCompressQualityHigh = 6,
647 e_ImageCompressQualityMaximum = 7
648 } MonoImageCompressQuality;
649
655 typedef enum _StretchMode {
657 e_StretchDefault = -1,
659 e_StretchOff = 0x00,
661 e_StretchInterpol = 0x20,
663 e_StretchDownsample = 0x04,
665 e_StretchBicubic = 0x80,
667 e_StretchNoSmooth = 0x100
668 } StretchMode;
669
677 MonoImageSettings();
678
679 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
680 explicit MonoImageSettings(FS_HANDLE handle);
681
683 ~MonoImageSettings();
684
690 MonoImageSettings(const MonoImageSettings& other);
691
699 MonoImageSettings& operator = (const MonoImageSettings& other);
707 bool operator == (const MonoImageSettings& other) const;
708
716 bool operator != (const MonoImageSettings& other) const;
717
725 bool IsEmpty() const;
726
738 void SetImageDPI(int32 dpi);
739
758 void SetImageDPILimit(int dpi_limit);
759
771 void SetCompressionMode(MonoImageCompressMode mode);
772
784 void SetStretchMode(StretchMode mode) ;
785
799 void SetQuality(MonoImageCompressQuality quality);
800 };
801
808 class UnembeddedFontSettings FS_FINAL : public Base {
809 public:
813 UnembeddedFontSettings();
814
815 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
816 explicit UnembeddedFontSettings(FS_HANDLE handle);
817
819 ~UnembeddedFontSettings();
820
826 UnembeddedFontSettings(const UnembeddedFontSettings& other);
827
835 UnembeddedFontSettings& operator=(const UnembeddedFontSettings& other);
836
845 bool operator==(const UnembeddedFontSettings& other) const;
846
855 bool operator!=(const UnembeddedFontSettings& other) const;
856
864 bool IsEmpty() const;
865
874 void SetSubsetAllEmFonts(bool is_subset_all_emb_fonts);
875
888 void SetUnembeddedFontNameArray(const WStringArray& font_name_array);
889 };
890
896 class OptimizerSettings FS_FINAL : public Base {
897 public:
903 typedef enum _OptimizerOptions {
905 e_OptimizerCompressImages = 0x01,
907 e_OptimizerCleanUp = 0x02,
909 e_OptimizerDiscardObjects = 0x04,
911 e_OptimizerUnembeddedFonts = 0x08,
913 e_OptimizerDiscardUserData = 0x10,
915 e_OptimizerTransparency = 0x20
916 } OptimizerOptions;
917
923 typedef enum _CleanUpOptions {
925 e_CleanUpUseFlateForNonEncodedStream = 0x01,
927 e_CleanUpUseFlateInsteadOfLZW = 0x02,
929 e_CleanUpRemoveInvalidBookmarks = 0x04,
931 e_CleanUpRemoveInvalidLinks = 0x08,
933 e_CleanUpDiscardUnreferencedNamedDes = 0x10,
935 e_CleanUpOptPageContent = 0x20
936 } CleanUpOptions;
937
943 typedef enum _DiscardObjectsOptions {
945 e_DiscardObjectsFormActions = 0x01,
947 e_DiscardObjectsFlattenFormFields = 0x02,
953 e_DiscardObjectsJavaScriptActions = 0x04,
955 e_DiscardObjectsEmbeddedPageThumbnails = 0x08,
957 e_DiscardObjectsEmbeddedPrintSettings = 0x10,
959 e_DiscardObjectsBookmarks = 0x20,
968 e_DiscardObjectsAlternateImages = 0x40,
970 e_DiscardObjectsDocumentTags = 0x80,
972 e_DiscardObjectsEmbeddedSearchIndex = 0x100,
974 e_DiscardObjectsDetectAndMergeImageFragment = 0x200,
976 e_DiscardObjectsSmoothlinestocurves = 0x400
977 } DiscardObjectsOptions;
978
984 typedef enum _DiscardUserDataOptions {
986 e_DiscardUserDataAllAnnotsFormsAndMultimedia = 0x01,
988 e_DiscardUserDataExternalCrossReferences = 0x02,
990 e_DiscardUserDataDocumentInfoAndMetaData = 0x04,
992 e_DiscardUserDataFileAttchments = 0x08,
994 e_DiscardUserDataPrivateDataOfOtherApp = 0x10,
996 e_DiscardUserDataLayer = 0x20,
998 e_DiscardUserAllData = 0x40
999 } DiscardUserDataOptions;
1000
1006 typedef enum _TransparencyMode {
1016 e_TransparencyModeLowResolution = 0,
1026 e_TransparencyModeMediumResolution = 1,
1036 e_TransparencyModeHighResolution = 2
1037 } TransparencyMode;
1038
1039
1048 OptimizerSettings();
1049
1050 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1051 explicit OptimizerSettings(FS_HANDLE handle);
1052
1054 ~OptimizerSettings();
1055
1061 OptimizerSettings(const OptimizerSettings& other);
1062
1070 OptimizerSettings& operator = (const OptimizerSettings& other);
1071
1079 bool operator == (const OptimizerSettings& other) const;
1080
1088 bool operator != (const OptimizerSettings& other) const;
1089
1097 bool IsEmpty() const;
1098
1112 void SetOptimizerOptions(uint32 optimize_options);
1113
1135 void SetColorGrayImageSettings(const ImageSettings& settings);
1136
1151 void SetColorImageSettings(const ImageSettings& settings);
1152
1167 void SetGrayscaleImageSettings(const ImageSettings& settings);
1168
1183 void SetMonoImageSettings(const MonoImageSettings& settings);
1184
1198 void SetUnembeddedFontSettings(const UnembeddedFontSettings& settings);
1199
1216 void SetCleanUpOptions(foxit::uint32 clean_up_options);
1217
1234 void SetDiscardObjectsOptions(foxit::uint32 discard_objects_options);
1235
1252 void SetDiscardUserDataOptions(foxit::uint32 discard_userdata_options);
1253
1266 void SetTransparencyMode(TransparencyMode transparency_mode);
1267 };
1268
1274 class OptimizeScannedPDFSettings FS_FINAL : public Base{
1275 public:
1281 typedef enum _ScannedImageCompressMode {
1283 e_ScannedImageCompressHigh = 1,
1285 e_ScannedImageCompressjpeg = 2,
1287 e_ScannedImageCompressjpeg2000LossLess = 3,
1289 e_ScannedImageCompressjpeg2000Lossy = 4
1290 } ScannedImageCompressMode;
1291
1297 typedef enum _ScannedMonoImageCompressMode {
1299 e_ScannedMonoImageCompressjbig2Lossy = 1,
1301 e_ScannedMonoImageCompressjbig2LossLess = 2,
1303 e_ScannedMonoImageCompressCCITT4 = 3,
1305 e_ScannedMonoImageCompressHigh = 4
1306 } ScannedMonoImageCompressMode;
1307
1308
1309 OptimizeScannedPDFSettings();
1310
1311 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
1312 explicit OptimizeScannedPDFSettings(FS_HANDLE handle);
1313
1315 ~OptimizeScannedPDFSettings();
1316
1322 OptimizeScannedPDFSettings(const OptimizeScannedPDFSettings& other);
1323
1331 OptimizeScannedPDFSettings& operator = (const OptimizeScannedPDFSettings& other);
1339 bool operator == (const OptimizeScannedPDFSettings& other) const;
1340
1348 bool operator != (const OptimizeScannedPDFSettings& other) const;
1349
1357 bool IsEmpty() const;
1358
1368 void SetOptimizedPages(const common::Range& pages);
1369
1381 void SetColorGrayImageCompressionMode(ScannedImageCompressMode mode);
1382
1395 void SetColorGrayImageCompressionQuality(foxit::uint32 quality);
1396
1408 void SetMonoImageCompressionMode(ScannedMonoImageCompressMode mode);
1409 };
1410
1411 } // namespace optimization
1412 } // namespace addon
1413 } // namespace foxit
1414
1415 #endif
foxit::addon::optimization::ImageSettings::e_StretchNoSmooth
When this is set, that means not to do any interpolation for stretching.
Definition: fs_optimization.h:405
foxit::addon::optimization::OptimizeScannedPDFSettings::SetColorGrayImageCompressionMode
void SetColorGrayImageCompressionMode(ScannedImageCompressMode mode)
Set compression mode used for optimizing color/gray images in the scanned PDF document.
foxit::addon::optimization::OptimizerSettings::e_DiscardUserAllData
discard tag user data
Definition: fs_optimization.h:998
foxit::addon::optimization::ImageSettings::SetCompressionMode
void SetCompressionMode(ImageCompressMode mode)
Set compression mode used for optimizing color/gray images in a PDF document.
foxit::addon::optimization::ImageSettings::SetImageDPI
void SetImageDPI(int32 dpi)
Set the DPI value as the target compressed value for compressing color/gray images in a PDF document.
foxit::addon::optimization::MonoImageSettings::~MonoImageSettings
~MonoImageSettings()
Destructor.
foxit::addon::optimization::OptimizeScannedPDFSettings::operator=
OptimizeScannedPDFSettings & operator=(const OptimizeScannedPDFSettings &other)
Assign operator.
foxit::addon::optimization::ImageSettings::StretchMode
StretchMode
Enumeration for stretch mode.
Definition: fs_optimization.h:393
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
foxit::addon::optimization::ImageSettings::e_ImageCompressQualityLow
Compression quality: Low.
Definition: fs_optimization.h:377
foxit::addon::optimization::MonoImageSettings::e_ImageCompressQualityLow
Compression quality: Low, only for e_ImageCompressHigh compress mode.
Definition: fs_optimization.h:641
foxit::addon::optimization::ImageSettings::e_ImageCompressQualityMaximum
Compression quality: Maximum.
Definition: fs_optimization.h:383
foxit::addon::optimization::MonoImageSettings::e_StretchDefault
When this is set, that means to do default stretching.
Definition: fs_optimization.h:657
foxit::addon::optimization::MonoImageSettings::e_StretchBicubic
When this is set, that means to do bicubic interpolation for zooming.
Definition: fs_optimization.h:665
foxit::addon::optimization::ImageSettings::SetTileSize
void SetTileSize(int size)
Set the tile size for JPEG2000 compression modes, used for optimizing color/gray images in a PDF docu...
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsEmbeddedPrintSettings
Discard embedded print settings.
Definition: fs_optimization.h:957
foxit::addon::optimization::MonoImageSettings::operator!=
bool operator!=(const MonoImageSettings &other) const
Not equal operator.
foxit::addon::optimization::OptimizerSettings::e_CleanUpRemoveInvalidLinks
Remove invalid links.
Definition: fs_optimization.h:931
foxit::addon::optimization::ImageSettings::operator==
bool operator==(const ImageSettings &other) const
Equal operator.
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsFormActions
Discard all form submission, import and reset actions.
Definition: fs_optimization.h:945
foxit::addon::optimization::MonoImageSettings::e_ImageCompressQualityMinimum
Compression quality: Minimum, only for e_ImageCompressHigh compress mode.
Definition: fs_optimization.h:639
foxit::addon::optimization::ImageSettings::SetStretchMode
void SetStretchMode(StretchMode mode)
Set stretch mode used for optimizing color/gray images in a PDF document.
foxit::addon::optimization::OptimizerSettings::e_DiscardUserDataLayer
Discard hidden layer content and flatten visible layers.
Definition: fs_optimization.h:996
foxit::addon::optimization::ImageCompressionCallback::Release
virtual void Release()=0
A callback function used to release current callback object itself.
foxit::addon::optimization::OptimizerSettings::e_OptimizerDiscardObjects
Optimize PDF document by discarding objects.
Definition: fs_optimization.h:909
foxit::addon::optimization::OptimizerSettings::OptimizerOptions
OptimizerOptions
Enumeration for optimizer options.
Definition: fs_optimization.h:903
foxit::addon::optimization::OptimizerSettings::e_CleanUpUseFlateInsteadOfLZW
In streams that use LZW encoding, use Flate instead.
Definition: fs_optimization.h:927
foxit::addon::optimization::OptimizerSettings::e_TransparencyModeLowResolution
Transparency mode: low resolution.
Definition: fs_optimization.h:1016
foxit::addon::optimization::ImageSettings::~ImageSettings
~ImageSettings()
Destructor.
foxit::addon::optimization::ImageSettings::e_StretchOff
When this is set, that means to do without stretching.
Definition: fs_optimization.h:397
foxit::addon::optimization::ImageSettings
Definition: fs_optimization.h:348
foxit::addon::optimization::OptimizerSettings::e_DiscardUserDataDocumentInfoAndMetaData
Discard document information and metadata.
Definition: fs_optimization.h:990
foxit::addon::optimization::AuditSpaceSize::cross_ref_tables
uint32 cross_ref_tables
Total size of the cross-reference table in bytes.
Definition: fs_optimization.h:206
foxit::addon::optimization::OptimizerSettings::e_TransparencyModeHighResolution
Transparency mode: high resolution.
Definition: fs_optimization.h:1036
foxit::Object
CFX_Object Object
Object type.
Definition: fs_basictypes.h:220
foxit::addon::optimization::OptimizeScannedPDFSettings
Definition: fs_optimization.h:1274
foxit::addon::optimization::MonoImageSettings
Definition: fs_optimization.h:604
foxit::common::Progressive
Definition: fs_common.h:373
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsEmbeddedSearchIndex
Discard embedded search index.
Definition: fs_optimization.h:972
foxit::addon::optimization::MonoImageSettings::SetImageDPI
void SetImageDPI(int32 dpi)
Set the DPI value as the target compressed value for compressing monochrome images in a PDF document.
foxit::addon::optimization::AuditSpaceSize::acroforms
uint32 acroforms
Total size of AcroForm data in bytes.
Definition: fs_optimization.h:143
foxit::addon::optimization::OptimizeScannedPDFSettings::e_ScannedImageCompressjpeg2000LossLess
Compression mode: jpeg2000 lossless.
Definition: fs_optimization.h:1287
foxit::addon::optimization::AuditSpaceSize::AuditSpaceSize
AuditSpaceSize()
Constructor.
Definition: fs_optimization.h:45
foxit::addon::optimization::AuditSpaceSize::color_space
uint32 color_space
Total size of color space definitions in bytes.
Definition: fs_optimization.h:164
foxit::addon::optimization::OptimizerSettings::operator==
bool operator==(const OptimizerSettings &other) const
Equal operator.
foxit::addon::optimization::MonoImageSettings::SetQuality
void SetQuality(MonoImageCompressQuality quality)
Set compression quality, used for optimizing monochrome images in a PDF document.
IFX_FileStream
File stream interface, reading & writing.
Definition: fx_stream.h:692
foxit::addon::optimization::ImageSettings::SetImageDPILimit
void SetImageDPILimit(int dpi_limit)
Set the lower limit DPI value for the color/gray image to decide if the image is to be compressed in ...
foxit::addon::optimization::AuditSpaceSize
Structure of audit space, the unit is byte type.
Definition: fs_optimization.h:42
foxit::addon::optimization::AuditSpaceSize::content_streams
uint32 content_streams
Total size of all page content streams in bytes.
Definition: fs_optimization.h:101
foxit::addon::optimization::OptimizerSettings::~OptimizerSettings
~OptimizerSettings()
Destructor.
foxit::addon::optimization::OptimizerSettings::SetTransparencyMode
void SetTransparencyMode(TransparencyMode transparency_mode)
Set optimization related options for doing transparency.
fs_common.h
Header file for common definitions and classes.
foxit::addon::optimization::ImageSettings::e_ImageCompressQualityMinimum
Compression quality: Minimum.
Definition: fs_optimization.h:375
foxit::addon::optimization::Optimizer
Definition: fs_optimization.h:265
foxit::addon::optimization::MonoImageSettings::StretchMode
StretchMode
Enumeration for stretch mode.
Definition: fs_optimization.h:655
foxit::addon::optimization::OptimizerSettings::OptimizerSettings
OptimizerSettings()
Constructor.
foxit::addon::optimization::ImageSettings::SetQuality
void SetQuality(ImageCompressQuality quality)
Set the quality for lossy compression modes, used for optimizing color/gray images in a PDF document.
foxit::addon::optimization::UnembeddedFontSettings::SetSubsetAllEmFonts
void SetSubsetAllEmFonts(bool is_subset_all_emb_fonts)
Sets whether to include subsets of all unembedded fonts.
foxit::addon::optimization::OptimizeScannedPDFSettings::e_ScannedMonoImageCompressjbig2LossLess
Compression mode: jbig2 lossless.
Definition: fs_optimization.h:1301
foxit::addon::optimization::ImageSettings::e_StretchInterpol
When this is set, that means to do interpolation for zooming.
Definition: fs_optimization.h:399
foxit::addon::optimization::AuditSpaceSize::structure_infos
uint32 structure_infos
Total size of structural information in bytes.
Definition: fs_optimization.h:136
foxit::addon::optimization::MonoImageSettings::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::addon::optimization::MonoImageSettings::e_StretchDownsample
When this is set, that means not to do halftone for shrinking or rotating.
Definition: fs_optimization.h:663
foxit::addon::optimization::ImageSettings::e_ImageCompressRetain
Compression mode: retain, which means no compression.
Definition: fs_optimization.h:363
foxit::addon::optimization::ImageSettings::SetForegroundDownScale
void SetForegroundDownScale(int32 down_scale)
Set the foreground downscale value for lossy compression modes, used for optimizing color images in a...
foxit::addon::optimization::OptimizerSettings::e_CleanUpUseFlateForNonEncodedStream
Use Flate to encode streams that are not encoded.
Definition: fs_optimization.h:925
foxit::addon::optimization::OptimizerSettings::e_TransparencyModeMediumResolution
Transparency mode: medium resolution.
Definition: fs_optimization.h:1026
foxit::addon::optimization::OptimizerSettings::SetUnembeddedFontSettings
void SetUnembeddedFontSettings(const UnembeddedFontSettings &settings)
Set optimization related settings for unembedding fonts.
foxit::addon::optimization::OptimizeScannedPDFSettings::e_ScannedImageCompressjpeg
Compression mode: jpeg.
Definition: fs_optimization.h:1285
foxit::addon::optimization::AuditSpaceSize::images
uint32 images
Total size of embedded images in bytes.
Definition: fs_optimization.h:108
foxit::addon::optimization::MonoImageSettings::e_ImageCompressHigh
Compression mode: high.
Definition: fs_optimization.h:617
foxit::addon::optimization::OptimizeScannedPDFSettings::~OptimizeScannedPDFSettings
~OptimizeScannedPDFSettings()
Destructor.
foxit::addon::optimization::OptimizerSettings::SetCleanUpOptions
void SetCleanUpOptions(foxit::uint32 clean_up_options)
Set optimization related options for cleaning up.
foxit::addon::optimization::MonoImageSettings::e_ImageCompressQualityHigh
Compression quality: High, only for e_ImageCompressHigh compress mode.
Definition: fs_optimization.h:645
foxit::addon::optimization::OptimizerSettings::e_CleanUpRemoveInvalidBookmarks
Remove invalid bookmarks.
Definition: fs_optimization.h:929
foxit::addon::optimization::AuditSpaceSize::extend_graphics_states
uint32 extend_graphics_states
Total size of extended graphics states in bytes.
Definition: fs_optimization.h:199
foxit::addon::optimization::AuditSpaceSize::operator=
AuditSpaceSize & operator=(const AuditSpaceSize &data)
Assign operator.
Definition: fs_optimization.h:73
foxit::addon::optimization::MonoImageSettings::e_ImageCompressCCITT4
Compression mode: CCITT Group 4.
Definition: fs_optimization.h:615
foxit::addon::optimization::AuditSpaceSize::comments_and_3d_contents
uint32 comments_and_3d_contents
Total size of comments and 3D contents in bytes.
Definition: fs_optimization.h:185
foxit::addon::optimization::MonoImageSettings::SetImageDPILimit
void SetImageDPILimit(int dpi_limit)
Set the lower limit DPI value for the monochrome image to decide if the image is to be compressed in ...
foxit::addon::optimization::UnembeddedFontSettings::UnembeddedFontSettings
UnembeddedFontSettings()
Constructor.
foxit::addon::optimization::UnembeddedFontSettings::~UnembeddedFontSettings
~UnembeddedFontSettings()
Destructor.
foxit::addon::optimization::ImageCompressionCallback
Definition: fs_optimization.h:234
foxit::addon::optimization::MonoImageSettings::e_ImageCompressQualityLossy
Compression quality: Lossy.
Definition: fs_optimization.h:637
foxit::addon::optimization::ImageSettings::SetTextSensitivity
void SetTextSensitivity(int32 text_sensitivity)
Set the text sensitivity for lossy compression modes, used for optimizing color images in a PDF docum...
foxit::addon::optimization::OptimizerSettings::SetColorGrayImageSettings
void SetColorGrayImageSettings(const ImageSettings &settings)
Set optimization related settings for color/gray image.
foxit::addon::optimization::ImageSettings::operator!=
bool operator!=(const ImageSettings &other) const
Not equal operator.
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsDocumentTags
Discard document tags.
Definition: fs_optimization.h:970
foxit::addon::optimization::UnembeddedFontSettings::operator!=
bool operator!=(const UnembeddedFontSettings &other) const
Not equal operator.
foxit::addon::optimization::MonoImageSettings::e_ImageCompressCCITT3
Compression mode: CCITT Group 3.
Definition: fs_optimization.h:613
foxit::addon::optimization::ImageSettings::SetBackgroundDownScale
void SetBackgroundDownScale(int32 down_scale)
Set the background downscale value for lossy compression modes, used for optimizing color images in a...
foxit::addon::optimization::UnembeddedFontSettings::operator=
UnembeddedFontSettings & operator=(const UnembeddedFontSettings &other)
Assign operator.
foxit::addon::optimization::OptimizeScannedPDFSettings::SetMonoImageCompressionMode
void SetMonoImageCompressionMode(ScannedMonoImageCompressMode mode)
Set compression mode used for optimizing monochrome images in a scanned PDF document.
foxit::addon::optimization::ImageCompressionCallback::GetTemporaryFileStream
virtual common::file::StreamCallback * GetTemporaryFileStream(const common::Bitmap &bitmap)=0
Get temporary file stream. The file stream is used for saving the encoding result of JPEG2000 and JBI...
foxit::addon::optimization::MonoImageSettings::e_ImageCompressRunLength
Compression mode: run-length.
Definition: fs_optimization.h:623
foxit::addon::optimization::ImageSettings::e_ImageCompressjpeg2000
Compression mode: jpeg2000.
Definition: fs_optimization.h:361
foxit::addon::optimization::OptimizerSettings::TransparencyMode
TransparencyMode
Enumeration for transparency mode.
Definition: fs_optimization.h:1006
foxit::addon::optimization::OptimizeScannedPDFSettings::e_ScannedMonoImageCompressCCITT4
Compression mode: CCITT Group 4.
Definition: fs_optimization.h:1303
foxit::addon::optimization::OptimizerSettings::e_DiscardUserDataFileAttchments
Discard file attachments.
Definition: fs_optimization.h:992
foxit::addon::optimization::OptimizerSettings::SetGrayscaleImageSettings
void SetGrayscaleImageSettings(const ImageSettings &settings)
Set optimization related settings for grayscale image.
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsAlternateImages
Discard all alternate images.
Definition: fs_optimization.h:968
foxit::addon::optimization::UnembeddedFontSettings
Definition: fs_optimization.h:808
foxit::addon::optimization::OptimizeScannedPDFSettings::SetColorGrayImageCompressionQuality
void SetColorGrayImageCompressionQuality(foxit::uint32 quality)
Set the quality for lossy compression modes, used for optimizing color/gray images in a scanned PDF d...
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsSmoothlinestocurves
smooth lines to curves
Definition: fs_optimization.h:976
foxit::addon::optimization::OptimizeScannedPDFSettings::e_ScannedMonoImageCompressHigh
Compression mode: high.
Definition: fs_optimization.h:1305
foxit::addon::optimization::Optimizer::ComputeAuditSpace
static AuditSpaceSize ComputeAuditSpace(const pdf::PDFDoc &doc)
Compute audit space.
foxit::addon::optimization::OptimizerSettings::SetOptimizerOptions
void SetOptimizerOptions(uint32 optimize_options)
Set options to decide which kind of optimizer setting will be used for optimizing PDF document.
foxit::addon::optimization::OptimizerSettings::e_OptimizerUnembeddedFonts
Optimize PDF document by unembedding some embedded fonts.
Definition: fs_optimization.h:911
foxit::addon::optimization::MonoImageSettings::operator=
MonoImageSettings & operator=(const MonoImageSettings &other)
Assign operator.
foxit::addon::optimization::UnembeddedFontSettings::SetUnembeddedFontNameArray
void SetUnembeddedFontNameArray(const WStringArray &font_name_array)
Set a font name array to specify which fonts are to be unembeded.
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsDetectAndMergeImageFragment
Detect and merge image fragments.
Definition: fs_optimization.h:974
foxit::addon::optimization::MonoImageSettings::MonoImageSettings
MonoImageSettings()
Constructor.
foxit::addon::optimization::Optimizer::StartSubsetEmbedFont
static common::Progressive StartSubsetEmbedFont(const pdf::PDFDoc &doc, common::PauseCallback *pause)
Start to make subsets for embedded fonts in the given PDF document.
foxit::addon::optimization::MonoImageSettings::e_StretchOff
When this is set, that means to do without stretching.
Definition: fs_optimization.h:659
foxit::addon::optimization::ImageSettings::e_ImageCompressHigh
Compression mode: high. This flag will be invalid if the image dpi is less than 200.
Definition: fs_optimization.h:357
foxit::addon::optimization::AuditSpaceSize::fonts
uint32 fonts
Total size of embedded fonts in bytes.
Definition: fs_optimization.h:115
foxit::addon::optimization::ImageSettings::e_ImageCompressZip
Compression mode: zip.
Definition: fs_optimization.h:365
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsFlattenFormFields
Flatten form fields.
Definition: fs_optimization.h:947
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsJavaScriptActions
Discard all JavaScript actions.
Definition: fs_optimization.h:953
foxit::addon::optimization::OptimizerSettings::SetDiscardObjectsOptions
void SetDiscardObjectsOptions(foxit::uint32 discard_objects_options)
Set optimization related options for discarding objects.
foxit::addon::optimization::MonoImageSettings::e_ImageCompressQualityLossless
Compression quality: Lossless.
Definition: fs_optimization.h:635
foxit::addon::optimization::ImageSettings::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::addon::optimization::Optimizer::Optimize
static common::Progressive Optimize(const pdf::PDFDoc &doc, const OptimizerSettings &settings, common::PauseCallback *pause)
Optimize the given PDF document with specified optimizer settings.
foxit::addon::optimization::MonoImageSettings::e_ImageCompressRetain
Compression mode: retain, which means no compression.
Definition: fs_optimization.h:621
fs_pdfpage.h
Header file for PDF page related definitions and classes.
foxit::addon::optimization::MonoImageSettings::e_StretchNoSmooth
When this is set, that means not to do any interpolation for stretching.
Definition: fs_optimization.h:667
foxit::addon::optimization::ImageSettings::e_StretchDownsample
When this is set, that means not to do halftone for shrinking or rotating.
Definition: fs_optimization.h:401
foxit::addon::optimization::AuditSpaceSize::named_destnations
uint32 named_destnations
Total size of named destinations in bytes.
Definition: fs_optimization.h:157
foxit::addon::optimization::ImageSettings::e_StretchBicubic
When this is set, that means to do bicubic interpolation for zooming.
Definition: fs_optimization.h:403
foxit::addon::optimization::AuditSpaceSize::x_object_forms
uint32 x_object_forms
Total size of XObject Forms in bytes.
Definition: fs_optimization.h:129
foxit
Foxit namespace.
Definition: fs_taggedpdf.h:27
foxit::addon::optimization::AuditSpaceSize::shading_pattern_infos
uint32 shading_pattern_infos
Total size of shading pattern information in bytes.
Definition: fs_optimization.h:192
foxit::addon::optimization::OptimizeScannedPDFSettings::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::addon::optimization::MonoImageSettings::MonoImageCompressMode
MonoImageCompressMode
Enumeration for compression mode used for monochrome image.
Definition: fs_optimization.h:611
foxit::addon::optimization::OptimizerSettings::DiscardObjectsOptions
DiscardObjectsOptions
Enumeration for discarding objects options.
Definition: fs_optimization.h:943
foxit::addon::optimization::OptimizerSettings::e_CleanUpDiscardUnreferencedNamedDes
Discard unreferenced named destination.
Definition: fs_optimization.h:933
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsBookmarks
Discard bookmarks.
Definition: fs_optimization.h:959
foxit::addon::optimization::OptimizeScannedPDFSettings::ScannedImageCompressMode
ScannedImageCompressMode
Enumeration for compression mode used for color or gray image.
Definition: fs_optimization.h:1281
foxit::addon::optimization::OptimizeScannedPDFSettings::e_ScannedMonoImageCompressjbig2Lossy
Compression mode: jbig2 lossy.
Definition: fs_optimization.h:1299
IFX_Pause
Definition: fx_basic.h:3758
foxit::addon::optimization::OptimizerSettings::operator!=
bool operator!=(const OptimizerSettings &other) const
Not equal operator.
foxit::addon::optimization::ImageSettings::e_ImageCompressQualityHigh
Compression quality: High.
Definition: fs_optimization.h:381
foxit::addon::optimization::AuditSpaceSize::embed_files
uint32 embed_files
Total size of embedded file streams in bytes.
Definition: fs_optimization.h:220
fs_pdfdoc.h
Header file for PDF document related definitions and classes.
foxit::addon::optimization::OptimizerSettings::e_OptimizerCleanUp
Optimize PDF document by cleaning up.
Definition: fs_optimization.h:907
foxit::addon::optimization::OptimizeScannedPDFSettings::e_ScannedImageCompressHigh
Compression mode: high.
Definition: fs_optimization.h:1283
foxit::addon::optimization::OptimizerSettings::SetColorImageSettings
void SetColorImageSettings(const ImageSettings &settings)
Set optimization related settings for color image.
foxit::addon::optimization::ImageSettings::e_ImageCompressjpeg
Compression mode: jpeg.
Definition: fs_optimization.h:359
foxit::addon::optimization::MonoImageSettings::e_ImageCompressZip
Compression mode: zip.
Definition: fs_optimization.h:625
foxit::addon::optimization::ImageSettings::e_StretchDefault
When this is set, that means to do default stretching.
Definition: fs_optimization.h:395
foxit::addon::optimization::AuditSpaceSize::thumbs
uint32 thumbs
Total size of page thumbnails in bytes.
Definition: fs_optimization.h:213
foxit::addon::optimization::MonoImageSettings::SetCompressionMode
void SetCompressionMode(MonoImageCompressMode mode)
Set compression mode used for optimizing monochrome images in a PDF document.
foxit::addon::optimization::ImageSettings::e_ImageCompressQualityMedium
Compression quality: Medium.
Definition: fs_optimization.h:379
foxit::addon::optimization::MonoImageSettings::e_ImageCompressQualityMaximum
Compression quality: Maximum, only for e_ImageCompressHigh compress mode.
Definition: fs_optimization.h:647
foxit::addon::optimization::OptimizerSettings::DiscardUserDataOptions
DiscardUserDataOptions
Enumeration for discarding user data options.
Definition: fs_optimization.h:984
foxit::addon::optimization::Optimizer::OptimizeScannedPDF
static common::Progressive OptimizeScannedPDF(const pdf::PDFDoc &doc, const OptimizeScannedPDFSettings &settings, ImageCompressionCallback *image_compress_callback, common::PauseCallback *pause)
Optimize the scanned PDF document with specified optimizers settings.
foxit::pdf::PDFDoc
Definition: fs_pdfdoc.h:776
foxit::addon::optimization::OptimizerSettings::e_DiscardUserDataAllAnnotsFormsAndMultimedia
Discard all annotations, forms and multimedia.
Definition: fs_optimization.h:986
foxit::addon::optimization::MonoImageSettings::e_ImageCompressjbig2
Compression mode: jbig2.
Definition: fs_optimization.h:619
foxit::addon::optimization::OptimizeScannedPDFSettings::ScannedMonoImageCompressMode
ScannedMonoImageCompressMode
Enumeration for compression mode used for monochrome image.
Definition: fs_optimization.h:1297
foxit::int32
FX_INT32 int32
32-bit signed integer.
Definition: fs_basictypes.h:193
foxit::addon::optimization::OptimizerSettings::e_DiscardUserDataPrivateDataOfOtherApp
Discard private data of other applications.
Definition: fs_optimization.h:994
foxit::addon::optimization::AuditSpaceSize::pattern_infos
uint32 pattern_infos
Total size of pattern objects in bytes.
Definition: fs_optimization.h:171
foxit::addon::optimization::OptimizerSettings::SetMonoImageSettings
void SetMonoImageSettings(const MonoImageSettings &settings)
Set optimization related settings for monochrome image.
foxit::addon::optimization::OptimizeScannedPDFSettings::operator==
bool operator==(const OptimizeScannedPDFSettings &other) const
Equal operator.
foxit::addon::optimization::ImageSettings::ImageCompressMode
ImageCompressMode
Enumeration for compression mode used for color or gray image.
Definition: fs_optimization.h:355
foxit::addon::optimization::OptimizerSettings::e_CleanUpOptPageContent
Cleanup page content Change 0A,0D in the content stream to Spaces.
Definition: fs_optimization.h:935
foxit::WStringArray
Definition: fs_basictypes.h:227
foxit::addon::optimization::OptimizerSettings::e_OptimizerTransparency
Optimize PDF document by doing transparency.
Definition: fs_optimization.h:915
foxit::addon::optimization::OptimizeScannedPDFSettings::SetOptimizedPages
void SetOptimizedPages(const common::Range &pages)
Set the pages which will be optimized.
foxit::addon::optimization::ImageSettings::ImageSettings
ImageSettings()
Constructor.
foxit::addon::optimization::AuditSpaceSize::bookmarks
uint32 bookmarks
Total size of bookmarks data in bytes.
Definition: fs_optimization.h:122
foxit::addon::optimization::OptimizerSettings::e_OptimizerCompressImages
Optimize PDF document by compressing images.
Definition: fs_optimization.h:905
foxit::addon::optimization::UnembeddedFontSettings::operator==
bool operator==(const UnembeddedFontSettings &other) const
Equal operator.
foxit::addon::optimization::MonoImageSettings::MonoImageCompressQuality
MonoImageCompressQuality
Enumeration for compression quality used for monochrome image.
Definition: fs_optimization.h:633
foxit::addon::optimization::UnembeddedFontSettings::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::addon::optimization::MonoImageSettings::e_StretchInterpol
When this is set, that means to do interpolation for zooming.
Definition: fs_optimization.h:661
foxit::addon::optimization::AuditSpaceSize::web_infos
uint32 web_infos
Total size of web-related metadata in bytes.
Definition: fs_optimization.h:227
foxit::addon::optimization::OptimizerSettings
Definition: fs_optimization.h:896
foxit::addon::optimization::AuditSpaceSize::link_annots
uint32 link_annots
Total size of link annotations in bytes.
Definition: fs_optimization.h:150
foxit::addon::optimization::OptimizeScannedPDFSettings::e_ScannedImageCompressjpeg2000Lossy
Compression mode: jpeg2000 lossy.
Definition: fs_optimization.h:1289
foxit::addon::optimization::OptimizerSettings::e_DiscardObjectsEmbeddedPageThumbnails
Discard embedded page thumbnails.
Definition: fs_optimization.h:955
foxit::addon::optimization::OptimizerSettings::SetDiscardUserDataOptions
void SetDiscardUserDataOptions(foxit::uint32 discard_userdata_options)
Set optimization related options for discarding user data.
foxit::addon::optimization::ImageSettings::operator=
ImageSettings & operator=(const ImageSettings &other)
Assign operator.
foxit::common::Range
Definition: fs_common.h:1368
foxit::common::Bitmap
Definition: fs_image.h:36
foxit::addon::optimization::OptimizeScannedPDFSettings::operator!=
bool operator!=(const OptimizeScannedPDFSettings &other) const
Not equal operator.
foxit::addon::optimization::ImageSettings::ImageCompressQuality
ImageCompressQuality
Enumeration for loss compression quality used for color or gray image.
Definition: fs_optimization.h:373
foxit::addon::optimization::MonoImageSettings::operator==
bool operator==(const MonoImageSettings &other) const
Equal operator.
foxit::addon::optimization::ImageSettings::e_ImageCompressQualityLossless
Compression quality: Lossless, only for jpeg2000 compress mode.
Definition: fs_optimization.h:385
foxit::addon::optimization::OptimizerSettings::operator=
OptimizerSettings & operator=(const OptimizerSettings &other)
Assign operator.
foxit::uint32
FX_UINT32 uint32
32-bit unsigned integer.
Definition: fs_basictypes.h:195
foxit::addon::optimization::MonoImageSettings::e_ImageCompressQualityMedium
Compression quality: Medium, only for e_ImageCompressHigh compress mode.
Definition: fs_optimization.h:643
foxit::addon::optimization::OptimizerSettings::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::Base
Definition: fs_basictypes.h:451
foxit::addon::optimization::OptimizerSettings::e_OptimizerDiscardUserData
Optimize PDF document by discarding user data.
Definition: fs_optimization.h:913
foxit::addon::optimization::OptimizerSettings::CleanUpOptions
CleanUpOptions
Enumeration for cleaning up options.
Definition: fs_optimization.h:923
foxit::addon::optimization::MonoImageSettings::SetStretchMode
void SetStretchMode(StretchMode mode)
Set stretch mode used for optimizing monochrome images in a PDF document.
foxit::addon::optimization::AuditSpaceSize::piece_infos
uint32 piece_infos
Total size of piece information in bytes.
Definition: fs_optimization.h:178
foxit::addon::optimization::OptimizerSettings::e_DiscardUserDataExternalCrossReferences
Discard external cross references.
Definition: fs_optimization.h:988