3#ifndef PDFSDK_CXX_CORE_H_INCLUDED_
4#define PDFSDK_CXX_CORE_H_INCLUDED_
6#include <pdfsdk/core.h>
7#include <pdfsdk/cxx/action.h>
8#include <pdfsdk/cxx/annot.h>
9#include <pdfsdk/cxx/bookmark.h>
10#include <pdfsdk/cxx/clip.h>
11#include <pdfsdk/cxx/collection.h>
12#include <pdfsdk/cxx/color.h>
13#include <pdfsdk/cxx/color_space.h>
14#include <pdfsdk/cxx/content.h>
15#include <pdfsdk/cxx/dest.h>
16#include <pdfsdk/cxx/document.h>
17#include <pdfsdk/cxx/element.h>
18#include <pdfsdk/cxx/filespec.h>
19#include <pdfsdk/cxx/font.h>
20#include <pdfsdk/cxx/form_field.h>
21#include <pdfsdk/cxx/function.h>
22#include <pdfsdk/cxx/gstate.h>
23#include <pdfsdk/cxx/object.h>
24#include <pdfsdk/cxx/optional_content.h>
25#include <pdfsdk/cxx/page.h>
26#include <pdfsdk/cxx/page_text.h>
27#include <pdfsdk/cxx/pattern.h>
28#include <pdfsdk/cxx/progress_monitor.h>
29#include <pdfsdk/cxx/read_stream.h>
30#include <pdfsdk/cxx/shading.h>
31#include <pdfsdk/cxx/soft_mask.h>
32#include <pdfsdk/cxx/standard_security.h>
33#include <pdfsdk/cxx/text_run.h>
34#include <pdfsdk/cxx/write_stream.h>
35#include <pdfsdk/cxx/xgroup.h>
36#include <pdfsdk/cxx/xobject.h>
48inline void Init(
const std::string& licenseKey,
49 const std::filesystem::path& resourcesDir = std::filesystem::path(),
50 const std::filesystem::path& tempDir = std::filesystem::path(),
51 const std::filesystem::path& appDataDir = std::filesystem::path()) {
52 std::wstring resourcesDirStr = resourcesDir.wstring();
53 std::wstring tempDirStr = tempDir.wstring();
54 std::wstring appDataDirStr = appDataDir.wstring();
57 initdata.resourcesDirectoryPath = resourcesDirStr.c_str();
58 initdata.tempDirectoryPath = tempDirStr.c_str();
59 initdata.appDataDirectoryPath = appDataDirStr.c_str();
61 PDF_CHECK_SUCCESS_X(PDInit(licenseKey.c_str(), &initdata,
"cxx"));
70inline void Done() noexcept {
91 const std::filesystem::path& resourcesDir = std::filesystem::path(),
92 const std::filesystem::path& tempDir = std::filesystem::path(),
93 const std::filesystem::path& appDataDir = std::filesystem::path()) {
94 Init(licenseKey, resourcesDir, tempDir, appDataDir);
121inline PDAtom Atomize(
const char* c_str) {
122 PDAtom atom = kPDAtomNull;
123 PDF_CHECK_SUCCESS_X(PDAtomPutString(c_str, &atom));
136inline PDAtom Atomize(
const std::string& str) {
137 return Atomize(str.c_str());
149inline std::string AtomToString(PDAtom atom) {
150 const char* str =
"";
151 PDF_CHECK_SUCCESS_X(PDAtomGetString(atom, &str));
Represents a scope for initializing and cleaning up the PDF SDK.
Definition core.h:81
InitScope(const std::string &licenseKey, const std::filesystem::path &resourcesDir=std::filesystem::path(), const std::filesystem::path &tempDir=std::filesystem::path(), const std::filesystem::path &appDataDir=std::filesystem::path())
Constructs an InitScope object and initializes the PDF SDK.
Definition core.h:90
~InitScope()
Destructs the InitScope object and cleans up the PDF SDK.
Definition core.h:103