PDF SDK Documentation

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

Loading...
Searching...
No Matches
filespec.h
1// Copyright (c) 2009-2025 Avanquest Software. All rights reserved.
2
3#ifndef PDFSDK_CXX_PDF_FILESPEC_H_INCLUDED_
4#define PDFSDK_CXX_PDF_FILESPEC_H_INCLUDED_
5
6#include <filesystem>
7#include <string>
8
9#include <pdfsdk/core/types.h>
10
11#include "forward_declarations.h"
12#include "wrapper_base.h"
13
14namespace PDF {
15
29class FileSpec : public detail::RefCountedHandle<PDFileSpec> {
30public:
40 static FileSpec CreateFromPdfObject(const Object& object);
41
54
63 void SetFileSystem(PDAtom fileSys);
64
73 PDAtom GetFileSystem();
74
79 void SetPath(const std::wstring& path);
80
85 std::wstring GetPath();
86
94 void SetDesc(const std::wstring& desc);
95
103 std::wstring GetDesc();
104
110
116
121 int64_t GetFileSize();
122
132
140 void SetThumbnail(const XObject& thumb);
141
146 void SaveToFile(const std::filesystem::path& path);
147
148 PDF_CXX_CORE_WRAPPER_DEFINE_MEMBERS_(FileSpec, PDFileSpec)
149};
150
151} // namespace PDF
152
153#include "filespec_impl.inl"
154
155#endif // PDFSDK_CXX_PDF_FILESPEC_H_INCLUDED_
Represents a PDF document.
Definition document.h:22
Specifies an external file which is referred to inside a PDF document.
Definition filespec.h:29
void SaveToFile(const std::filesystem::path &path)
Saves the embedded file to the specified path.
void SetDesc(const std::wstring &desc)
Sets the description associated with the embedded file.
void SetThumbnail(const XObject &thumb)
Sets the thumbnail image for the externally specified file.
void SetFileSystem(PDAtom fileSys)
Sets the file system to interpret the file specification.
Object GetPdfObject() const
Gets the PDF object created by the file specification.
std::wstring GetDesc()
Gets the embedded file's description.
PDDateTime GetCreateDate()
Gets the creation date of the embedded file.
void SetPath(const std::wstring &path)
Sets the path of the embedded file.
XObject GetThumbnail(const Document &doc)
Gets the thumbnail image of the embedded file.
PDDateTime GetModDate()
Gets the modification date of the embedded file.
int64_t GetFileSize()
Gets the size of the embedded file.
static FileSpec CreateFromPdfObject(const Object &object)
Creates a file specification from the specified PDF object.
std::wstring GetPath()
Gets the path of the embedded file.
PDAtom GetFileSystem()
Gets the file system, set to interpret the file specification.
Represents a PDF object.
Definition object.h:20
Represents an XObject in a PDF document.
Definition xobject.h:22
Definition types.h:23
Common types.