PDF SDK Documentation

Comprehensive Guide for Developers: Features, Integration, and API Reference

Loading...
Searching...
No Matches
document_optimizer.h
1// Copyright (c) 2009-2025 Avanquest Software. All rights reserved.
2
3#ifndef PDFSDK_CXX_DOCUMENT_OPTIMIZER_H_INCLUDED_
4#define PDFSDK_CXX_DOCUMENT_OPTIMIZER_H_INCLUDED_
5
6#include <filesystem>
7
8#include <pdfsdk/cxx/document.h>
10
11namespace PDF {
12
13using OptimizeOptions = ::PDFOptimizeOptions;
14
16public:
24 static void Optimize(const Document& document,
25 const std::filesystem::path& destPath,
26 const OptimizeOptions& options,
27 ProgressMonitor* progress = nullptr);
28};
29
31 const std::filesystem::path& destPath,
32 const OptimizeOptions& options,
33 ProgressMonitor* progress) {
34 PDF_CHECK_SUCCESS_X(PDFOptimizeDocument(document.get(),
35 destPath.wstring().c_str(),
36 &options,
37 progress ? progress->monitor() : nullptr,
38 progress ? progress->userdata() : nullptr));
39}
40
41} // namespace PDF
42
43#endif // PDFSDK_CXX_DOCUMENT_OPTIMIZER_H_INCLUDED_
Represents a PDF document.
Definition document.h:22
Definition document_optimizer.h:15
static void Optimize(const Document &document, const std::filesystem::path &destPath, const OptimizeOptions &options, ProgressMonitor *progress=nullptr)
Compresses the specified document and saves it to the specified path.
Definition document_optimizer.h:30
Progress monitor for tracking the progress of an operation.
Definition progress_monitor.h:14
The PDF Document Optimizer API.
PDFSDK_IMPORT_ PDErrCode PDFSDK_CALLCONV PDFOptimizeDocument(PDDoc sourceDoc, const wchar_t *destPath, const PDFOptimizeOptions *options, const PDProgressMonitor *progress, void *progressData)
Optimizes the specified document and saves it to the specified path.
Options for the optimization process.
Definition document_optimizer.h:54