Extended .NET SDK Documentation 2025 SP0
Loading...
Searching...
No Matches
PDFDocument.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (http://www.swig.org).
5// Version 4.0.2
6//
7// Do not make changes to this file unless you know what you are doing--modify
8// the SWIG interface file instead.
9//------------------------------------------------------------------------------
10
11namespace Teigha.Core {
12
13using System;
14using System.Runtime.InteropServices;
15
16public class PDFDocument : global::System.IDisposable {
17 private Object locker = new Object();
18 private HandleRef swigCPtr;
19 protected bool swigCMemOwn;
20 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
21 public PDFDocument(IntPtr cPtr, bool cMemoryOwn) {
22 swigCMemOwn = cMemoryOwn;
23 swigCPtr = new HandleRef(this, cPtr);
24 }
25 [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
26 public static HandleRef getCPtr(PDFDocument obj) {
27 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
28 }
29
30 ~PDFDocument() {
31 Dispose(false);
32 }
33
34 public void Dispose() {
35 Dispose(true);
36 global::System.GC.SuppressFinalize(this);
37 }
38
39 protected virtual void Dispose(bool disposing) {
40 lock(this) {
41 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
42 if (swigCMemOwn) {
43 swigCMemOwn = false;
45 }
46 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
47 }
48 }
49 }
50
51 public PDFDocument() : this(GlobalsPINVOKE.new_PDFDocument(), true) {
53 }
54
59
65
71
76
82
87
93
98
104
109
115
120
126
131
132 public bool isPdfA() {
133 bool ret = GlobalsPINVOKE.PDFDocument_isPdfA(swigCPtr);
135 return ret;
136 }
137
138 public void setPdfA(bool bEnable) {
139 GlobalsPINVOKE.PDFDocument_setPdfA(swigCPtr, bEnable);
141 }
142
143 public bool useQPDF() {
144 bool ret = GlobalsPINVOKE.PDFDocument_useQPDF(swigCPtr);
146 return ret;
147 }
148
153
159
160 public virtual bool Export(PDFIStream pStream, PDFVersion ver) {
161 bool ret = GlobalsPINVOKE.PDFDocument_Export(swigCPtr, PDFIStream.getCPtr(pStream), PDFVersion.getCPtr(ver));
163 return ret;
164 }
165
166 public bool AddObject(PDFObject pObj) {
167 bool ret = GlobalsPINVOKE.PDFDocument_AddObject(swigCPtr, PDFObject.getCPtr(pObj));
169 return ret;
170 }
171
176
182
184 MemoryManager mMan = MemoryManager.GetMemoryManager();
185 MemoryTransaction mTrans = mMan.GetCurrentTransaction(); // MemoryTransaction #25
186 IntPtr ptr = GlobalsPINVOKE.PDFDocument_Root(swigCPtr);
187
188 PDFCatalogDictionary ret = null;
189 if (null != mTrans)
190 {
191 mTrans.AddObject(Teigha.Core.Helpers.odCreateObjectInternal<PDFCatalogDictionary>(typeof(PDFCatalogDictionary), ptr, true));
192 ret = Teigha.Core.Helpers.odCreateObjectInternal<PDFCatalogDictionary>(typeof(PDFCatalogDictionary), ptr, false);
193 }
194 else
195 {
196 ret = Teigha.Core.Helpers.odCreateObjectInternal<PDFCatalogDictionary>(typeof(PDFCatalogDictionary), ptr, true);
197 }
198
200 return ret;
201}
202
208
210 MemoryManager mMan = MemoryManager.GetMemoryManager();
211 MemoryTransaction mTrans = mMan.GetCurrentTransaction(); // MemoryTransaction #25
213
214 PDFDocumentInformation ret = null;
215 if (null != mTrans)
216 {
217 mTrans.AddObject(Teigha.Core.Helpers.odCreateObjectInternal<PDFDocumentInformation>(typeof(PDFDocumentInformation), ptr, true));
218 ret = Teigha.Core.Helpers.odCreateObjectInternal<PDFDocumentInformation>(typeof(PDFDocumentInformation), ptr, false);
219 }
220 else
221 {
222 ret = Teigha.Core.Helpers.odCreateObjectInternal<PDFDocumentInformation>(typeof(PDFDocumentInformation), ptr, true);
223 }
224
226 return ret;
227}
228
234
240
246
247 public bool HasFilter(String FilterName) {
248 bool ret = GlobalsPINVOKE.PDFDocument_HasFilter(swigCPtr, FilterName);
250 return ret;
251 }
252
253 public PDFStreamFilter GetFilter(String FilterName) {
254 MemoryManager mMan = MemoryManager.GetMemoryManager();
255 MemoryTransaction mTrans = mMan.GetCurrentTransaction(); // MemoryTransaction #25
256 IntPtr ptr = GlobalsPINVOKE.PDFDocument_GetFilter(swigCPtr, FilterName);
257
258 PDFStreamFilter ret = null;
259 if (null != mTrans)
260 {
261 mTrans.AddObject(Teigha.Core.Helpers.odCreateObjectInternal<PDFStreamFilter>(typeof(PDFStreamFilter), ptr, true));
262 ret = Teigha.Core.Helpers.odCreateObjectInternal<PDFStreamFilter>(typeof(PDFStreamFilter), ptr, false);
263 }
264 else
265 {
266 ret = Teigha.Core.Helpers.odCreateObjectInternal<PDFStreamFilter>(typeof(PDFStreamFilter), ptr, true);
267 }
268
270 return ret;
271}
272
273}
274
275}
static global::System.Exception Retrieve()
static void PDFDocument_setUseQPDF(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static void PDFDocument_setTmpStream(global::System.Runtime.InteropServices.HandleRef jarg1, HandleRef jarg2)
static IntPtr PDFDocument_GetFilter(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2)
static bool PDFDocument_setDocumentInformation(global::System.Runtime.InteropServices.HandleRef jarg1, HandleRef jarg2)
static bool PDFDocument_Export(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static bool PDFDocument_HasFilter(global::System.Runtime.InteropServices.HandleRef jarg1, [MarshalAs(UnmanagedType.LPWStr)]String jarg2)
static void PDFDocument_setPdfA(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static bool PDFDocument_isPdfA(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PDFDocument_useQPDF(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PDFDocument_encodingFlateEnabled(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PDFDocument_enableFlateEncoding(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static void PDFDocument_enableEncodingASCIIHEX(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static bool PDFDocument_encodingTIFFEnabled(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PDFDocument_encodingEnabled(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PDFDocument_encodingDCTEnabled(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PDFDocument_AddObject(global::System.Runtime.InteropServices.HandleRef jarg1, HandleRef jarg2)
static bool PDFDocument_encodingASCIIHEXEnabled(global::System.Runtime.InteropServices.HandleRef jarg1)
static String PDFDocument_getUniqueTempPath(global::System.Runtime.InteropServices.HandleRef jarg1)
static IntPtr PDFDocument_Root(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PDFDocument_enableEncoding(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static bool PDFDocument_RegistryFilter(global::System.Runtime.InteropServices.HandleRef jarg1, HandleRef jarg2)
static global::System.IntPtr PDFDocument_getNextObjectID(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_PDFDocument(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PDFDocument_enableEncodingDCT(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static global::System.IntPtr PDFDocument_getVersion(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PDFDocument_clearDictionaries(global::System.Runtime.InteropServices.HandleRef jarg1)
static String PDFDocument_getUniqueKey(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PDFDocument_enableTIFFEncoding(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2)
static bool PDFDocument_setRoot(global::System.Runtime.InteropServices.HandleRef jarg1, HandleRef jarg2)
static IntPtr PDFDocument_getDocumentInformation(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PDFDocument_RemoveObject(global::System.Runtime.InteropServices.HandleRef jarg1, HandleRef jarg2)
static global::System.IntPtr PDFDocument_getLastObjectID(global::System.Runtime.InteropServices.HandleRef jarg1)
static HandleRef getCPtr(OdStreamBuf obj)
static HandleRef getCPtr(PDFCatalogDictionary obj)
virtual bool Export(PDFIStream pStream, PDFVersion ver)
static HandleRef getCPtr(PDFDocument obj)
void setTmpStream(OdStreamBuf pTmpStream)
bool setRoot(PDFCatalogDictionary pObj)
PDFDocument(IntPtr cPtr, bool cMemoryOwn)
bool setDocumentInformation(PDFDocumentInformation pDI)
void RemoveObject(PDFObject pObj)
void enableEncodingDCT(bool bEnable)
PDFStreamFilter GetFilter(String FilterName)
void enableEncoding(bool bEnable)
bool HasFilter(String FilterName)
bool AddObject(PDFObject pObj)
PDFCatalogDictionary Root()
PDFDocumentInformation getDocumentInformation()
bool RegistryFilter(PDFStreamFilter pFilter)
virtual void Dispose(bool disposing)
PDFObjectID getNextObjectID()
void setUseQPDF(bool bEnable)
void setPdfA(bool bEnable)
void enableFlateEncoding(bool bEnable)
void enableTIFFEncoding(bool bEnable)
void enableEncodingASCIIHEX(bool bEnable)
PDFObjectID getLastObjectID()
static HandleRef getCPtr(PDFDocumentInformation obj)
static HandleRef getCPtr(PDFIStream obj)
Definition PDFIStream.cs:25
static HandleRef getCPtr(PDFObject obj)
Definition PDFObject.cs:25
static HandleRef getCPtr(PDFStreamFilter obj)
static HandleRef getCPtr(PDFVersion obj)
Definition PDFVersion.cs:26