CFx SDK Documentation  2022 SP0
PdfImport.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef _PDFIMPORT_INCLUDED_
25 #define _PDFIMPORT_INCLUDED_
26 
27 #include "RxModule.h"
28 #include "RxDictionary.h"
29 #include "DynamicLinker.h"
30 
32 
33 #include "OdPlatformSettings.h"
34 
35 #ifdef PDFIMPORT_EXPORTS
36  #define PDFIMPORT_TOOLKIT OD_TOOLKIT_EXPORT
37  #define PDFIMPORT_TOOLKIT_STATIC OD_STATIC_EXPORT
38 #else
39  #define PDFIMPORT_TOOLKIT OD_TOOLKIT_IMPORT
40  #define PDFIMPORT_TOOLKIT_STATIC OD_STATIC_IMPORT
41 #endif
42 
44 
45 class OdDbDatabase;
46 
47 //DD:EXPORT_ON
48 
54 class OdPdfImport : public OdRxObject
55 {
56 public:
60  {
61  success, // The import process is successfully finished.
62  fail, // The import process is failed.
63  bad_password, // The import process is failed because of an incorrect password.
64  bad_file, // The import process is failed because of an incorrect input .pdf file.
65  bad_database, // The import process is failed because of an incorrect destination database object.
66  encrypted_file, // The import process is failed because of an encrypted input .pdf file.
67  invalid_page_number, // The import process is failed because of an invalid page number of the input .pdf file.
68  image_file_error, // The import process is failed because of an error during the image file saving (the possible reason is an invalid directory for saving).
69  no_objects_imported // The import process is failed because no objects were imported.
70  };
71 
79  virtual ImportResult import() = 0;
80 
122 };
123 
128 
134 {
135 public:
136 
141  virtual OdPdfImportPtr create () = 0;
142 
143 };
144 
149 
150 
157 {
159  if ( !pModule.isNull() ) return pModule->create ();
160  return (OdPdfImport*)0;
161 }
162 
163 //DD:EXPORT_OFF
164 
165 #endif // _PDFIMPORT_INCLUDED_
FIRSTDLL_EXPORT OdRxDynamicLinker * odrxDynamicLinker()
#define OdPdfImportModuleName
OdPdfImportPtr createImporter()
Definition: PdfImport.h:156
OdSmartPtr< OdPdfImport > OdPdfImportPtr
Definition: PdfImport.h:127
OdSmartPtr< OdPdfImportModule > OdPdfImportModulePtr
Definition: PdfImport.h:148
bool isNull() const
Definition: BaseObjectPtr.h:70
virtual OdRxDictionaryPtr properties()=0
@ encrypted_file
Definition: PdfImport.h:66
@ bad_database
Definition: PdfImport.h:65
@ image_file_error
Definition: PdfImport.h:68
@ bad_password
Definition: PdfImport.h:63
@ invalid_page_number
Definition: PdfImport.h:67
@ no_objects_imported
Definition: PdfImport.h:69
virtual OdPdfImportPtr create()=0
virtual OdRxModulePtr loadApp(const OdString &applicationName, bool silent=true)=0