├── .gitattributes ├── .gitignore ├── CPP ├── ImportConverter │ ├── CPXV_Control.cpp │ ├── CPXV_Control.h │ ├── CustomImportConverter.cpp │ ├── CustomImportConverter.h │ ├── ImportConverter.cpp │ ├── ImportConverter.h │ ├── ImportConverter.rc │ ├── ImportConverter.sln │ ├── ImportConverter.vcxproj │ ├── ImportConverter.vcxproj.filters │ ├── ImportConverterDlg.cpp │ ├── ImportConverterDlg.h │ ├── github_repos.csv │ ├── res │ │ ├── ImportConverter.ico │ │ ├── ImportConverter.rc2 │ │ ├── Toolbar.bmp │ │ └── Toolbar256.bmp │ ├── resource.h │ ├── stdafx.cpp │ ├── stdafx.h │ └── targetver.h ├── PDFXEditSDK │ ├── CabHelper.h │ ├── Macroses.h │ ├── PDFEditorSDK.h │ └── PDFXEditSDK.vcxitems ├── PDFXeditPref │ ├── AboutDlg.cpp │ ├── AboutDlg.h │ ├── MainDlg.cpp │ ├── MainDlg.h │ ├── PDFXeditPref.cpp │ ├── PDFXeditPref.h │ ├── PDFXeditPref.rc │ ├── PDFXeditPref.sln │ ├── PDFXeditPref.vcxproj │ ├── PDFXeditPref.vcxproj.filters │ ├── PrefInst.cpp │ ├── PrefInst.h │ ├── packages.config │ ├── res │ │ └── PDFXeditPref.ico │ ├── resource.h │ ├── stdafx.cpp │ └── stdafx.h └── WTLSample │ ├── AboutDlg.cpp │ ├── AboutDlg.h │ ├── CCustomEventTarget.cpp │ ├── CCustomEventTarget.h │ ├── MainFrm.cpp │ ├── MainFrm.h │ ├── Ribbon.h │ ├── Ribbon.rc │ ├── Ribbon.xml │ ├── WTLSample.cpp │ ├── WTLSample.h │ ├── WTLSample.rc │ ├── WTLSample.sln │ ├── WTLSample.vcxproj │ ├── WTLSample.vcxproj.filters │ ├── WTLSampleView.cpp │ ├── WTLSampleView.h │ ├── packages.config │ ├── res │ ├── WTLSample.ico │ └── toolbar.bmp │ ├── resource.h │ ├── stdafx.cpp │ └── stdafx.h ├── CSharp ├── CustomPane │ ├── App.config │ ├── CustomPane.csproj │ ├── CustomPane.png │ ├── CustomPane.sln │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── README.md │ ├── UserControl1.Designer.cs │ ├── UserControl1.cs │ ├── UserControl1.resx │ └── app.manifest ├── CustomTool │ ├── App.config │ ├── CustomTool.csproj │ ├── CustomTool.csproj.bak │ ├── CustomTool.sln │ ├── DrawHighlightOnPagesCallback.cs │ ├── Extensions │ │ ├── PagesViewEx.cs │ │ └── RectEx.cs │ ├── Helpers │ │ └── CalcAssistant.cs │ ├── MainForm.Designer.cs │ ├── MainForm.cs │ ├── MainForm.resx │ ├── PageRegions.cs │ ├── PagesMarkupTool.cs │ ├── Program.cs │ └── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings ├── FullDemo │ ├── AddWatermarkForm.Designer.cs │ ├── AddWatermarkForm.cs │ ├── AddWatermarkForm.resx │ ├── App.config │ ├── CmdBarTree.cs │ ├── CropPages.Designer.cs │ ├── CropPages.cs │ ├── CropPages.resx │ ├── DeletePages.Designer.cs │ ├── DeletePages.cs │ ├── DeletePages.resx │ ├── ExtractPagesForm.Designer.cs │ ├── ExtractPagesForm.cs │ ├── ExtractPagesForm.resx │ ├── FullDemo.csproj │ ├── FullDemo.sln │ ├── FullDemo.tss │ ├── HResults.cs │ ├── IFormHelper.cs │ ├── IStreamWrapper.cs │ ├── InsertEmptyPages.Designer.cs │ ├── InsertEmptyPages.cs │ ├── InsertEmptyPages.resx │ ├── InsertPagesForm.Designer.cs │ ├── InsertPagesForm.cs │ ├── InsertPagesForm.resx │ ├── MainFrm.Designer.cs │ ├── MainFrm.cs │ ├── MainFrm.resx │ ├── MovePages.Designer.cs │ ├── MovePages.cs │ ├── MovePages.resx │ ├── OCRPagesForm.Designer.cs │ ├── OCRPagesForm.cs │ ├── OCRPagesForm.resx │ ├── OperationDemo.cs │ ├── PDFXEditCore.x86.X.manifest │ ├── PrintAdvancedOptions.Designer.cs │ ├── PrintAdvancedOptions.cs │ ├── PrintAdvancedOptions.resx │ ├── PrintForm.Designer.cs │ ├── PrintForm.cs │ ├── PrintForm.resx │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── Registration-Free │ │ ├── FullDemo.exe.manifest │ │ ├── PDFXEditCore.x86.X.manifest │ │ └── Readme.txt │ ├── ResizePagesForm.Designer.cs │ ├── ResizePagesForm.cs │ ├── ResizePagesForm.resx │ ├── Resources │ │ └── ico.msg.warning.24.png │ ├── RotatePagesForm.Designer.cs │ ├── RotatePagesForm.cs │ ├── RotatePagesForm.resx │ └── app.manifest ├── OptimizeImagesCompression │ ├── App.config │ ├── CmdArgsParser.cs │ ├── GetTestFiles.cs │ ├── Logger.cs │ ├── OperationParameters.cs │ ├── OptimizeImagesCompression.csproj │ ├── OptimizeImagesCompression.sln │ ├── PDFXEDIT.cs │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ └── Resources.resx │ └── README.md ├── PreviewCtrl │ ├── App.config │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── PreviewCtrl.Designer.cs │ ├── PreviewCtrl.cs │ ├── PreviewCtrl.csproj │ ├── PreviewCtrl.png │ ├── PreviewCtrl.resx │ ├── PreviewCtrl.sln │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── README.md │ └── app.manifest ├── RoboReader │ ├── App.config │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── README.md │ ├── RoboReader.csproj │ ├── RoboReader.gif │ ├── RoboReader.sln │ └── app.manifest └── TiffExtractor │ ├── App.config │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── README.md │ ├── TiffExtractor.csproj │ ├── TiffExtractor.png │ ├── TiffExtractor.sln │ └── app.manifest ├── Delphi ├── CreatePagesPreviewCtl │ ├── CreatePagesPreviewCtl.dpr │ ├── CreatePagesPreviewCtl.dproj │ ├── CreatePagesPreviewCtl.res │ ├── Unit2.dfm │ ├── Unit2.pas │ ├── uMain.dfm │ └── uMain.pas ├── SampleCreatePXVInst │ ├── SampleCreatePXVInst.dpr │ ├── SampleCreatePXVInst.dproj │ ├── SampleCreatePXVInst.res │ ├── SampleMain.dfm │ └── SampleMain.pas ├── SamplePDFEdit │ ├── PDFInst.pas │ ├── SamplePDFEdit.dpr │ ├── SamplePDFEdit.dproj │ ├── SamplePDFEdit.res │ ├── about.dfm │ ├── about.pas │ ├── untMain.dfm │ └── untMain.pas └── SamplePDFEditGoto │ ├── Project1.res │ ├── SamplePDFEditGoto.dpr │ ├── SamplePDFEditGoto.dproj │ ├── SamplePDFEditGoto.res │ ├── Unit1.dfm │ └── Unit1.pas ├── Java └── PDFEditSDKSimple │ ├── .classpath │ ├── .project │ ├── META-INF │ └── MANIFEST.MF │ ├── build.properties │ └── src │ └── PDFEditSDKSimple.java ├── PDFEditorSDKExamples.x64 └── README.md ├── PDFEditorSDKExamples.x86 └── README.md ├── Python └── DemoApp │ ├── DemoApp.py │ ├── DemoApp.pyproj │ └── DemoApp.sln ├── README.md ├── WebExamples ├── ASPNETbasic │ ├── Default.aspx │ ├── Default.aspx.cs │ ├── Default.aspx.designer.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Web.config │ ├── WebApplication1.csproj │ └── WebApplication1.sln └── HTML_JavaScript │ └── PDFXChangeViewer.html ├── cpp └── QTFullDemo │ ├── QTFullDemo.pro │ ├── main.cpp │ ├── mainwindow.cpp │ ├── mainwindow.h │ └── mainwindow.ui └── tempbuild └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /CPP/ImportConverter/CPXV_Control.cpp: -------------------------------------------------------------------------------- 1 | // CPXV_Control.cpp : Definition of ActiveX Control wrapper class(es) created by Microsoft Visual C++ 2 | 3 | 4 | #include "stdafx.h" 5 | #include "CPXV_Control.h" 6 | 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // CPXV_Control 9 | 10 | IMPLEMENT_DYNCREATE(CPXV_Control, CWnd) 11 | 12 | // CPXV_Control properties 13 | 14 | // CPXV_Control operations 15 | -------------------------------------------------------------------------------- /CPP/ImportConverter/ImportConverter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/ImportConverter.cpp -------------------------------------------------------------------------------- /CPP/ImportConverter/ImportConverter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/ImportConverter.h -------------------------------------------------------------------------------- /CPP/ImportConverter/ImportConverter.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/ImportConverter.rc -------------------------------------------------------------------------------- /CPP/ImportConverter/ImportConverter.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2037 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImportConverter", "ImportConverter.vcxproj", "{23C3D18E-D95C-460F-8200-28715A4EEE16}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {23C3D18E-D95C-460F-8200-28715A4EEE16}.Debug|x64.ActiveCfg = Debug|x64 17 | {23C3D18E-D95C-460F-8200-28715A4EEE16}.Debug|x64.Build.0 = Debug|x64 18 | {23C3D18E-D95C-460F-8200-28715A4EEE16}.Debug|x86.ActiveCfg = Debug|Win32 19 | {23C3D18E-D95C-460F-8200-28715A4EEE16}.Debug|x86.Build.0 = Debug|Win32 20 | {23C3D18E-D95C-460F-8200-28715A4EEE16}.Release|x64.ActiveCfg = Release|x64 21 | {23C3D18E-D95C-460F-8200-28715A4EEE16}.Release|x64.Build.0 = Release|x64 22 | {23C3D18E-D95C-460F-8200-28715A4EEE16}.Release|x86.ActiveCfg = Release|Win32 23 | {23C3D18E-D95C-460F-8200-28715A4EEE16}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {179CD7B6-A94D-47C1-AE67-DB60C8221948} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /CPP/ImportConverter/ImportConverter.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | Header Files 29 | 30 | 31 | Header Files 32 | 33 | 34 | Header Files 35 | 36 | 37 | Header Files 38 | 39 | 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | 58 | 59 | Resource Files 60 | 61 | 62 | 63 | 64 | Resource Files 65 | 66 | 67 | 68 | 69 | Resource Files 70 | 71 | 72 | Resource Files 73 | 74 | 75 | Resource Files 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /CPP/ImportConverter/ImportConverterDlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/ImportConverterDlg.cpp -------------------------------------------------------------------------------- /CPP/ImportConverter/ImportConverterDlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/ImportConverterDlg.h -------------------------------------------------------------------------------- /CPP/ImportConverter/res/ImportConverter.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/res/ImportConverter.ico -------------------------------------------------------------------------------- /CPP/ImportConverter/res/ImportConverter.rc2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/res/ImportConverter.rc2 -------------------------------------------------------------------------------- /CPP/ImportConverter/res/Toolbar.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/res/Toolbar.bmp -------------------------------------------------------------------------------- /CPP/ImportConverter/res/Toolbar256.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/res/Toolbar256.bmp -------------------------------------------------------------------------------- /CPP/ImportConverter/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/resource.h -------------------------------------------------------------------------------- /CPP/ImportConverter/stdafx.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/stdafx.cpp -------------------------------------------------------------------------------- /CPP/ImportConverter/stdafx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/stdafx.h -------------------------------------------------------------------------------- /CPP/ImportConverter/targetver.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/ImportConverter/targetver.h -------------------------------------------------------------------------------- /CPP/PDFXEditSDK/Macroses.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Exit macros 4 | #define BreakFunction() { break; } 5 | 6 | #define E_CANCELLED HRESULT_FROM_WIN32(ERROR_CANCELLED) 7 | 8 | #define USER_CANCEL E_CANCELLED 9 | 10 | #define IS_ERR_Cancel(x) (USER_CANCEL == x) 11 | #define IS_ERR_S_FALSE(x) (S_FALSE == x) 12 | 13 | #define BreakOnFailure0(x) if (FAILED(x)) { BreakFunction(); } 14 | #define BreakOnFailureOrUserChoise(x) if (FAILED(x) || IS_ERR_Cancel(x)) { BreakFunction(); } 15 | 16 | #define ReturnOnFailure0(x) if (FAILED(x)) { return x; } 17 | #define ReturnOnFailureOrUserChoise(x) if (FAILED(x) || IS_ERR_Cancel(x)) { return x; } 18 | 19 | #define BreakFunction() { break; } 20 | #define DS_ExitTrace DU_TraceError 21 | #define DU_TraceError(f, ...) 22 | #define BreakOnFailure(x, f, ...) if (FAILED(x)) { DS_ExitTrace(x, f, __VA_ARGS__); BreakFunction(); } 23 | 24 | #define __STR2__(x) #x 25 | #define __STR1__(x) __STR2__(x) 26 | #define __LOC__ __FILE__ "("__STR1__(__LINE__)") : " 27 | #define NOTE( x ) message( x ) 28 | #define FILE_LINE message( __LOC__ ) 29 | #define TODO( x ) message( __LOC__"\n" \ 30 | "-------------------------------------------------\n" \ 31 | "| TODO : " #x "\n" \ 32 | "--------------------------------------------------\n" ) 33 | #define FIXME( x ) message( __LOC__"\n" \ 34 | "-------------------------------------------------\n" \ 35 | "| FIXME : " #x "\n" \ 36 | "--------------------------------------------------\n" ) 37 | #define todo( x ) message( __LOC__"ToDo : " #x) 38 | #define fixme( x ) message( __LOC__"FixMe : " #x) 39 | #define note( x ) message( __LOC__"Note : " #x) 40 | -------------------------------------------------------------------------------- /CPP/PDFXEditSDK/PDFEditorSDK.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "Macroses.h" 7 | 8 | #if defined _M_X64 9 | #define Api_File "PDFXEditCore.x64.dll" 10 | #else 11 | #define Api_File "PDFXEditCore.x86.dll" 12 | #endif 13 | 14 | #pragma warning( disable : 4192 ) 15 | #pragma warning( disable : 4278 ) 16 | 17 | #import Api_File rename_namespace("PXV"), raw_interfaces_only, exclude("LONG_PTR", "ULONG_PTR", "UINT_PTR") 18 | 19 | #pragma warning( default : 4278 ) 20 | #pragma warning( default : 4192 ) 21 | 22 | #include "CabHelper.h" 23 | 24 | typedef CComPtr t_pInst; 25 | 26 | //typedef CComPtr t_pCabNode; 27 | 28 | 29 | #if defined _M_X64 30 | 31 | #define SDK_DLL L"PDFXCoreAPI.x64.dll" 32 | 33 | #ifdef _DEBUG 34 | #define SDK_PATH L"%PXCC_BIN64D_PATH%" 35 | #else // _DEBUG 36 | #define SDK_PATH L"%PXCC_BIN64R_PATH%" 37 | #endif // _DEBUG 38 | 39 | #else // _M_X64 40 | 41 | #define SDK_DLL L"PDFXCoreAPI.x86.dll" 42 | 43 | #ifdef _DEBUG 44 | #define SDK_PATH L"%PXCC_BIN32D_PATH%" 45 | #else // _DEBUG 46 | #define SDK_PATH L"%PXCC_BIN32R_PATH%" 47 | #endif // _DEBUG 48 | 49 | #endif 50 | 51 | typedef HRESULT(WINAPI *fnPXC_GetInstance)(PXV::IPXV_Inst** ppInst); 52 | 53 | 54 | -------------------------------------------------------------------------------- /CPP/PDFXEditSDK/PDFXEditSDK.vcxitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | {45d41acc-2c3c-43d2-bc10-02aa73ffc7c7} 7 | 8 | 9 | 10 | %(AdditionalIncludeDirectories);$(MSBuildThisFileDirectory) 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/AboutDlg.cpp: -------------------------------------------------------------------------------- 1 | // aboutdlg.cpp : implementation of the CAboutDlg class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "resource.h" 7 | 8 | #include "aboutdlg.h" 9 | 10 | LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 11 | { 12 | CenterWindow(GetParent()); 13 | return TRUE; 14 | } 15 | 16 | LRESULT CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 17 | { 18 | EndDialog(wID); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/AboutDlg.h: -------------------------------------------------------------------------------- 1 | // aboutdlg.h : interface of the CAboutDlg class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #pragma once 6 | 7 | class CAboutDlg : public CDialogImpl 8 | { 9 | public: 10 | enum { IDD = IDD_ABOUTBOX }; 11 | 12 | BEGIN_MSG_MAP(CAboutDlg) 13 | MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) 14 | COMMAND_ID_HANDLER(IDOK, OnCloseCmd) 15 | COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd) 16 | END_MSG_MAP() 17 | 18 | // Handler prototypes (uncomment arguments if needed): 19 | // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 20 | // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 21 | // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) 22 | 23 | LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 24 | LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 25 | }; 26 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/MainDlg.h: -------------------------------------------------------------------------------- 1 | // MainDlg.h : interface of the CMainDlg class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #pragma once 6 | #include "PrefInst.h" 7 | 8 | class CMainDlg : public CAxDialogImpl, public CUpdateUI, 9 | public CMessageFilter, public CIdleHandler, public CTheme, 10 | public CDialogResize, 11 | public CWinDataExchange, 12 | public IDispEventImpl 13 | 14 | { 15 | public: 16 | enum { IDD = IDD_MAINDLG }; 17 | 18 | virtual BOOL PreTranslateMessage(MSG* pMsg); 19 | virtual BOOL OnIdle(); 20 | 21 | CString AppDirectory(); 22 | public: 23 | CPrefInst m_inst; 24 | PXV::IPXV_ControlPtr m_pControl; 25 | CListViewCtrl m_ListFile; 26 | private: 27 | CString m_sTextItem; 28 | public: 29 | BEGIN_UPDATE_UI_MAP(CMainDlg) 30 | END_UPDATE_UI_MAP() 31 | 32 | BEGIN_MSG_MAP(CMainDlg) 33 | CHAIN_MSG_MAP(CAxDialogImpl) 34 | MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) 35 | MESSAGE_HANDLER(WM_DESTROY, OnDestroy) 36 | 37 | NOTIFY_HANDLER(IDC_LIST_FILE, LVN_GETDISPINFO, OnLvnGetdispinfoListFile) 38 | NOTIFY_HANDLER(IDC_LIST_FILE, LVN_ODCACHEHINT, OnLvnOdcachehintListFile) 39 | 40 | COMMAND_ID_HANDLER(IDCANCEL, OnCancel) 41 | COMMAND_ID_HANDLER(IDC_BTN_ADD, OnAdd) 42 | COMMAND_ID_HANDLER(IDC_BTN_DELETE, OnDelete) 43 | COMMAND_ID_HANDLER(IDC_BTN_EDIT, OnEdit) 44 | COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout) 45 | 46 | CHAIN_MSG_MAP(CDialogResize) 47 | END_MSG_MAP() 48 | 49 | BEGIN_SINK_MAP(CMainDlg) 50 | SINK_ENTRY(IDC_PXV_CONTROL1, 1, OnEventPxvControl1) 51 | END_SINK_MAP() 52 | 53 | BEGIN_DLGRESIZE_MAP(CMainDlg) 54 | DLGRESIZE_CONTROL(IDC_LIST_FILE, DLSZ_SIZE_X | DLSZ_SIZE_Y) 55 | DLGRESIZE_CONTROL(IDC_BTN_ADD, DLSZ_MOVE_X) 56 | DLGRESIZE_CONTROL(IDC_BTN_EDIT, DLSZ_MOVE_X) 57 | DLGRESIZE_CONTROL(IDC_BTN_DELETE, DLSZ_MOVE_X | DLSZ_MOVE_Y) 58 | DLGRESIZE_CONTROL(ID_APP_ABOUT, DLSZ_MOVE_X | DLSZ_MOVE_Y) 59 | END_DLGRESIZE_MAP() 60 | 61 | BEGIN_DDX_MAP(CMainDlg) 62 | DDX_CONTROL_HANDLE(IDC_LIST_FILE, m_ListFile) 63 | END_DDX_MAP() 64 | 65 | // Handler prototypes (uncomment arguments if needed): 66 | // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 67 | // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 68 | // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) 69 | 70 | LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 71 | LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 72 | LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 73 | LRESULT OnCancel(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 74 | LRESULT OnAdd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 75 | LRESULT OnDelete(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 76 | LRESULT OnEdit(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 77 | LRESULT OnLvnGetdispinfoListFile(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/); 78 | LRESULT OnLvnOdcachehintListFile(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/); 79 | 80 | HRESULT __stdcall OnEventPxvControl1(long nEventID, LPDISPATCH pEvent, LPUNKNOWN pFrom); 81 | 82 | void CloseDialog(int nVal); 83 | }; 84 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/PDFXeditPref.cpp: -------------------------------------------------------------------------------- 1 | // PDFXeditPref.cpp : main source file for PDFXeditPref.exe 2 | // 3 | 4 | #include "stdafx.h" 5 | 6 | #include "resource.h" 7 | 8 | #include "aboutdlg.h" 9 | #include "MainDlg.h" 10 | 11 | CAppModule _Module; 12 | 13 | int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT) 14 | { 15 | CMessageLoop theLoop; 16 | _Module.AddMessageLoop(&theLoop); 17 | 18 | CMainDlg dlgMain; 19 | 20 | if(dlgMain.Create(NULL) == NULL) 21 | { 22 | ATLTRACE(_T("Main dialog creation failed!\n")); 23 | return 0; 24 | } 25 | 26 | dlgMain.ShowWindow(nCmdShow); 27 | 28 | int nRet = theLoop.Run(); 29 | 30 | _Module.RemoveMessageLoop(); 31 | return nRet; 32 | } 33 | 34 | int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow) 35 | { 36 | #ifdef _DEBUG 37 | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF /*| _CRTDBG_CHECK_ALWAYS_DF*/ | _CRTDBG_LEAK_CHECK_DF /*| _CRTDBG_DELAY_FREE_MEM_DF*/); 38 | #endif 39 | 40 | HRESULT hRes = ::CoInitialize(NULL); 41 | // If you are running on NT 4.0 or higher you can use the following call instead to 42 | // make the EXE free threaded. This means that calls come in on a random RPC thread. 43 | // HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED); 44 | ATLASSERT(SUCCEEDED(hRes)); 45 | 46 | // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used 47 | ::DefWindowProc(NULL, 0, 0, 0L); 48 | 49 | AtlInitCommonControls(ICC_BAR_CLASSES); // add flags to support other controls 50 | 51 | hRes = _Module.Init(NULL, hInstance); 52 | ATLASSERT(SUCCEEDED(hRes)); 53 | 54 | AtlAxWinInit(); 55 | 56 | int nRet = Run(lpstrCmdLine, nCmdShow); 57 | 58 | _Module.Term(); 59 | ::CoUninitialize(); 60 | 61 | return nRet; 62 | } 63 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/PDFXeditPref.h: -------------------------------------------------------------------------------- 1 | // PDFXeditPref.h 2 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/PDFXeditPref.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32516.85 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PDFXeditPref", "PDFXeditPref.vcxproj", "{2D2710C2-7246-48BF-BAB8-5E3978BC1723}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PDFXEditSDK", "..\PDFXEditSDK\PDFXEditSDK.vcxitems", "{45D41ACC-2C3C-43D2-BC10-02AA73FFC7C7}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|x64 = Debug|x64 13 | Debug|x86 = Debug|x86 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {2D2710C2-7246-48BF-BAB8-5E3978BC1723}.Debug|x64.ActiveCfg = Debug|x64 19 | {2D2710C2-7246-48BF-BAB8-5E3978BC1723}.Debug|x64.Build.0 = Debug|x64 20 | {2D2710C2-7246-48BF-BAB8-5E3978BC1723}.Debug|x86.ActiveCfg = Debug|Win32 21 | {2D2710C2-7246-48BF-BAB8-5E3978BC1723}.Debug|x86.Build.0 = Debug|Win32 22 | {2D2710C2-7246-48BF-BAB8-5E3978BC1723}.Release|x64.ActiveCfg = Release|x64 23 | {2D2710C2-7246-48BF-BAB8-5E3978BC1723}.Release|x64.Build.0 = Release|x64 24 | {2D2710C2-7246-48BF-BAB8-5E3978BC1723}.Release|x86.ActiveCfg = Release|Win32 25 | {2D2710C2-7246-48BF-BAB8-5E3978BC1723}.Release|x86.Build.0 = Release|Win32 26 | EndGlobalSection 27 | GlobalSection(SolutionProperties) = preSolution 28 | HideSolutionNode = FALSE 29 | EndGlobalSection 30 | GlobalSection(ExtensibilityGlobals) = postSolution 31 | SolutionGuid = {DAC2BE15-B1DE-411B-89D8-3D1878FDDA48} 32 | EndGlobalSection 33 | GlobalSection(SharedMSBuildProjectFiles) = preSolution 34 | ..\PDFXEditSDK\PDFXEditSDK.vcxitems*{2d2710c2-7246-48bf-bab8-5e3978bc1723}*SharedItemsImports = 4 35 | ..\PDFXEditSDK\PDFXEditSDK.vcxitems*{45d41acc-2c3c-43d2-bc10-02aa73ffc7c7}*SharedItemsImports = 9 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/PDFXeditPref.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {b54bc0a0-4d72-4270-a57f-bc7ee22cf8bb} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {bf91f1e2-e344-4314-b454-27704c62ed41} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {8a1693fe-84d3-4004-995f-336e6c1c90fc} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | 52 | 53 | Resource Files 54 | 55 | 56 | 57 | 58 | Resource Files 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/PrefInst.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | class CPrefInst 3 | { 4 | public: 5 | CPrefInst(); 6 | ~CPrefInst(); 7 | 8 | t_pInst m_Inst; 9 | PXV::IAFS_InstPtr m_AFSInst; 10 | PXV::IAUX_InstPtr m_AUXInst; 11 | _cab_node_t m_appParams; 12 | 13 | long nid_e_app_prefsChanged = 0; 14 | long nid_e_operBeforeExecute = 0; 15 | long nid_op_appPrefsChanged = 0; 16 | 17 | CString GetText(int iItem, int iSubItem); 18 | int GetItemCount(); 19 | private: 20 | HMODULE hSDKInst = nullptr; 21 | 22 | PXV::ICabPtr m_pCab; 23 | IStreamPtr m_pStream; 24 | 25 | CString m_strFile; 26 | bool m_bAppPrefsChanged = false; 27 | public: 28 | 29 | void appSettLoad(CString& strPath); 30 | 31 | void SettSave(LPCWSTR strFile = nullptr); 32 | void SettLoad(LPCWSTR strFile); 33 | void SettOpen(); 34 | 35 | bool AddFileList(LPCWSTR sFilePath); 36 | bool DelFileList(LPCWSTR sFilePath); 37 | bool DeleteItem(int nIndex); 38 | 39 | HRESULT OnEventPxvControl(long nEventID, LPDISPATCH pEvent, LPUNKNOWN pFrom); 40 | }; 41 | 42 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/res/PDFXeditPref.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/PDFXeditPref/res/PDFXeditPref.ico -------------------------------------------------------------------------------- /CPP/PDFXeditPref/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by PDFXeditPref.rc 4 | // 5 | #define IDD_ABOUTBOX 100 6 | #define IDR_MAINFRAME 128 7 | #define IDD_MAINDLG 129 8 | #define IDC_PXV_CONTROL1 1000 9 | #define IDC_LIST1 1004 10 | #define IDC_LIST_FILE 1004 11 | #define IDC_BUTTON1 1005 12 | #define IDC_BTN_ADD 1005 13 | #define IDC_BUTTON2 1006 14 | #define IDC_BTN_DELETE 1006 15 | #define IDC_BUTTON3 1007 16 | #define IDC_BTN_EDIT 1007 17 | #define IDC_PXV_CONTROL2 1008 18 | 19 | // Next default values for new objects 20 | // 21 | #ifdef APSTUDIO_INVOKED 22 | #ifndef APSTUDIO_READONLY_SYMBOLS 23 | #define _APS_NEXT_RESOURCE_VALUE 204 24 | #define _APS_NEXT_COMMAND_VALUE 32775 25 | #define _APS_NEXT_CONTROL_VALUE 1009 26 | #define _APS_NEXT_SYMED_VALUE 101 27 | #endif 28 | #endif 29 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // PDFXeditPref.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | #if (_ATL_VER < 0x0700) 8 | #include 9 | #endif //(_ATL_VER < 0x0700) 10 | -------------------------------------------------------------------------------- /CPP/PDFXeditPref/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | // Change these values to use different versions 9 | #define WINVER 0x0600 10 | #define _WIN32_WINNT 0x0601 11 | #define _WIN32_IE 0x0601 12 | #define _RICHEDIT_VER 0x0600 13 | 14 | #define _SECURE_ATL 1 15 | #define _WTL_NO_CSTRING 16 | #define _WTL_NO_WTYPES 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | extern CAppModule _Module; 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #include "PDFEditorSDK.h" 37 | 38 | #ifdef _DEBUG 39 | #define _CRTDBG_MAP_ALLOC 40 | #include 41 | #include 42 | #define new new(_NORMAL_BLOCK, __FILE__, __LINE__) 43 | #endif 44 | 45 | 46 | #if defined _M_IX86 47 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 48 | #elif defined _M_IA64 49 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") 50 | #elif defined _M_X64 51 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 52 | #else 53 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 54 | #endif 55 | -------------------------------------------------------------------------------- /CPP/WTLSample/AboutDlg.cpp: -------------------------------------------------------------------------------- 1 | // aboutdlg.cpp : implementation of the CAboutDlg class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "resource.h" 7 | 8 | #include "aboutdlg.h" 9 | 10 | LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 11 | { 12 | CenterWindow(GetParent()); 13 | return TRUE; 14 | } 15 | 16 | LRESULT CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 17 | { 18 | EndDialog(wID); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /CPP/WTLSample/AboutDlg.h: -------------------------------------------------------------------------------- 1 | // aboutdlg.h : interface of the CAboutDlg class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #pragma once 6 | 7 | class CAboutDlg : public CDialogImpl 8 | { 9 | public: 10 | enum { IDD = IDD_ABOUTBOX }; 11 | 12 | BEGIN_MSG_MAP(CAboutDlg) 13 | MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) 14 | COMMAND_ID_HANDLER(IDOK, OnCloseCmd) 15 | COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd) 16 | END_MSG_MAP() 17 | 18 | // Handler prototypes (uncomment arguments if needed): 19 | // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 20 | // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 21 | // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) 22 | 23 | LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 24 | LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 25 | }; 26 | -------------------------------------------------------------------------------- /CPP/WTLSample/CCustomEventTarget.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | #include "CCustomEventTarget.h" 3 | 4 | 5 | CCustomEventTarget::CCustomEventTarget(PXV::IUIX_Obj* obj) 6 | { 7 | SetObj(obj); 8 | } 9 | 10 | 11 | CCustomEventTarget::CCustomEventTarget() 12 | { 13 | 14 | } 15 | 16 | CCustomEventTarget::~CCustomEventTarget() 17 | { 18 | Dispose(); 19 | } 20 | 21 | void CCustomEventTarget::SetObj(PXV::IUIX_Obj* obj) 22 | { 23 | m_Obj = obj; 24 | if (m_Obj != nullptr) 25 | m_Obj->PushImpl(this, VARIANT_FALSE); 26 | } 27 | 28 | HRESULT __stdcall CCustomEventTarget::get_Obj(struct PXV::IUIX_Obj * * pObj) 29 | { 30 | return 0; 31 | } 32 | 33 | HRESULT __stdcall CCustomEventTarget::OnPreEvent(struct PXV::IUIX_Obj * pSender, struct PXV::IUIX_Event * pEvent) 34 | { 35 | return 0; 36 | } 37 | 38 | HRESULT __stdcall CCustomEventTarget::OnEvent(struct PXV::IUIX_Obj * pSender, struct PXV::IUIX_Event * pEvent) 39 | { 40 | //If the event is not handled then it will be 41 | pEvent->put_Handled(VARIANT_FALSE); 42 | long nCode = 0; 43 | pEvent->get_Code(&nCode); 44 | if (nCode == (int)PXV::e_Notify) 45 | { 46 | PXV::PARAM_T nParam = 0; 47 | pEvent->get_Param1(&nParam); 48 | PXV::UIX_NotifyInfo* ni = (PXV::UIX_NotifyInfo*)nParam; 49 | if (ni->nCode == (int)PXV::UIX_Notify_Layout_AddNewTabs) 50 | { 51 | pEvent->put_Handled(VARIANT_TRUE); 52 | } 53 | } 54 | return 0; 55 | } 56 | 57 | HRESULT __stdcall CCustomEventTarget::OnPostEvent(struct PXV::IUIX_Obj * pSender, struct PXV::IUIX_Event * pEvent) 58 | { 59 | return 0; 60 | } 61 | 62 | void CCustomEventTarget::Dispose() 63 | { 64 | if (m_Disposed) 65 | return; 66 | m_Disposed = true; 67 | if (m_Obj != nullptr) 68 | { 69 | m_Obj->PopImpl(this); 70 | m_Obj = nullptr; 71 | } 72 | } 73 | 74 | 75 | -------------------------------------------------------------------------------- /CPP/WTLSample/CCustomEventTarget.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class ATL_NO_VTABLE CCustomEventTarget: 4 | public CComObjectRootEx, 5 | public CComCoClass, 6 | public IDispatchImpl 7 | { 8 | public: 9 | CCustomEventTarget(); 10 | CCustomEventTarget(PXV::IUIX_Obj* obj); 11 | virtual ~CCustomEventTarget(); 12 | 13 | DECLARE_NOT_AGGREGATABLE(CCustomEventTarget) 14 | 15 | BEGIN_COM_MAP(CCustomEventTarget) 16 | COM_INTERFACE_ENTRY(PXV::IUIX_ObjImpl) 17 | COM_INTERFACE_ENTRY(IDispatch) 18 | END_COM_MAP() 19 | 20 | DECLARE_PROTECT_FINAL_CONSTRUCT() 21 | 22 | CComPtr m_Obj; 23 | bool m_Disposed = false; 24 | 25 | void SetObj(PXV::IUIX_Obj* obj); 26 | 27 | virtual HRESULT __stdcall get_Obj(struct PXV::IUIX_Obj * * pObj); 28 | virtual HRESULT __stdcall OnPreEvent(struct PXV::IUIX_Obj * pSender, struct PXV::IUIX_Event * pEvent); 29 | virtual HRESULT __stdcall OnEvent(struct PXV::IUIX_Obj * pSender, struct PXV::IUIX_Event * pEvent); 30 | virtual HRESULT __stdcall OnPostEvent(struct PXV::IUIX_Obj * pSender, struct PXV::IUIX_Event * pEvent); 31 | 32 | void Dispose(); 33 | }; 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /CPP/WTLSample/MainFrm.h: -------------------------------------------------------------------------------- 1 | // MainFrm.h : interface of the CMainFrame class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #pragma once 6 | #include "CCustomEventTarget.h" 7 | 8 | class CMainFrame : 9 | public CRibbonFrameWindowImpl, 10 | public CMessageFilter, public CIdleHandler 11 | { 12 | public: 13 | DECLARE_FRAME_WND_CLASS(NULL, IDR_MAINFRAME) 14 | 15 | CWTLSampleView m_view; 16 | CCommandBarCtrl m_CmdBar; 17 | 18 | //TODO: Declare ribbon controls 19 | CComPtr g_Inst = nullptr; 20 | CComPtr m_EventTarget = nullptr; 21 | 22 | 23 | // Ribbon control map 24 | BEGIN_RIBBON_CONTROL_MAP(CMainFrame) 25 | END_RIBBON_CONTROL_MAP() 26 | 27 | virtual BOOL PreTranslateMessage(MSG* pMsg); 28 | virtual BOOL OnIdle(); 29 | //virtual void UpdateLayout(BOOL bResizeBars = TRUE); 30 | 31 | BEGIN_UPDATE_UI_MAP(CMainFrame) 32 | UPDATE_ELEMENT(ID_VIEW_TOOLBAR, UPDUI_MENUPOPUP) 33 | UPDATE_ELEMENT(ID_VIEW_STATUS_BAR, UPDUI_MENUPOPUP) 34 | END_UPDATE_UI_MAP() 35 | 36 | BEGIN_MSG_MAP(CMainFrame) 37 | MESSAGE_HANDLER(WM_CREATE, OnCreate) 38 | MESSAGE_HANDLER(WM_CLOSE, OnClose) 39 | MESSAGE_HANDLER(WM_DESTROY, OnDestroy) 40 | COMMAND_ID_HANDLER(ID_APP_EXIT, OnFileExit) 41 | COMMAND_ID_HANDLER(ID_FILE_NEW, OnFileNew) 42 | COMMAND_ID_HANDLER(ID_FILE_OPEN, OnFileOpen) 43 | COMMAND_ID_HANDLER(ID_VIEW_TOOLBAR, OnViewToolBar) 44 | COMMAND_ID_HANDLER(ID_VIEW_STATUS_BAR, OnViewStatusBar) 45 | COMMAND_ID_HANDLER(ID_VIEW_RIBBON, OnViewRibbon) 46 | COMMAND_ID_HANDLER(ID_APP_ABOUT, OnAppAbout) 47 | COMMAND_ID_HANDLER(ID_COMMAND_DISABLEBUTTON, OnCommandTisableclose) 48 | CHAIN_MSG_MAP(CRibbonFrameWindowImpl) 49 | END_MSG_MAP() 50 | 51 | // Handler prototypes (uncomment arguments if needed): 52 | // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 53 | // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 54 | // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) 55 | 56 | LRESULT OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 57 | LRESULT OnClose(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/); 58 | LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& bHandled); 59 | LRESULT OnFileExit(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 60 | LRESULT OnFileNew(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 61 | LRESULT OnFileOpen(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 62 | LRESULT OnViewToolBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 63 | LRESULT OnViewStatusBar(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 64 | LRESULT OnViewRibbon(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 65 | LRESULT OnAppAbout(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 66 | LRESULT OnCommandTisableclose(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/); 67 | }; 68 | -------------------------------------------------------------------------------- /CPP/WTLSample/Ribbon.h: -------------------------------------------------------------------------------- 1 | // ***************************************************************************** 2 | // * This is an automatically generated header file for UI Element definition * 3 | // * resource symbols and values. Please do not modify manually. * 4 | // ***************************************************************************** 5 | 6 | #pragma once 7 | 8 | #define ID_FILE_NEW 0xE100 9 | #define ID_FILE_OPEN 0xE101 10 | #define ID_FILE_CLOSE 0xE102 11 | #define ID_FILE_SAVE 0xE103 12 | #define ID_FILE_SAVE_AS 0xE104 13 | #define ID_FILE_PAGE_SETUP 0xE105 14 | #define ID_FILE_PRINT_SETUP 0xE106 15 | #define ID_FILE_PRINT 0xE107 16 | #define ID_FILE_PRINT_DIRECT 0xE108 17 | #define ID_FILE_PRINT_PREVIEW 0xE109 18 | #define ID_EDIT_COPY 0xE122 19 | #define ID_EDIT_CUT 0xE123 20 | #define ID_EDIT_FIND 0xE124 21 | #define ID_EDIT_PASTE 0xE125 22 | #define ID_EDIT_SELECT_ALL 0xE12A 23 | #define ID_EDIT_UNDO 0xE12B 24 | #define ID_EDIT_REDO 0xE12C 25 | #define ID_WINDOW_NEW 0xE130 26 | #define ID_WINDOW_SPLIT 0xE135 27 | #define ID_APP_ABOUT 0xE140 28 | #define ID_APP_EXIT 0xE141 29 | #define ID_NEXT_PANE 0xE150 30 | #define ID_PREV_PANE 0xE151 31 | #define ID_PANE_CLOSE 0xE152 32 | #define ID_VIEW_TOOLBAR 0xE800 33 | #define ID_VIEW_STATUS_BAR 0xE801 34 | #define ID_VIEW_RIBBON 0xE804 35 | #define ID_TAB_HOME 2 36 | #define ID_TAB_HOME_LabelTitle_RESID 60001 37 | #define ID_GROUP_CLIPBOARD 3 38 | #define ID_GROUP_CLIPBOARD_LabelTitle_RESID 60002 39 | #define ID_GROUP_VIEW 4 40 | #define ID_GROUP_VIEW_LabelTitle_RESID 60003 41 | #define ID_RIBBON_APP_MENU 5 42 | #define ID_SAVEMORE 6 43 | #define ID_PRINTMORE 7 44 | #define ID_RIBBON_QAT 8 45 | -------------------------------------------------------------------------------- /CPP/WTLSample/Ribbon.rc: -------------------------------------------------------------------------------- 1 | // ****************************************************************************** 2 | // * This is an automatically generated file containing the ribbon resource for * 3 | // * your application. * 4 | // ****************************************************************************** 5 | 6 | #include ".\Ribbon.h" 7 | 8 | STRINGTABLE 9 | BEGIN 10 | ID_TAB_HOME_LabelTitle_RESID L"Home" /* LabelTitle ID_TAB_HOME_LabelTitle_RESID: (null) */ 11 | END 12 | 13 | STRINGTABLE 14 | BEGIN 15 | ID_GROUP_CLIPBOARD_LabelTitle_RESID L"Clipboard" /* LabelTitle ID_GROUP_CLIPBOARD_LabelTitle_RESID: (null) */ 16 | END 17 | 18 | STRINGTABLE 19 | BEGIN 20 | ID_GROUP_VIEW_LabelTitle_RESID L"View" /* LabelTitle ID_GROUP_VIEW_LabelTitle_RESID: (null) */ 21 | END 22 | 23 | APPLICATION_RIBBON UIFILE "Ribbon.bml" 24 | -------------------------------------------------------------------------------- /CPP/WTLSample/WTLSample.cpp: -------------------------------------------------------------------------------- 1 | // WTLSample.cpp : main source file for WTLSample.exe 2 | // 3 | 4 | #include "stdafx.h" 5 | #include 6 | 7 | #include "Ribbon.h" 8 | 9 | #include "resource.h" 10 | 11 | #include "WTLSampleView.h" 12 | #include "aboutdlg.h" 13 | #include "MainFrm.h" 14 | 15 | CAppModule _Module; 16 | 17 | int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT) 18 | { 19 | CMessageLoop theLoop; 20 | _Module.AddMessageLoop(&theLoop); 21 | 22 | CMainFrame wndMain; 23 | 24 | if(wndMain.CreateEx() == NULL) 25 | { 26 | ATLTRACE(_T("Main window creation failed!\n")); 27 | return 0; 28 | } 29 | 30 | wndMain.ShowWindow(nCmdShow); 31 | 32 | int nRet = theLoop.Run(); 33 | 34 | _Module.RemoveMessageLoop(); 35 | return nRet; 36 | } 37 | 38 | int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow) 39 | { 40 | #ifdef _DEBUG 41 | _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF /*| _CRTDBG_CHECK_ALWAYS_DF*/ | _CRTDBG_LEAK_CHECK_DF /*| _CRTDBG_DELAY_FREE_MEM_DF*/); 42 | #endif 43 | 44 | HRESULT hRes = ::CoInitialize(NULL); 45 | // If you are running on NT 4.0 or higher you can use the following call instead to 46 | // make the EXE free threaded. This means that calls come in on a random RPC thread. 47 | // HRESULT hRes = ::CoInitializeEx(NULL, COINIT_MULTITHREADED); 48 | ATLASSERT(SUCCEEDED(hRes)); 49 | 50 | // this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used 51 | ::DefWindowProc(NULL, 0, 0, 0L); 52 | 53 | AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES); // add flags to support other controls 54 | 55 | hRes = _Module.Init(NULL, hInstance); 56 | ATLASSERT(SUCCEEDED(hRes)); 57 | 58 | AtlAxWinInit(); 59 | 60 | int nRet = Run(lpstrCmdLine, nCmdShow); 61 | 62 | _Module.Term(); 63 | ::CoUninitialize(); 64 | 65 | return nRet; 66 | } 67 | -------------------------------------------------------------------------------- /CPP/WTLSample/WTLSample.h: -------------------------------------------------------------------------------- 1 | // WTLSample.h 2 | -------------------------------------------------------------------------------- /CPP/WTLSample/WTLSample.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32516.85 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WTLSample", "WTLSample.vcxproj", "{2B4D8B2F-7B99-46D7-9DA0-D491A6E9C3C4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2B4D8B2F-7B99-46D7-9DA0-D491A6E9C3C4}.Debug|x64.ActiveCfg = Debug|x64 17 | {2B4D8B2F-7B99-46D7-9DA0-D491A6E9C3C4}.Debug|x64.Build.0 = Debug|x64 18 | {2B4D8B2F-7B99-46D7-9DA0-D491A6E9C3C4}.Debug|x86.ActiveCfg = Debug|Win32 19 | {2B4D8B2F-7B99-46D7-9DA0-D491A6E9C3C4}.Debug|x86.Build.0 = Debug|Win32 20 | {2B4D8B2F-7B99-46D7-9DA0-D491A6E9C3C4}.Release|x64.ActiveCfg = Release|x64 21 | {2B4D8B2F-7B99-46D7-9DA0-D491A6E9C3C4}.Release|x64.Build.0 = Release|x64 22 | {2B4D8B2F-7B99-46D7-9DA0-D491A6E9C3C4}.Release|x86.ActiveCfg = Release|Win32 23 | {2B4D8B2F-7B99-46D7-9DA0-D491A6E9C3C4}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {C79D7BD8-F8CD-48DF-AFC2-339E3B311CF1} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /CPP/WTLSample/WTLSample.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {f7ff6ea2-b303-4a3a-a810-4828a2d9ed78} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {0377f0bf-7976-4422-b12b-de1c8a750009} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | {41c8dc99-2ea8-4d65-898c-3e7d224929eb} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;jpg;jpeg;jpe;manifest 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | Source Files 35 | 36 | 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | 61 | 62 | Resource Files 63 | 64 | 65 | 66 | 67 | Resource Files 68 | 69 | 70 | Resource Files 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /CPP/WTLSample/WTLSampleView.cpp: -------------------------------------------------------------------------------- 1 | // WTLSampleView.cpp : implementation of the CWTLSampleView class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #include "stdafx.h" 6 | #include "Ribbon.h" 7 | #include "resource.h" 8 | 9 | #include "WTLSampleView.h" 10 | 11 | BOOL CWTLSampleView::PreTranslateMessage(MSG* pMsg) 12 | { 13 | if((pMsg->message < WM_KEYFIRST || pMsg->message > WM_KEYLAST) && 14 | (pMsg->message < WM_MOUSEFIRST || pMsg->message > WM_MOUSELAST)) 15 | return FALSE; 16 | 17 | HWND hWndCtl = ::GetFocus(); 18 | if(IsChild(hWndCtl)) 19 | { 20 | // find a direct child of the dialog from the window that has focus 21 | while(::GetParent(hWndCtl) != m_hWnd) 22 | hWndCtl = ::GetParent(hWndCtl); 23 | 24 | // give control a chance to translate this message 25 | if(::SendMessage(hWndCtl, WM_FORWARDMSG, 0, (LPARAM)pMsg) != 0) 26 | return TRUE; 27 | } 28 | 29 | return CWindow::IsDialogMessage(pMsg); 30 | } 31 | 32 | LRESULT CWTLSampleView::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) 33 | { 34 | DlgResize_Init(FALSE); 35 | 36 | //m_ctr. 37 | GetDlgControl(IDC_PXV_CONTROL1, __uuidof(PXV::IPXV_Control), (void**)&m_ctr); 38 | 39 | HRESULT hr = S_OK; 40 | do 41 | { 42 | CComPtr pInst; 43 | hr = m_ctr->get_Inst(&pInst); 44 | if (FAILED(hr)) 45 | break; 46 | 47 | CComPtr pSettings; 48 | hr = pInst->get_Settings(&pSettings); 49 | if (FAILED(hr)) 50 | break; 51 | 52 | hr = pSettings->SetBool(LPWSTR(_T("Docs.SingleWnd")), VARIANT_FALSE); 53 | if (FAILED(hr)) 54 | break; 55 | 56 | hr = pSettings->SetBool(LPWSTR(_T("Docs.HideSingleTab")), VARIANT_FALSE); 57 | if (FAILED(hr)) 58 | break; 59 | 60 | hr = pInst->FireAppPrefsChanged(PXV::PXV_AppPrefsChange_Documents, nullptr); 61 | if (FAILED(hr)) 62 | break; 63 | 64 | hr = m_ctr->put_VisibleCmdPanes(PXV::PXV_VisibleCmdPanes_PagesView); //PXV_VisibleCmdPanes_MainView 65 | if (FAILED(hr)) 66 | break; 67 | } while (false); 68 | return TRUE; 69 | } 70 | -------------------------------------------------------------------------------- /CPP/WTLSample/WTLSampleView.h: -------------------------------------------------------------------------------- 1 | // WTLSampleView.h : interface of the CWTLSampleView class 2 | // 3 | ///////////////////////////////////////////////////////////////////////////// 4 | 5 | #pragma once 6 | 7 | class CWTLSampleView : public CAxDialogImpl, public CDialogResize 8 | { 9 | public: 10 | enum { IDD = IDD_WTLSAMPLE_FORM }; 11 | 12 | BOOL PreTranslateMessage(MSG* pMsg); 13 | 14 | PXV::IPXV_ControlPtr m_ctr; 15 | 16 | BEGIN_DLGRESIZE_MAP(CWTLSampleView) 17 | DLGRESIZE_CONTROL(IDC_PXV_CONTROL1, DLSZ_SIZE_X | DLSZ_SIZE_Y) 18 | END_DLGRESIZE_MAP() 19 | 20 | BEGIN_MSG_MAP(CWTLSampleView) 21 | MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) 22 | CHAIN_MSG_MAP(CDialogResize) 23 | END_MSG_MAP() 24 | 25 | 26 | LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); 27 | 28 | // Handler prototypes (uncomment arguments if needed): 29 | // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) 30 | // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) 31 | // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) 32 | }; 33 | -------------------------------------------------------------------------------- /CPP/WTLSample/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /CPP/WTLSample/res/WTLSample.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/WTLSample/res/WTLSample.ico -------------------------------------------------------------------------------- /CPP/WTLSample/res/toolbar.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CPP/WTLSample/res/toolbar.bmp -------------------------------------------------------------------------------- /CPP/WTLSample/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by WTLSample.rc 4 | // 5 | #define IDD_ABOUTBOX 100 6 | #define IDR_MAINFRAME 128 7 | #define IDD_WTLSAMPLE_FORM 129 8 | #define IDC_PXV_CONTROL1 1000 9 | #define IDC_PXV_CONTROL2 1001 10 | #define ID_COMMAND_DISABLEBUTTON 32775 11 | 12 | // Next default values for new objects 13 | // 14 | #ifdef APSTUDIO_INVOKED 15 | #ifndef APSTUDIO_READONLY_SYMBOLS 16 | #define _APS_NEXT_RESOURCE_VALUE 203 17 | #define _APS_NEXT_COMMAND_VALUE 32776 18 | #define _APS_NEXT_CONTROL_VALUE 1002 19 | #define _APS_NEXT_SYMED_VALUE 101 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /CPP/WTLSample/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // WTLSample.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | #if (_ATL_VER < 0x0700) 8 | #include 9 | #endif //(_ATL_VER < 0x0700) 10 | -------------------------------------------------------------------------------- /CPP/WTLSample/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | // Change these values to use different versions 9 | #define WINVER 0x0601 10 | #define _WIN32_WINNT 0x0601 11 | #define _WIN32_IE 0x0700 12 | #define _RICHEDIT_VER 0x0500 13 | 14 | #define _SECURE_ATL 1 15 | #define _WTL_NO_CSTRING 16 | #define _WTL_NO_WTYPES 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | extern CAppModule _Module; 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | #ifdef _DEBUG 36 | #define _CRTDBG_MAP_ALLOC 37 | #include 38 | #include 39 | #define new new(_NORMAL_BLOCK, __FILE__, __LINE__) 40 | #endif 41 | 42 | #if defined _M_X64 43 | #define Api_File "PDFXEditCore.x64.dll" 44 | #else 45 | #define Api_File "PDFXEditCore.x86.dll" 46 | #endif 47 | 48 | #pragma warning(push) 49 | #pragma warning(disable:4192 4278) 50 | #import Api_File rename_namespace("PXV"), raw_interfaces_only, exclude("LONG_PTR", "ULONG_PTR", "UINT_PTR") 51 | #pragma warning(pop) 52 | 53 | #if defined _M_IX86 54 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") 55 | #elif defined _M_IA64 56 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='ia64' publicKeyToken='6595b64144ccf1df' language='*'\"") 57 | #elif defined _M_X64 58 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") 59 | #else 60 | #pragma comment(linker, "/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 61 | #endif 62 | -------------------------------------------------------------------------------- /CSharp/CustomPane/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSharp/CustomPane/CustomPane.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CSharp/CustomPane/CustomPane.png -------------------------------------------------------------------------------- /CSharp/CustomPane/CustomPane.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2043 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomPane", "CustomPane.csproj", "{DF6963C7-590D-43E5-AEE7-84E039CADE2D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Debug|x64.ActiveCfg = Debug|x64 21 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Debug|x64.Build.0 = Debug|x64 22 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Debug|x86.ActiveCfg = Debug|x86 23 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Debug|x86.Build.0 = Debug|x86 24 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Release|x64.ActiveCfg = Release|x64 27 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Release|x64.Build.0 = Release|x64 28 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Release|x86.ActiveCfg = Release|x86 29 | {DF6963C7-590D-43E5-AEE7-84E039CADE2D}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {17A93340-0583-4645-BC80-994D6D75478C} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CSharp/CustomPane/Form1.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace CustomPane 2 | { 3 | partial class Form1 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Windows Form Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.components = new System.ComponentModel.Container(); 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); 33 | this.pdfCtl = new AxPDFXEdit.AxPXV_Control(); 34 | this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components); 35 | ((System.ComponentModel.ISupportInitialize)(this.pdfCtl)).BeginInit(); 36 | this.SuspendLayout(); 37 | // 38 | // pdfCtl 39 | // 40 | this.pdfCtl.Dock = System.Windows.Forms.DockStyle.Fill; 41 | this.pdfCtl.Enabled = true; 42 | this.pdfCtl.Location = new System.Drawing.Point(0, 0); 43 | this.pdfCtl.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 44 | this.pdfCtl.Name = "pdfCtl"; 45 | this.pdfCtl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("pdfCtl.OcxState"))); 46 | this.pdfCtl.Size = new System.Drawing.Size(741, 553); 47 | this.pdfCtl.TabIndex = 0; 48 | this.pdfCtl.OnEvent += new AxPDFXEdit._IPXV_ControlEvents_OnEventEventHandler(this.pdfCtl_OnEvent); 49 | // 50 | // contextMenuStrip1 51 | // 52 | this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); 53 | this.contextMenuStrip1.Name = "contextMenuStrip1"; 54 | this.contextMenuStrip1.Size = new System.Drawing.Size(61, 4); 55 | // 56 | // Form1 57 | // 58 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 59 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 60 | this.ClientSize = new System.Drawing.Size(741, 553); 61 | this.Controls.Add(this.pdfCtl); 62 | this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); 63 | this.Name = "Form1"; 64 | this.Text = "Form1"; 65 | this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Form1_FormClosed); 66 | this.Load += new System.EventHandler(this.Form1_Load); 67 | ((System.ComponentModel.ISupportInitialize)(this.pdfCtl)).EndInit(); 68 | this.ResumeLayout(false); 69 | 70 | } 71 | 72 | #endregion 73 | 74 | private AxPDFXEdit.AxPXV_Control pdfCtl; 75 | private System.Windows.Forms.ContextMenuStrip contextMenuStrip1; 76 | } 77 | } 78 | 79 | -------------------------------------------------------------------------------- /CSharp/CustomPane/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace CustomPane 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CSharp/CustomPane/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("CustomPane")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CustomPane")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("df6963c7-590d-43e5-aee7-84e039cade2d")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSharp/CustomPane/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CustomPane.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CustomPane.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /CSharp/CustomPane/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CustomPane.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CSharp/CustomPane/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CSharp/CustomPane/README.md: -------------------------------------------------------------------------------- 1 | ## Simple example-project that creating a view creator so that the control will know how to initialize our Custom pane 2 | 3 | ![Preview RoboReader](CustomPane.png?raw=true) 4 | -------------------------------------------------------------------------------- /CSharp/CustomPane/UserControl1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace CustomPane 12 | { 13 | public partial class UserControl1 : UserControl 14 | { 15 | public UserControl1() 16 | { 17 | InitializeComponent(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CSharp/CustomPane/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 53 | 54 | true 55 | 56 | 57 | 58 | 59 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /CSharp/CustomTool/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CSharp/CustomTool/CustomTool.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.31919.166 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomTool", "CustomTool.csproj", "{8FF07E2D-5F4C-41A1-9881-96D44265B970}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Debug|x64.ActiveCfg = Debug|x64 21 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Debug|x64.Build.0 = Debug|x64 22 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Debug|x86.ActiveCfg = Debug|x86 23 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Debug|x86.Build.0 = Debug|x86 24 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Release|x64.ActiveCfg = Release|x64 27 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Release|x64.Build.0 = Release|x64 28 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Release|x86.ActiveCfg = Release|x86 29 | {8FF07E2D-5F4C-41A1-9881-96D44265B970}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {545D43EE-859A-477A-B0E5-677E5297F35D} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CSharp/CustomTool/Extensions/PagesViewEx.cs: -------------------------------------------------------------------------------- 1 | using PDFXEdit; 2 | 3 | namespace CustomTool.Extensions 4 | { 5 | public static class PagesViewEx 6 | { 7 | public static int CalcCtlPtSize(this IPXV_PagesView pView) 8 | { 9 | int s = pView.Obj.Px96toPx(8); 10 | s += (s % 2); 11 | return s; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CSharp/CustomTool/Helpers/CalcAssistant.cs: -------------------------------------------------------------------------------- 1 | using PDFXEdit; 2 | 3 | namespace CustomTool 4 | { 5 | public enum HitTestCode 6 | { 7 | None = 0, 8 | // 9 | LT, 10 | RT, 11 | RB, 12 | LB, 13 | // 14 | Inside, 15 | }; 16 | 17 | public static class CalcAssistant 18 | { 19 | public static PXC_Rect CalcCtlPtRect(double x, double y, double size) 20 | { 21 | PXC_Rect r; 22 | r.left = x - size / 2; 23 | r.right = r.left + size; 24 | r.top = y + size / 2; 25 | r.bottom = r.top - size; 26 | return r; 27 | } 28 | 29 | public static HitTestCode GetCursorFromHT(HitTestCode ht, int rotation) 30 | { 31 | if ((ht == HitTestCode.None) || (ht == HitTestCode.Inside)) 32 | return ht; 33 | int rotationFactor = (((rotation % 360) + 360) / 90) & 3; 34 | rotationFactor %= 4; 35 | int res = ((int)ht - (int)HitTestCode.LT) + rotationFactor; 36 | res = (int)HitTestCode.LT + (res % 4); 37 | return (HitTestCode)res; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CSharp/CustomTool/PageRegions.cs: -------------------------------------------------------------------------------- 1 | using CustomTool.Extensions; 2 | using PDFXEdit; 3 | using System.Collections.Generic; 4 | 5 | namespace CustomTool 6 | { 7 | public class PageRegions 8 | { 9 | public int PageIndex { get; set; } 10 | public List Rects { get; set; } = new List(); 11 | 12 | public int HitTest(PXC_Point pt, double ctlPtSize, out HitTestCode ht) 13 | { 14 | ht = HitTestCode.None; 15 | foreach (var rc in Rects) 16 | { 17 | var rcTemp = rc; 18 | rcTemp.Inflate(ctlPtSize); 19 | if (!rcTemp.ContainPoint(pt)) 20 | continue; 21 | // LeftTop 22 | PXC_Rect cp; 23 | cp = CalcAssistant.CalcCtlPtRect(rc.left, rc.top, ctlPtSize); 24 | if (cp.ContainPoint(pt)) 25 | { 26 | ht = HitTestCode.LT; 27 | return Rects.FindIndex(x => x.Equal(rc)); 28 | } 29 | 30 | // RightTop 31 | cp = CalcAssistant.CalcCtlPtRect(rc.right, rc.top, ctlPtSize); 32 | if (cp.ContainPoint(pt)) 33 | { 34 | ht = HitTestCode.RT; 35 | return Rects.FindIndex(x => x.Equal(rc)); 36 | } 37 | 38 | // RightBottom 39 | cp = CalcAssistant.CalcCtlPtRect(rc.right, rc.bottom, ctlPtSize); 40 | if (cp.ContainPoint(pt)) 41 | { 42 | ht = HitTestCode.RB; 43 | return Rects.FindIndex(x => x.Equal(rc)); 44 | } 45 | 46 | // LeftBottom 47 | cp = CalcAssistant.CalcCtlPtRect(rc.left, rc.bottom, ctlPtSize); 48 | if (cp.ContainPoint(pt)) 49 | { 50 | ht = HitTestCode.LB; 51 | return Rects.FindIndex(x => x.Equal(rc)); 52 | } 53 | 54 | if (rc.ContainPoint(pt)) 55 | { 56 | ht = HitTestCode.Inside; 57 | return Rects.FindIndex(x => x.Equal(rc)); 58 | } 59 | } 60 | return -1; 61 | } 62 | 63 | public bool Equal(PageRegions obj) 64 | { 65 | if ((obj.PageIndex != this.PageIndex) || (obj.Rects.Count != this.Rects.Count)) 66 | return false; 67 | for (int i = 0; i < obj.Rects.Count; i++) 68 | { 69 | if (!obj.Rects[i].Equal(this.Rects[i])) 70 | return false; 71 | } 72 | return true; 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /CSharp/CustomTool/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace CustomTool 5 | { 6 | internal static class Program 7 | { 8 | /// 9 | /// The main entry point for the application. 10 | /// 11 | [STAThread] 12 | static void Main() 13 | { 14 | Application.EnableVisualStyles(); 15 | Application.SetCompatibleTextRenderingDefault(false); 16 | Application.Run(new MainForm()); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CSharp/CustomTool/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("CustomTool")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("CustomTool")] 12 | [assembly: AssemblyCopyright("Copyright © 2022")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("8ff07e2d-5f4c-41a1-9881-96d44265b970")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /CSharp/CustomTool/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CustomTool.Properties 12 | { 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources 26 | { 27 | 28 | private static global::System.Resources.ResourceManager resourceMan; 29 | 30 | private static global::System.Globalization.CultureInfo resourceCulture; 31 | 32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 33 | internal Resources() 34 | { 35 | } 36 | 37 | /// 38 | /// Returns the cached ResourceManager instance used by this class. 39 | /// 40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 41 | internal static global::System.Resources.ResourceManager ResourceManager 42 | { 43 | get 44 | { 45 | if ((resourceMan == null)) 46 | { 47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CustomTool.Properties.Resources", typeof(Resources).Assembly); 48 | resourceMan = temp; 49 | } 50 | return resourceMan; 51 | } 52 | } 53 | 54 | /// 55 | /// Overrides the current thread's CurrentUICulture property for all 56 | /// resource lookups using this strongly typed resource class. 57 | /// 58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 59 | internal static global::System.Globalization.CultureInfo Culture 60 | { 61 | get 62 | { 63 | return resourceCulture; 64 | } 65 | set 66 | { 67 | resourceCulture = value; 68 | } 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /CSharp/CustomTool/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace CustomTool.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CSharp/CustomTool/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CSharp/FullDemo/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSharp/FullDemo/DeletePages.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace FullDemo 12 | { 13 | public partial class DeletePages : Form, IFormHelper 14 | { 15 | private MainFrm mainFrm = null; 16 | public DeletePages(MainFrm mainFrm) 17 | { 18 | this.mainFrm = mainFrm; 19 | 20 | InitializeComponent(); 21 | 22 | cbPagesSubset.SelectedIndex = 0; 23 | } 24 | 25 | public bool IsValid() 26 | { 27 | return mainFrm.pdfCtl.HasDoc; 28 | } 29 | 30 | public void OnUpdate() 31 | { 32 | Enabled = IsValid(); 33 | if (Enabled) 34 | lbNumPages.Text = String.Format("total {0} pages", mainFrm.pdfCtl.Doc.CoreDoc.Pages.Count); 35 | else 36 | lbNumPages.Text = ""; 37 | } 38 | 39 | public void OnSerialize(PDFXEdit.IOperation op) 40 | { 41 | if (op == null) 42 | return; 43 | 44 | PDFXEdit.ICabNode opts = op.Params.Root["Options"]; 45 | 46 | // pages range 47 | PDFXEdit.ICabNode pagesRange = opts["PagesRange"]; 48 | PDFXEdit.RangeType rangeType = PDFXEdit.RangeType.RangeType_Current; 49 | if (rbPages.Checked) 50 | rangeType = PDFXEdit.RangeType.RangeType_Exact; 51 | pagesRange["Type"].v = rangeType; 52 | pagesRange["Text"].v = tPages.Text; 53 | 54 | rangeType = PDFXEdit.RangeType.RangeType_All; 55 | if (cbPagesSubset.SelectedIndex == 1) 56 | rangeType = PDFXEdit.RangeType.RangeType_Odd; 57 | else if (cbPagesSubset.SelectedIndex != 0) 58 | rangeType = PDFXEdit.RangeType.RangeType_Even; 59 | pagesRange["Filter"].v = rangeType; 60 | } 61 | 62 | private void rbPages_CheckedChanged(object sender, EventArgs e) 63 | { 64 | tPages.Focus(); 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /CSharp/FullDemo/ExtractPagesForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace FullDemo 12 | { 13 | public partial class ExtractPagesForm : Form, IFormHelper 14 | { 15 | private MainFrm mainFrm = null; 16 | 17 | public ExtractPagesForm(MainFrm mainFrm) 18 | { 19 | this.mainFrm = mainFrm; 20 | 21 | InitializeComponent(); 22 | 23 | cbExportMode.SelectedIndex = 0; 24 | } 25 | 26 | private void tPages_TextChanged(object sender, EventArgs e) 27 | { 28 | mainFrm.AllowRunOper(IsValid()); 29 | } 30 | 31 | ///////////////////////////////////////////////////////////////// 32 | // IFormHelper 33 | ///////////////////////////////////////////////////////////////// 34 | 35 | public bool IsValid() 36 | { 37 | return mainFrm.pdfCtl.HasDoc && (tPages.Text.Length != 0); 38 | } 39 | 40 | public void OnUpdate() 41 | { 42 | Enabled = mainFrm.pdfCtl.HasDoc; 43 | if (Enabled) 44 | lbNumPages.Text = String.Format("(total {0} pages)", mainFrm.pdfCtl.Doc.CoreDoc.Pages.Count); 45 | else 46 | lbNumPages.Text = ""; 47 | } 48 | 49 | public void OnSerialize(PDFXEdit.IOperation op) 50 | { 51 | if (op == null) 52 | return; 53 | 54 | PDFXEdit.ICabNode opts = op.Params.Root["Options"]; 55 | 56 | PDFXEdit.ICabNode pagesRange = opts["PagesRange"]; 57 | pagesRange["Type"].v = PDFXEdit.RangeType.RangeType_Exact; 58 | pagesRange["Text"].v = tPages.Text; 59 | 60 | opts["OpenFolder"].v = ckOpenFolder.Checked; 61 | 62 | string action = "AllToOneFile"; 63 | if (cbExportMode.SelectedIndex == 1) 64 | action = "EachToFile"; 65 | else if (cbExportMode.SelectedIndex == 2) 66 | action = "EachRangeToFile"; 67 | opts["ExtractPagesAction"].v = action; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /CSharp/FullDemo/FullDemo.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2026 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FullDemo", "FullDemo.csproj", "{60274080-74E9-4D1D-88AA-87636178618A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {60274080-74E9-4D1D-88AA-87636178618A}.Debug|Any CPU.ActiveCfg = Debug|x86 19 | {60274080-74E9-4D1D-88AA-87636178618A}.Debug|Any CPU.Build.0 = Debug|x86 20 | {60274080-74E9-4D1D-88AA-87636178618A}.Debug|x64.ActiveCfg = Debug|x64 21 | {60274080-74E9-4D1D-88AA-87636178618A}.Debug|x64.Build.0 = Debug|x64 22 | {60274080-74E9-4D1D-88AA-87636178618A}.Debug|x86.ActiveCfg = Debug|x86 23 | {60274080-74E9-4D1D-88AA-87636178618A}.Debug|x86.Build.0 = Debug|x86 24 | {60274080-74E9-4D1D-88AA-87636178618A}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {60274080-74E9-4D1D-88AA-87636178618A}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {60274080-74E9-4D1D-88AA-87636178618A}.Release|x64.ActiveCfg = Release|x64 27 | {60274080-74E9-4D1D-88AA-87636178618A}.Release|x64.Build.0 = Release|x64 28 | {60274080-74E9-4D1D-88AA-87636178618A}.Release|x86.ActiveCfg = Release|x86 29 | {60274080-74E9-4D1D-88AA-87636178618A}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {252BC871-22E0-4D8E-A386-0B42B5B555D2} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CSharp/FullDemo/FullDemo.tss: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | D:\TEMP\10836$PDFXEdit.dll$v4.0.30319$NoDynamic\PDFXEdit.IPXS_Inst.cs 6 | 7 | 8 | D:\TEMP\10836$PDFXEdit.dll$v4.0.30319$NoDynamic\PDFXEdit.IPXC_Page.cs 9 | 10 | 11 | F:\WORK\PDF5\PDFEditSDKExamples\CSharp\FullDemo\MainFrm.cs 12 | 13 | 14 | FullDemo 15 | 16 | 17 | D:\TEMP\10836$PDFXEdit.dll$v4.0.30319$NoDynamic\PDFXEdit.IUIX_LayoutItem.cs 18 | 19 | 20 | D:\TEMP\10836$PDFXEdit.dll$v4.0.30319$NoDynamic\PDFXEdit.IUIX_Layout.cs 21 | 22 | 23 | f:\WORK\PDF5\Trunk\PDFViewerLib\Inst.cpp 24 | 25 | 26 | f:\WORK\PDF5\Trunk\PDFViewerLib\ViewBase.h 27 | 28 | 29 | F:\WORK\PDF5\Trunk\DSUILib\Layout.cpp 30 | 31 | 32 | -------------------------------------------------------------------------------- /CSharp/FullDemo/HResults.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace FullDemo 8 | { 9 | internal sealed class HResults 10 | { 11 | internal const int S_OK = 0; 12 | internal const int S_FALSE = 1; 13 | internal const int E_NOTIMPL = unchecked((int)0x80004001); 14 | internal const int E_POINTER = unchecked((int)0x80004003); 15 | internal const int E_FAIL = unchecked((int)0x80004005); 16 | internal const int E_OUTOFMEMORY = unchecked((int)0x8007000E); 17 | 18 | private HResults() { } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /CSharp/FullDemo/IFormHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace FullDemo 8 | { 9 | interface IFormHelper 10 | { 11 | bool IsValid(); 12 | void OnUpdate(); 13 | void OnSerialize(PDFXEdit.IOperation dest); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CSharp/FullDemo/InsertPagesForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace FullDemo 12 | { 13 | public partial class InsertPagesForm : Form, IFormHelper 14 | { 15 | private MainFrm mainFrm = null; 16 | 17 | public InsertPagesForm(MainFrm mainFrm) 18 | { 19 | this.mainFrm = mainFrm; 20 | 21 | InitializeComponent(); 22 | } 23 | 24 | private void tPages_TextChanged(object sender, EventArgs e) 25 | { 26 | rbPages.Checked = true; 27 | mainFrm.AllowRunOper(IsValid()); 28 | } 29 | 30 | ///////////////////////////////////////////////////////////////// 31 | // IFormHelper 32 | ///////////////////////////////////////////////////////////////// 33 | 34 | public bool IsValid() 35 | { 36 | return mainFrm.pdfCtl.HasDoc && (tSrcToOpen.Text.Length != 0); 37 | } 38 | 39 | public void OnUpdate() 40 | { 41 | Enabled = mainFrm.pdfCtl.HasDoc; 42 | if (Enabled) 43 | lbNumPages.Text = String.Format("(total {0} pages)", mainFrm.pdfCtl.Doc.CoreDoc.Pages.Count); 44 | else 45 | lbNumPages.Text = ""; 46 | } 47 | 48 | public void OnSerialize(PDFXEdit.IOperation op) 49 | { 50 | if (op == null) 51 | return; 52 | 53 | PDFXEdit.ICabNode opts = op.Params.Root["Options"]; 54 | 55 | // src 56 | opts["Src"].v = mainFrm.fsInst.DefaultFileSys.StringToName(tSrcToOpen.Text); 57 | 58 | // src pages range 59 | PDFXEdit.ICabNode pagesRange = opts["PagesRange"]; 60 | PDFXEdit.RangeType rangeType = PDFXEdit.RangeType.RangeType_All; 61 | if (rbPages.Checked) 62 | rangeType = PDFXEdit.RangeType.RangeType_Exact; 63 | pagesRange["Type"].v = rangeType; 64 | pagesRange["Text"].v = tPages.Text; 65 | 66 | // dest 67 | opts["Location"].v = "Before"; 68 | opts["Position"].v = (int)tDestPos.Value - 1; 69 | } 70 | 71 | private void btnBrowseForOpen_Click(object sender, EventArgs e) 72 | { 73 | PDFXEdit.IAFS_NamesCollection openFiles = mainFrm.ShowOpenFilesDlg(false, "PDF Documents (*.pdf)|*.pdf|All Files (*.*)|*.*"); 74 | if (openFiles == null) 75 | return; 76 | PDFXEdit.IAFS_Name fileName = openFiles[0]; 77 | tSrcToOpen.Text = fileName.FileSys.NameToString(fileName); 78 | mainFrm.AllowRunOper(IsValid()); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /CSharp/FullDemo/MovePages.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace FullDemo 12 | { 13 | public partial class MovePages : Form, IFormHelper 14 | { 15 | private MainFrm mainFrm = null; 16 | public MovePages(MainFrm mainFrm) 17 | { 18 | this.mainFrm = mainFrm; 19 | 20 | InitializeComponent(); 21 | 22 | cbPagesSubset.SelectedIndex = 0; 23 | cbLocation.SelectedIndex = 0; 24 | } 25 | 26 | public bool IsValid() 27 | { 28 | return mainFrm.pdfCtl.HasDoc; 29 | } 30 | 31 | public void OnUpdate() 32 | { 33 | Enabled = IsValid(); 34 | if (Enabled) 35 | { 36 | lbNumPages.Text = String.Format("total {0} pages", mainFrm.pdfCtl.Doc.CoreDoc.Pages.Count); 37 | lbNumPage.Text = String.Format("total {0} pages", mainFrm.pdfCtl.Doc.CoreDoc.Pages.Count); 38 | } 39 | else 40 | { 41 | lbNumPages.Text = ""; 42 | lbNumPage.Text = ""; 43 | } 44 | } 45 | 46 | public void OnSerialize(PDFXEdit.IOperation op) 47 | { 48 | if (op == null) 49 | return; 50 | 51 | PDFXEdit.ICabNode opts = op.Params.Root["Options"]; 52 | 53 | // pages range 54 | PDFXEdit.ICabNode pagesRange = opts["PagesRange"]; 55 | PDFXEdit.RangeType rangeType = PDFXEdit.RangeType.RangeType_Current; 56 | if (rbPages.Checked) 57 | rangeType = PDFXEdit.RangeType.RangeType_Exact; 58 | pagesRange["Type"].v = rangeType; 59 | pagesRange["Text"].v = tPages.Text; 60 | 61 | rangeType = PDFXEdit.RangeType.RangeType_All; 62 | if (cbPagesSubset.SelectedIndex == 1) 63 | rangeType = PDFXEdit.RangeType.RangeType_Odd; 64 | else if (cbPagesSubset.SelectedIndex != 0) 65 | rangeType = PDFXEdit.RangeType.RangeType_Even; 66 | pagesRange["Filter"].v = rangeType; 67 | int nNumberPage = 1; 68 | bool bIsLandscape = cbLocation.SelectedIndex == 0; 69 | if (rbFirst.Checked) 70 | { 71 | nNumberPage = bIsLandscape ? 0 : 2; 72 | } 73 | if (rbLast.Checked) 74 | { 75 | nNumberPage = (int)mainFrm.pdfCtl.Doc.CoreDoc.Pages.Count; 76 | if (bIsLandscape) 77 | nNumberPage--; 78 | } 79 | if (rbPage.Checked) 80 | { 81 | nNumberPage = (int)tNumPage.Value + 1; 82 | if (bIsLandscape) 83 | nNumberPage--; 84 | } 85 | opts["InsertBefore"].v = nNumberPage; 86 | } 87 | 88 | private void rbPages_CheckedChanged(object sender, EventArgs e) 89 | { 90 | tPages.Focus(); 91 | } 92 | 93 | private void rbFirst_Click(object sender, EventArgs e) 94 | { 95 | tNumPage.Value = 1; 96 | rbFirst.Checked = true; 97 | } 98 | 99 | private void rbLast_Click(object sender, EventArgs e) 100 | { 101 | tNumPage.Value = (int)mainFrm.pdfCtl.Doc.CoreDoc.Pages.Count; 102 | rbLast.Checked = true; 103 | } 104 | 105 | private void rbPage_CheckedChanged(object sender, EventArgs e) 106 | { 107 | tNumPage.Focus(); 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /CSharp/FullDemo/OCRPagesForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | 11 | namespace FullDemo 12 | { 13 | public partial class OCRPagesForm : Form, IFormHelper 14 | { 15 | 16 | 17 | private MainFrm mainFrm = null; 18 | public OCRPagesForm(MainFrm mainFrm) 19 | { 20 | this.mainFrm = mainFrm; 21 | 22 | InitializeComponent(); 23 | 24 | cbPagesSubset.SelectedIndex = 0; 25 | cbOutputType.SelectedIndex = 1; 26 | cbQuality.SelectedIndex = 3; 27 | } 28 | 29 | public bool IsValid() 30 | { 31 | return mainFrm.pdfCtl.HasDoc; 32 | } 33 | 34 | public void OnUpdate() 35 | { 36 | Enabled = IsValid(); 37 | if (Enabled) 38 | { 39 | lbNumPages.Text = String.Format("total {0} pages", mainFrm.pdfCtl.Doc.CoreDoc.Pages.Count); 40 | } 41 | else 42 | { 43 | lbNumPages.Text = ""; 44 | } 45 | } 46 | 47 | public void OnSerialize(PDFXEdit.IOperation op) 48 | { 49 | if (op == null) 50 | return; 51 | 52 | PDFXEdit.ICabNode opts = op.Params.Root["Options"]; 53 | 54 | // pages range 55 | PDFXEdit.ICabNode pagesRange = opts["PagesRange"]; 56 | PDFXEdit.RangeType rangeType = PDFXEdit.RangeType.RangeType_Current; 57 | if (rbPages.Checked) 58 | rangeType = PDFXEdit.RangeType.RangeType_Exact; 59 | pagesRange["Type"].v = rangeType; 60 | pagesRange["Text"].v = tPages.Text; 61 | 62 | rangeType = PDFXEdit.RangeType.RangeType_All; 63 | if (cbPagesSubset.SelectedIndex == 1) 64 | rangeType = PDFXEdit.RangeType.RangeType_Odd; 65 | else if (cbPagesSubset.SelectedIndex != 0) 66 | rangeType = PDFXEdit.RangeType.RangeType_Even; 67 | pagesRange["Filter"].v = rangeType; 68 | 69 | //Output 70 | opts["OutputType"].v = cbOutputType.SelectedIndex; 71 | opts["OutputDPI"].v = (cbQuality.SelectedIndex != 0) ? Convert.ToInt32(cbQuality.Text) : 0 ; 72 | //opts["AutoDeskew"].v = ckAutoDeskew.Checked; 73 | } 74 | 75 | private void cbOutputType_SelectedIndexChanged(object sender, EventArgs e) 76 | { 77 | cbQuality.Enabled = cbOutputType.SelectedIndex == 0; 78 | ckAutoDeskew.Enabled = cbOutputType.SelectedIndex == 0; 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /CSharp/FullDemo/PDFXEditCore.x86.X.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 13 | 14 | 17 | 18 | 21 | 22 | 23 | 24 | 30 | 31 | 37 | 38 | -------------------------------------------------------------------------------- /CSharp/FullDemo/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace FullDemo 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | 20 | Application.Run(new MainFrm()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CSharp/FullDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("FullDemo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("FullDemo")] 13 | [assembly: AssemblyCopyright("Copyright © 2015")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("20d129e6-4c4b-43f6-9036-293022072836")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSharp/FullDemo/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FullDemo.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("FullDemo.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap ico_msg_warning_24 { 67 | get { 68 | object obj = ResourceManager.GetObject("ico.msg.warning.24", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /CSharp/FullDemo/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace FullDemo.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CSharp/FullDemo/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CSharp/FullDemo/Registration-Free/FullDemo.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /CSharp/FullDemo/Registration-Free/PDFXEditCore.x86.X.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | 11 | 13 | 14 | 17 | 18 | 21 | 22 | 23 | 24 | 30 | 31 | 37 | 38 | -------------------------------------------------------------------------------- /CSharp/FullDemo/Registration-Free/Readme.txt: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////// 2 | // Registration-Free Redistribution 3 | /////////////////////////////////////////////////////////////////////////////////////// 4 | 5 | Your application installer should locate all application executable files and the require PDF-XChange Editor SDK files in a single common folder along with two additional XML files with prescribed file names as follows: 6 | 7 | .exe.manifest 8 | PDFXEditCore.x86.X.manifest 9 | 10 | Where - is the name of the application’s executable file without a file extension. 11 | 12 | More detailed information regarding Registration-Free technology can be found here: https://msdn.microsoft.com/en-us/library/ms973913.aspx. 13 | 14 | IMPORTANT: in your development environment you will also need to change the settings of your project to use external manifest files as opposed to those built-in by default. 15 | 16 | --- 17 | 18 | To enable the Registration-Free mode for 'FullDemo' sample: 19 | 20 | 1. Go to project's Properties, select 'Application' tab, in 'Resources' section and choose 'Create application without a manifest' option and re-build application. 21 | Note: on this step the PDFXEditCore.x86.dll should be still installed in the system as regular COM-server. 22 | 23 | 2. Copy PDFXEditCore.x86.X.manifest and FullDemo.exe.manifest files to \bin\x86\. 24 | Also place the PDFXEditCore.x86.dll and Resources.dat files into this folder too. After that you will be able to start and use the FullDemo.exe even if PDFXEditCore.x86.dll is not installed as COM-server. -------------------------------------------------------------------------------- /CSharp/FullDemo/Resources/ico.msg.warning.24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CSharp/FullDemo/Resources/ico.msg.warning.24.png -------------------------------------------------------------------------------- /CSharp/FullDemo/RotatePagesForm.cs: -------------------------------------------------------------------------------- 1 | using PDFXEdit; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel; 5 | using System.Data; 6 | using System.Drawing; 7 | using System.Linq; 8 | using System.Text; 9 | using System.Threading.Tasks; 10 | using System.Windows.Forms; 11 | 12 | namespace FullDemo 13 | { 14 | public partial class RotatePagesForm : Form, IFormHelper 15 | { 16 | private MainFrm mainFrm = null; 17 | 18 | 19 | public RotatePagesForm(MainFrm mainFrm) 20 | { 21 | this.mainFrm = mainFrm; 22 | 23 | InitializeComponent(); 24 | 25 | cbDirection.SelectedIndex = 0; 26 | cbOrientation.SelectedIndex = 0; 27 | cbPagesSubset.SelectedIndex = 0; 28 | } 29 | 30 | public bool IsValid() 31 | { 32 | return mainFrm.pdfCtl.HasDoc; 33 | } 34 | 35 | public void OnUpdate() 36 | { 37 | Enabled = IsValid(); 38 | if (Enabled) 39 | { 40 | lbNumPages.Text = String.Format("total {0} pages", mainFrm.pdfCtl.Doc.CoreDoc.Pages.Count); 41 | } 42 | else 43 | { 44 | lbNumPages.Text = ""; 45 | } 46 | } 47 | 48 | public void OnSerialize(IOperation op) 49 | { 50 | if (op == null) 51 | return; 52 | 53 | ICabNode opts = op.Params.Root["Options"]; 54 | 55 | // pages range 56 | ICabNode pagesRange = opts["PagesRange"]; 57 | RangeType rangeType = RangeType.RangeType_All; 58 | if (rbCurPage.Checked) 59 | rangeType = RangeType.RangeType_Current; 60 | else if (rbPages.Checked) 61 | rangeType = RangeType.RangeType_Exact; 62 | pagesRange["Type"].v = rangeType; 63 | pagesRange["Text"].v = tPages.Text; 64 | 65 | rangeType = RangeType.RangeType_All; 66 | if (cbPagesSubset.SelectedIndex == 1) 67 | rangeType = RangeType.RangeType_Odd; 68 | else if (cbPagesSubset.SelectedIndex != 0) 69 | rangeType = RangeType.RangeType_Even; 70 | pagesRange["Filter"].v = rangeType; 71 | 72 | opts["Direction"].v = cbDirection.SelectedIndex + 1; // 0 == 0 degrees thus +1 73 | opts["PagesOrientation"].v = cbOrientation.SelectedIndex; // SelectedIndex == value 74 | } 75 | 76 | private void rbPages_CheckedChanged(object sender, EventArgs e) 77 | { 78 | tPages.Focus(); 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /CSharp/FullDemo/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 57 | 58 | 59 | 60 | true 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /CSharp/OptimizeImagesCompression/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSharp/OptimizeImagesCompression/CmdArgsParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using OptimizeImagesCompression.Properties; 3 | 4 | namespace OptimizeImagesCompression 5 | { 6 | static class CmdArgsParser 7 | { 8 | public static string GetCmdArgForParam(string param) 9 | { 10 | string[] allargsparams = Environment.GetCommandLineArgs(); 11 | return ParseCmdArgs(allargsparams, param); 12 | } 13 | 14 | private static string ParseCmdArgs(string[] allargsparams, string param) 15 | { 16 | for (int i = 0; i < allargsparams.Length; i++) 17 | { 18 | if (allargsparams[i] == param) 19 | { 20 | if (String.IsNullOrEmpty(allargsparams[i + 1])) 21 | { 22 | Console.WriteLine(Resources.CmdArgsParser_ParseCmdArgs_arg_is_null_for_parametr_ + param + Resources.CmdArgsParser_ParseCmdArgs__terminating___); 23 | System.Diagnostics.Debug.WriteLine(Resources.CmdArgsParser_ParseCmdArgs_arg_is_null_for_parametr_ + param + Resources.CmdArgsParser_ParseCmdArgs__terminating___); 24 | Environment.Exit(0); 25 | } 26 | else 27 | { 28 | return allargsparams[i + 1]; 29 | } 30 | } 31 | } 32 | Console.WriteLine(Resources.CmdArgsParser_ParseCmdArgs_arg_is_not_found_for_ + param + Resources.CmdArgsParser_ParseCmdArgs__terminating___); 33 | System.Diagnostics.Debug.WriteLine(Resources.CmdArgsParser_ParseCmdArgs_arg_is_not_found_for_ + param + Resources.CmdArgsParser_ParseCmdArgs__terminating___); 34 | Environment.Exit(0); 35 | return "ArgNotFound"; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CSharp/OptimizeImagesCompression/GetTestFiles.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | 4 | namespace OptimizeImagesCompression 5 | { 6 | class GetTestFiles 7 | { 8 | public static string FolderWithTestFilesPath { get; set; } 9 | public static string[] GetAllFilesInFolder() 10 | { 11 | return Directory.GetFiles(FolderWithTestFilesPath); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CSharp/OptimizeImagesCompression/Logger.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Globalization; 3 | using System.IO; 4 | using System.Text; 5 | 6 | namespace OptimizeImagesCompression 7 | { 8 | internal class Logger 9 | { 10 | public string Path; 11 | public FileStream Log; 12 | 13 | public void StartLogging() 14 | { 15 | Log = File.Open(Path, FileMode.Append); 16 | WriteDelimitrToLog(Log); 17 | WriteUnicodeString(DateTime.Now.ToString("h:mm:ss tt", CultureInfo.CurrentCulture) + " Start logger" + "\n"); 18 | var newline = Encoding.ASCII.GetBytes(Environment.NewLine); 19 | Log.Write(newline, 0, newline.Length); 20 | } 21 | 22 | public void EndLogging() 23 | { 24 | Log.Close(); 25 | } 26 | 27 | public void WriteUnicodeString(string info) 28 | { 29 | Console.WriteLine(info); 30 | var infoB = new UTF8Encoding(true).GetBytes(info); 31 | Log.Write(infoB, 0, infoB.Length); 32 | var newline = Encoding.ASCII.GetBytes(Environment.NewLine); 33 | Log.Write(newline, 0, newline.Length); 34 | } 35 | 36 | public void WriteDelimitrToLog(FileStream log) 37 | { 38 | var infoB = 39 | new UTF8Encoding(true).GetBytes("====================================================================" + 40 | "\n"); 41 | log.Write(infoB, 0, infoB.Length); 42 | var newline = Encoding.ASCII.GetBytes(Environment.NewLine); 43 | log.Write(newline, 0, newline.Length); 44 | Console.WriteLine(newline.ToString()); 45 | } 46 | 47 | public void WriteOperationToLog(OperationParameters operation) 48 | { 49 | WriteUnicodeString("Original file path = " + operation.FilePath); 50 | WriteUnicodeString("Params and output file name = " + operation.OutputFilePath); 51 | if (operation.ErrCodes == string.Empty) 52 | WriteUnicodeString("Error code = None"); 53 | else 54 | WriteUnicodeString("Error code = " + operation.ErrCodes); 55 | WriteUnicodeString("Time of convertation = " + operation.Time); 56 | WriteUnicodeString("Params and output file name = " + operation.OutputFilePath); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /CSharp/OptimizeImagesCompression/OperationParameters.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | 3 | namespace OptimizeImagesCompression 4 | { 5 | class OperationParameters 6 | { 7 | public string FilePath; 8 | public string OutputFilePath; 9 | public string CompMode; 10 | public int Method; 11 | public int Quality; 12 | public string ErrCodes = ""; 13 | public long Time = 0; 14 | public long OptimazedFileSize = 0; 15 | public long OriginalFileSize = 0; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /CSharp/OptimizeImagesCompression/OptimizeImagesCompression.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2043 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OptimizeImagesCompression", "OptimizeImagesCompression.csproj", "{6D415137-3281-4CB9-9703-8670DBC26508}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {6D415137-3281-4CB9-9703-8670DBC26508}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {6D415137-3281-4CB9-9703-8670DBC26508}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {6D415137-3281-4CB9-9703-8670DBC26508}.Debug|x64.ActiveCfg = Debug|x64 21 | {6D415137-3281-4CB9-9703-8670DBC26508}.Debug|x64.Build.0 = Debug|x64 22 | {6D415137-3281-4CB9-9703-8670DBC26508}.Debug|x86.ActiveCfg = Debug|x86 23 | {6D415137-3281-4CB9-9703-8670DBC26508}.Debug|x86.Build.0 = Debug|x86 24 | {6D415137-3281-4CB9-9703-8670DBC26508}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {6D415137-3281-4CB9-9703-8670DBC26508}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {6D415137-3281-4CB9-9703-8670DBC26508}.Release|x64.ActiveCfg = Release|x64 27 | {6D415137-3281-4CB9-9703-8670DBC26508}.Release|x64.Build.0 = Release|x64 28 | {6D415137-3281-4CB9-9703-8670DBC26508}.Release|x86.ActiveCfg = Release|x86 29 | {6D415137-3281-4CB9-9703-8670DBC26508}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {597424F0-253B-40AE-9DB1-FBC1BA69F77D} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CSharp/OptimizeImagesCompression/PDFXEDIT.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.IO; 4 | using PDFXEdit; 5 | 6 | namespace OptimizeImagesCompression 7 | { 8 | internal class Pdfxedit 9 | { 10 | public PXV_Inst MInst; 11 | public IPXC_Inst MPxcInst; 12 | public IAFS_Inst FsInst; 13 | 14 | public void InitPdfControl() 15 | { 16 | var pathToPdfOptimizer = Path.Combine(Environment.CurrentDirectory, "PDFOptimizer.pvp"); 17 | MInst = new PXV_Inst(); 18 | MInst.Init(); 19 | MInst.StartLoadingPlugins(); 20 | MInst.AddPluginFromFile(pathToPdfOptimizer); 21 | MInst.FinishLoadingPlugins(); 22 | MPxcInst = MInst.GetExtension("PXC") as IPXC_Inst; 23 | if (MPxcInst != null) FsInst = (IAFS_Inst)MPxcInst.GetExtension("AFS"); 24 | Debug.WriteLine("InitPdfControl() succesfull"); 25 | } 26 | 27 | public void OptimizeDocument(OperationParameters operation) 28 | { 29 | try 30 | { 31 | var nId = MInst.Str2ID(@"op.document.optimize", false); 32 | var op = MInst.CreateOp(nId); 33 | var input = op.Params.Root["Input"]; 34 | var impPath = FsInst.DefaultFileSys.StringToName(operation.FilePath); 35 | ICabNode options = op.Params.Root["Options"]; 36 | ICabNode images = options["Images"]; 37 | images["Enabled"].v = true; 38 | images["ReducedOnly"].v = false; 39 | ICabNode comp = images["Comp"]; 40 | //set all methods to retain existing 41 | comp["Color.Method"].v = 0; 42 | comp["Grayscale.Method"].v = 0; 43 | comp["Indexed.Method"].v = 0; 44 | comp["Mono.Method"].v = 0; 45 | //set my params 46 | var opParam = operation.CompMode + "." + "Method"; 47 | comp[opParam].v = operation.Method; 48 | if (((operation.CompMode == "Color") || (operation.CompMode == "Grayscale")) && 49 | ((operation.Method == 1) || (operation.Method == 2))) 50 | comp[operation.CompMode + "." + "JPEGQuality"].v = operation.Quality; 51 | var resDoc = MPxcInst.OpenDocumentFrom(impPath, null); 52 | input.Add().v = resDoc; 53 | op.Do(); 54 | resDoc.WriteToFile(operation.OutputFilePath); 55 | resDoc.Close(); 56 | operation.ErrCodes = string.Empty; 57 | } 58 | catch (Exception e) 59 | { 60 | operation.ErrCodes = e.Message; 61 | Console.WriteLine(e.Message); 62 | } 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /CSharp/OptimizeImagesCompression/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("OptimizeImagesCompression")] 8 | [assembly: AssemblyDescription("")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("OptimizeImagesCompression")] 12 | [assembly: AssemblyCopyright("Copyright © 2016")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("6d415137-3281-4cb9-9703-8670dbc26508")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /CSharp/OptimizeImagesCompression/README.md: -------------------------------------------------------------------------------- 1 | ## Simple example-project that used operation "op.document.optimize" 2 | 3 | - [The operation allows to optimize the PDF document.](https://sdkhelp.tracker-software.com/view/PXV:op_document_optimize) 4 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/PreviewCtrl.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace PDFXEditCtrl 2 | { 3 | partial class PreviewCtrl 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | /// 11 | /// Clean up any resources being used. 12 | /// 13 | /// true if managed resources should be disposed; otherwise, false. 14 | protected override void Dispose(bool disposing) 15 | { 16 | if (disposing && (components != null)) 17 | { 18 | components.Dispose(); 19 | } 20 | base.Dispose(disposing); 21 | } 22 | 23 | #region Component Designer generated code 24 | 25 | /// 26 | /// Required method for Designer support - do not modify 27 | /// the contents of this method with the code editor. 28 | /// 29 | private void InitializeComponent() 30 | { 31 | this.SuspendLayout(); 32 | // 33 | // PreviewCtrl 34 | // 35 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 36 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 37 | this.Name = "PreviewCtrl"; 38 | this.Size = new System.Drawing.Size(502, 495); 39 | this.Resize += new System.EventHandler(this.PreviewCtrl_Resize); 40 | this.ResumeLayout(false); 41 | 42 | } 43 | 44 | #endregion 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/PreviewCtrl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Drawing; 5 | using System.Data; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using PDFXEdit; 11 | 12 | namespace PDFXEditCtrl 13 | { 14 | public partial class PreviewCtrl: UserControl 15 | { 16 | public IPXV_PagesPreviewCtl pagesPreviewCtl = null; 17 | 18 | private IPXV_Inst Inst = null; 19 | private IUIX_Obj parentBase = null; 20 | private PDFXEdit.IPXC_Document m_doc = null; 21 | 22 | public PreviewCtrl() 23 | { 24 | InitializeComponent(); 25 | } 26 | 27 | public void LoadInst(IPXV_Inst inst) 28 | { 29 | Inst = inst; 30 | 31 | IUIX_Inst uiInst = (IUIX_Inst)Inst.GetExtension("UIX"); 32 | Rectangle rcCl = ClientRectangle; 33 | tagRECT rc; 34 | rc.left = rcCl.Left; 35 | rc.top = rcCl.Top; 36 | rc.right = rcCl.Right; 37 | rc.bottom = rcCl.Bottom; 38 | 39 | UIX_CreateObjParams cp = new UIX_CreateObjParams(); 40 | cp.nStdClass = (int)UIX_StdClasses.UIX_StdClass_Blank; 41 | cp.hWndParent = (uint)Handle.ToInt32(); 42 | cp.rc = rc; 43 | parentBase = uiInst.CreateObj(ref cp); 44 | 45 | pagesPreviewCtl = Inst.CreatePagesPreviewCtl(parentBase, rc, "ctrl.01", 46 | (long)PXV_PagesPreviewStyleFlags.PXV_PagesPreviewStyle_NoHandTool | (long)PXV_PagesPreviewStyleFlags.PXV_PagesPreviewStyle_NonInertialHand | (long)PXV_PagesPreviewStyleFlags.PXV_PagesPreviewStyle_InteractiveLayout, 47 | (long)UIX_ScrollStyleFlags.UIX_ScrollStyle_Horz | (long)UIX_ScrollStyleFlags.UIX_ScrollStyle_Vert); 48 | } 49 | public void ReleaseInst() 50 | { 51 | m_doc?.Close(); 52 | pagesPreviewCtl = null; 53 | Inst = null; 54 | } 55 | 56 | private void PreviewCtrl_Resize(object sender, EventArgs e) 57 | { 58 | Rectangle rcCl = ClientRectangle; 59 | tagRECT rc; 60 | rc.left = rcCl.Left; 61 | rc.top = rcCl.Top; 62 | rc.right = rcCl.Right; 63 | rc.bottom = rcCl.Bottom; 64 | parentBase?.set_Rect(ref rc); 65 | if (pagesPreviewCtl != null) 66 | { 67 | IUIX_Obj parent = pagesPreviewCtl.Obj.Parent; 68 | parent?.set_Rect(ref rc); 69 | } 70 | } 71 | 72 | public void OpenFile(string fileName) 73 | { 74 | int nID = Inst.Str2ID("op.openDoc", false); 75 | PDFXEdit.IOperation Op = Inst.CreateOp(nID); 76 | PDFXEdit.IAFS_Inst fsInst = (PDFXEdit.IAFS_Inst)Inst.GetExtension("AFS"); 77 | PDFXEdit.IAFS_Name name = fsInst.DefaultFileSys.StringToName(fileName); 78 | var input = Op.Params.Root["Input"]; 79 | input.v = name; 80 | PDFXEdit.ICabNode options = Op.Params.Root["Options"]; 81 | options["NativeOnly"].v = true; 82 | Op.Do(); 83 | 84 | m_doc?.Close(); 85 | m_doc = null; 86 | m_doc = (PDFXEdit.IPXC_Document)Op.Params.Root["Output"].v; 87 | OpenFile(m_doc); 88 | } 89 | 90 | public void OpenFile(PDFXEdit.IPXC_Document doc) 91 | { 92 | //Opening document in the given main Frame 93 | pagesPreviewCtl.Doc = doc; 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/PreviewCtrl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CSharp/PreviewCtrl/PreviewCtrl.png -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/PreviewCtrl.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32516.85 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PreviewCtrl", "PreviewCtrl.csproj", "{31716E5D-14D9-4635-8FD5-F2DE3527F58F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Debug|x64.ActiveCfg = Debug|x64 21 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Debug|x64.Build.0 = Debug|x64 22 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Debug|x86.ActiveCfg = Debug|x86 23 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Debug|x86.Build.0 = Debug|x86 24 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Release|x64.ActiveCfg = Release|x64 27 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Release|x64.Build.0 = Release|x64 28 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Release|x86.ActiveCfg = Release|x86 29 | {31716E5D-14D9-4635-8FD5-F2DE3527F58F}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {8FEBCC2C-3C1B-4928-A48E-B60A3F2E7DF7} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace PreviewCtrl 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("PreviewCtrl")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("PreviewCtrl")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("31716e5d-14d9-4635-8fd5-f2de3527f58f")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace PreviewCtrl.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PreviewCtrl.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace PreviewCtrl.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/README.md: -------------------------------------------------------------------------------- 1 | ## Simple example-project that simple view PDF file 2 | 3 | Used [CreatePagesPreviewCtl](https://sdkhelp.tracker-software.com/view/PXV:IPXV_Inst_CreatePagesPreviewCtl) 4 | 5 | ![Preview PreviewCtrl](PreviewCtrl.png?raw=true) 6 | -------------------------------------------------------------------------------- /CSharp/PreviewCtrl/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 53 | 54 | 55 | true 56 | 57 | 58 | 59 | 60 | 61 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /CSharp/RoboReader/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSharp/RoboReader/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace RoboReader 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CSharp/RoboReader/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("RoboReader")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("RoboReader")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3083dd98-4d5d-4f9d-bebf-24436fe578bb")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSharp/RoboReader/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace RoboReader.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RoboReader.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /CSharp/RoboReader/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace RoboReader.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CSharp/RoboReader/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CSharp/RoboReader/README.md: -------------------------------------------------------------------------------- 1 | ## Simple example-project that reads and highlights text in pdf 2 | ![Preview RoboReader](RoboReader.gif?raw=true) 3 | -------------------------------------------------------------------------------- /CSharp/RoboReader/RoboReader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CSharp/RoboReader/RoboReader.gif -------------------------------------------------------------------------------- /CSharp/RoboReader/RoboReader.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2043 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RoboReader", "RoboReader.csproj", "{3083DD98-4D5D-4F9D-BEBF-24436FE578BB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Debug|x64.ActiveCfg = Debug|x64 21 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Debug|x64.Build.0 = Debug|x64 22 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Debug|x86.ActiveCfg = Debug|x86 23 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Debug|x86.Build.0 = Debug|x86 24 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Release|x64.ActiveCfg = Release|x64 27 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Release|x64.Build.0 = Release|x64 28 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Release|x86.ActiveCfg = Release|x86 29 | {3083DD98-4D5D-4F9D-BEBF-24436FE578BB}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {335EFC4B-FAC9-4DD4-A4F5-6C7E010E700A} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CSharp/RoboReader/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 57 | 58 | 59 | 60 | true 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /CSharp/TiffExtractor/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /CSharp/TiffExtractor/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace TiffExtractor 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [MTAThread] 15 | static void Main() 16 | { 17 | Application.EnableVisualStyles(); 18 | Application.SetCompatibleTextRenderingDefault(false); 19 | Application.Run(new Form1()); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CSharp/TiffExtractor/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("TiffExtractor")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("TiffExtractor")] 13 | [assembly: AssemblyCopyright("Copyright © 2016")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9bd16c52-45fe-47d4-9e15-720c4ae395a2")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /CSharp/TiffExtractor/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TiffExtractor.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TiffExtractor.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /CSharp/TiffExtractor/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace TiffExtractor.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CSharp/TiffExtractor/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CSharp/TiffExtractor/README.md: -------------------------------------------------------------------------------- 1 | ## Simple example-project that used operation "op.document.exportToImages" from multithreading 2 | 3 | [The operation allows to export document pages to the image files with given DPI, zoom factor and specified format.](https://sdkhelp.tracker-software.com/view/PXV:op_document_exportToImages) 4 | 5 | ![Preview TiffExtractor](TiffExtractor.png?raw=true) 6 | -------------------------------------------------------------------------------- /CSharp/TiffExtractor/TiffExtractor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/CSharp/TiffExtractor/TiffExtractor.png -------------------------------------------------------------------------------- /CSharp/TiffExtractor/TiffExtractor.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27703.2035 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TiffExtractor", "TiffExtractor.csproj", "{C366CA07-3F2C-45B5-AF67-31C9D0901BC5}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Debug|x86 = Debug|x86 13 | Release|Any CPU = Release|Any CPU 14 | Release|x64 = Release|x64 15 | Release|x86 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Debug|x64.ActiveCfg = Debug|x64 21 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Debug|x64.Build.0 = Debug|x64 22 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Debug|x86.ActiveCfg = Debug|x86 23 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Debug|x86.Build.0 = Debug|x86 24 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Release|x64.ActiveCfg = Release|x64 27 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Release|x64.Build.0 = Release|x64 28 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Release|x86.ActiveCfg = Release|x86 29 | {C366CA07-3F2C-45B5-AF67-31C9D0901BC5}.Release|x86.Build.0 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {54E574A1-A1BC-4B03-8707-1EC6A35B0F9F} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /CSharp/TiffExtractor/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 52 | 53 | 54 | 55 | true 56 | 57 | 58 | 59 | 60 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /Delphi/CreatePagesPreviewCtl/CreatePagesPreviewCtl.dpr: -------------------------------------------------------------------------------- 1 | program CreatePagesPreviewCtl; 2 | 3 | uses 4 | Vcl.Forms, 5 | uMain in 'uMain.pas' {frmMain}, 6 | Unit2 in 'Unit2.pas' {Form2}; 7 | 8 | {$R *.res} 9 | 10 | begin 11 | Application.Initialize; 12 | Application.MainFormOnTaskbar := True; 13 | Application.CreateForm(TfrmMain, frmMain); 14 | Application.Run; 15 | end. 16 | -------------------------------------------------------------------------------- /Delphi/CreatePagesPreviewCtl/CreatePagesPreviewCtl.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/Delphi/CreatePagesPreviewCtl/CreatePagesPreviewCtl.res -------------------------------------------------------------------------------- /Delphi/CreatePagesPreviewCtl/Unit2.dfm: -------------------------------------------------------------------------------- 1 | object Form2: TForm2 2 | Left = 0 3 | Top = 0 4 | Caption = 'Form2' 5 | ClientHeight = 361 6 | ClientWidth = 537 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -11 11 | Font.Name = 'Tahoma' 12 | Font.Style = [] 13 | OldCreateOrder = False 14 | OnResize = FormResize 15 | PixelsPerInch = 96 16 | TextHeight = 13 17 | end 18 | -------------------------------------------------------------------------------- /Delphi/CreatePagesPreviewCtl/Unit2.pas: -------------------------------------------------------------------------------- 1 | unit Unit2; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, PDFXEdit_TLB, ActiveX; 8 | 9 | type 10 | TForm2 = class(TForm) 11 | procedure FormResize(Sender: TObject); 12 | private 13 | FInst: IPXV_Inst; 14 | FDoc: IPXC_Document; 15 | public 16 | { Public declarations } 17 | ppc : IPXV_PagesPreviewCtl; 18 | container : IUIX_Obj; 19 | 20 | procedure LoadInst(inst: IPXV_Inst; InstUIX: IUIX_Inst); 21 | procedure OpenDocument(fileName: string); overload; 22 | procedure OpenDocument(doc: IPXC_Document); overload; 23 | end; 24 | 25 | var 26 | Form2: TForm2; 27 | 28 | implementation 29 | 30 | {$R *.dfm} 31 | 32 | procedure TForm2.loadinst(inst: IPXV_Inst; InstUIX: IUIX_Inst); 33 | var 34 | cop : UIX_CreateObjParams; 35 | rc: tagRECT; 36 | begin 37 | FInst := inst; 38 | rc.left := ClientRect.Left; 39 | rc.right := ClientRect.Right; 40 | rc.top := ClientRect.Top; 41 | rc.bottom := ClientRect.Bottom; 42 | 43 | ZeroMemory(@cop, SizeOf(UIX_CreateObjParams)); 44 | cop.hWndParent := Handle; 45 | cop.nStdClass := UIX_StdClass_Blank; 46 | //cop.nCreateFlags := UIX_CreateObj_Windowed; 47 | //cop.nWndStyle := WS_CHILD OR WS_CLIPCHILDREN OR WS_CLIPSIBLINGS; 48 | cop.rc := rc; 49 | 50 | container := InstUIX.CreateObj(cop); 51 | ppc := Inst.CreatePagesPreviewCtl(container, rc, 'preview', 52 | PXV_PagesPreviewStyle_NoHandTool or PXV_PagesPreviewStyle_NonInertialHand or PXV_PagesPreviewStyle_InteractiveLayout, 53 | UIX_ScrollStyle_Horz or UIX_ScrollStyle_Vert, false); 54 | end; 55 | 56 | procedure TForm2.OpenDocument(doc: IPXC_Document); 57 | begin 58 | ppc.Doc := doc; 59 | end; 60 | 61 | procedure TForm2.OpenDocument(fileName: string); 62 | var 63 | nID: Integer; 64 | Op: IOperation; 65 | fsInst: IAFS_Inst; 66 | begin 67 | nID := FInst.Str2ID('op.openDoc', false); 68 | Op := FInst.CreateOp(nID); 69 | fsInst := FInst.GetExtension('AFS') as IAFS_Inst; 70 | Op.Params.Root['Input'].v := fsInst.DefaultFileSys.StringToName(PWChar(fileName), 0, nil); 71 | Op.Params.Root['Options.NativeOnly'].v := true; 72 | Op.Do_(0); 73 | 74 | if (FDoc <> nil) then 75 | begin 76 | FDoc.Close(0); 77 | FDoc := nil; 78 | end; 79 | 80 | FDoc := Op.Params.Root['Output'].Unknown as IPXC_Document; 81 | OpenDocument(FDoc); 82 | end; 83 | 84 | procedure TForm2.FormResize(Sender: TObject); 85 | var 86 | rc: tagRECT; 87 | begin 88 | rc.left := ClientRect.Left; 89 | rc.right := ClientRect.Right; 90 | rc.top := ClientRect.Top; 91 | rc.bottom := ClientRect.Bottom; 92 | if ppc <> nil then 93 | begin 94 | container.Set_Rect(@rc); 95 | ppc.Obj.Parent.Set_Rect(@rc); 96 | end; 97 | end; 98 | 99 | 100 | 101 | end. 102 | -------------------------------------------------------------------------------- /Delphi/CreatePagesPreviewCtl/uMain.dfm: -------------------------------------------------------------------------------- 1 | object frmMain: TfrmMain 2 | Left = 0 3 | Top = 0 4 | Caption = 'frmMain' 5 | ClientHeight = 361 6 | ClientWidth = 537 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -11 11 | Font.Name = 'Tahoma' 12 | Font.Style = [] 13 | OldCreateOrder = False 14 | OnCreate = FormCreate 15 | OnDestroy = FormDestroy 16 | PixelsPerInch = 96 17 | TextHeight = 13 18 | object Button1: TButton 19 | Left = 8 20 | Top = 8 21 | Width = 75 22 | Height = 25 23 | Caption = 'Button1' 24 | TabOrder = 0 25 | OnClick = Button1Click 26 | end 27 | object FileOpenDialog1: TFileOpenDialog 28 | FavoriteLinks = <> 29 | FileTypes = <> 30 | Options = [] 31 | Left = 56 32 | Top = 88 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /Delphi/CreatePagesPreviewCtl/uMain.pas: -------------------------------------------------------------------------------- 1 | unit uMain; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, PDFXEdit_TLB, ActiveX, Vcl.StdCtrls; 8 | 9 | type 10 | TfrmMain = class(TForm) 11 | Button1: TButton; 12 | FileOpenDialog1: TFileOpenDialog; 13 | procedure FormCreate(Sender: TObject); 14 | procedure FormDestroy(Sender: TObject); 15 | procedure Button1Click(Sender: TObject); 16 | private 17 | Inst: PXV_Inst; 18 | InstUIX: IUIX_Inst; 19 | //InstAUX: IAUX_Inst; 20 | public 21 | { Public declarations } 22 | end; 23 | 24 | var 25 | frmMain: tfrmmain; 26 | 27 | implementation 28 | 29 | {$R *.dfm} 30 | 31 | uses Unit2; 32 | 33 | procedure TfrmMain.Button1Click(Sender: TObject); 34 | var 35 | f2 : TForm2; 36 | begin 37 | if (FileOpenDialog1.Execute) then 38 | begin 39 | f2 := TForm2.Create(Application); 40 | f2.LoadInst(Inst, InstUIX); 41 | f2.OpenDocument(FileOpenDialog1.FileName); 42 | f2.Show; 43 | end; 44 | end; 45 | 46 | procedure TfrmMain.FormCreate(Sender: TObject); 47 | begin 48 | Inst := CoPXV_Inst.Create(); 49 | Inst.Init(nil, '', nil, nil, nil, 0, nil); 50 | InstUIX := Inst.GetExtension('UIX')as IUIX_Inst; 51 | end; 52 | 53 | procedure TfrmMain.FormDestroy(Sender: TObject); 54 | begin 55 | InstUIX := nil; 56 | Inst.Shutdown(0); 57 | end; 58 | 59 | end. 60 | -------------------------------------------------------------------------------- /Delphi/SampleCreatePXVInst/SampleCreatePXVInst.dpr: -------------------------------------------------------------------------------- 1 | program SampleCreatePXVInst; 2 | 3 | uses 4 | Vcl.Forms, 5 | SampleMain in 'SampleMain.pas' {Form1}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TForm1, Form1); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Delphi/SampleCreatePXVInst/SampleCreatePXVInst.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/Delphi/SampleCreatePXVInst/SampleCreatePXVInst.res -------------------------------------------------------------------------------- /Delphi/SampleCreatePXVInst/SampleMain.dfm: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 0 3 | Top = 0 4 | Caption = 'Form1' 5 | ClientHeight = 361 6 | ClientWidth = 537 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -11 11 | Font.Name = 'Tahoma' 12 | Font.Style = [] 13 | OldCreateOrder = False 14 | OnCreate = FormCreate 15 | OnDestroy = FormDestroy 16 | PixelsPerInch = 96 17 | TextHeight = 13 18 | object Label1: TLabel 19 | Left = 160 20 | Top = 56 21 | Width = 177 22 | Height = 97 23 | Caption = 'Label1' 24 | Font.Charset = DEFAULT_CHARSET 25 | Font.Color = clWindowText 26 | Font.Height = -21 27 | Font.Name = 'Tahoma' 28 | Font.Style = [] 29 | ParentFont = False 30 | end 31 | end 32 | -------------------------------------------------------------------------------- /Delphi/SampleCreatePXVInst/SampleMain.pas: -------------------------------------------------------------------------------- 1 | unit SampleMain; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, PDFXEdit_TLB, Vcl.StdCtrls, ActiveX; 8 | 9 | type 10 | TForm1 = class(TForm) 11 | Label1: TLabel; 12 | procedure FormCreate(Sender: TObject); 13 | procedure FormDestroy(Sender: TObject); 14 | private 15 | { Private declarations } 16 | FInst: PDFXEdit_TLB.IPXV_Inst; 17 | public 18 | { Public declarations } 19 | end; 20 | 21 | var 22 | Form1: TForm1; 23 | 24 | implementation 25 | 26 | {$R *.dfm} 27 | 28 | { TForm1 } 29 | 30 | 31 | 32 | procedure TForm1.FormCreate(Sender: TObject); 33 | begin 34 | FInst := CoPXV_Inst.Create(); 35 | ////uses PDFXEdit_TLB 36 | FInst.Init(nil, '', nil, nil, nil, 0, nil); 37 | //uses ActiveX 38 | //CoCreateInstance(CLASS_PXV_Inst, nil, CLSCTX_INPROC_SERVER, IPXV_Inst, FInst); 39 | Label1.Caption := FInst.GetLocalStr2(42); 40 | end; 41 | 42 | procedure TForm1.FormDestroy(Sender: TObject); 43 | begin 44 | FInst.Shutdown(0); 45 | end; 46 | 47 | end. 48 | -------------------------------------------------------------------------------- /Delphi/SamplePDFEdit/SamplePDFEdit.dpr: -------------------------------------------------------------------------------- 1 | program SamplePDFEdit; 2 | 3 | uses 4 | Vcl.Forms, 5 | untMain in 'untMain.pas' {Form1}, 6 | PDFInst in 'PDFInst.pas', 7 | about in 'about.pas' {AboutBox}; 8 | 9 | {$R *.res} 10 | 11 | 12 | begin 13 | Application.Initialize; 14 | Application.MainFormOnTaskbar := True; 15 | Application.CreateForm(TForm1, Form1); 16 | Application.CreateForm(TAboutBox, AboutBox); 17 | Application.Run; 18 | end. 19 | -------------------------------------------------------------------------------- /Delphi/SamplePDFEdit/SamplePDFEdit.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/Delphi/SamplePDFEdit/SamplePDFEdit.res -------------------------------------------------------------------------------- /Delphi/SamplePDFEdit/about.dfm: -------------------------------------------------------------------------------- 1 | object AboutBox: TAboutBox 2 | Left = 200 3 | Top = 108 4 | BorderStyle = bsDialog 5 | Caption = 'About' 6 | ClientHeight = 213 7 | ClientWidth = 298 8 | Color = clBtnFace 9 | Font.Charset = DEFAULT_CHARSET 10 | Font.Color = clWindowText 11 | Font.Height = -11 12 | Font.Name = 'MS Sans Serif' 13 | Font.Style = [] 14 | OldCreateOrder = True 15 | Position = poMainFormCenter 16 | PixelsPerInch = 96 17 | TextHeight = 13 18 | object Panel1: TPanel 19 | Left = 8 20 | Top = 8 21 | Width = 281 22 | Height = 161 23 | BevelInner = bvRaised 24 | BevelOuter = bvLowered 25 | ParentColor = True 26 | TabOrder = 0 27 | object ProgramIcon: TImage 28 | Left = 8 29 | Top = 8 30 | Width = 65 31 | Height = 57 32 | Picture.Data = { 33 | 07544269746D617076020000424D760200000000000076000000280000002000 34 | 0000200000000100040000000000000200000000000000000000100000000000 35 | 000000000000000080000080000000808000800000008000800080800000C0C0 36 | C000808080000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF 37 | FF00000000000000000000000000000000000EE8787878EEEEEEE03F30878EEE 38 | EEE00EE8787878EEEEEEE03F30878EEEEEE00EE8787878EEEEEEE03F30878EEE 39 | EEE00EE8787878EEEEEEE03F30878EEEEEE00887787877788888803F3088787E 40 | EEE00788787878878887803F3088887EEEE00788887888878887803F3088887E 41 | EEE00877888887788888703F308887EEEEE00888777778888888037883088888 42 | 8EE007777777777777703787883087777EE00888888888888803787FF8830888 43 | 888008888888888880378777778830888880077777777788037873F3F3F87808 44 | 88E00888888888803787FFFFFFFF8830EEE00887777778800001111111111100 45 | EEE00888888888888899B999B99999EEEEE00888888888888899B9B99BB9B9EE 46 | EEE0088888888888899BB9BB99BB99EEEEE0078888888888899B999B999999EE 47 | EEE0087788888778899B9B9BB9BB99EEEEE00888778778888E9B9B9BB9999EEE 48 | EEE0088888788888EE9B99B9BB9BEEEEEEE00EE8888888EEEEE999B9999EEEEE 49 | EEE00EEEE888EEEEEEEE99BB999EEEEEEEE00EEEEE8EEEEEEEEEE999B9EEEEEE 50 | EEE00EEEEE8EEEEEEEEEEEE999EEEEEEEEE00EEEEE8EEEEEEEEEEEEE99EEEEEE 51 | EEE00EEEEE8EEEEEEEEEEEEE9EEEEEEEEEE00EEEEE8EEEEEEEEEEEEEEEEEEEEE 52 | EEE00EEEEEEEEEEEEEEEEEEEEEEEEEEEEEE00000000000000000000000000000 53 | 0000} 54 | Stretch = True 55 | IsControl = True 56 | end 57 | object ProductName: TLabel 58 | Left = 88 59 | Top = 16 60 | Width = 177 61 | Height = 13 62 | Caption = 'Sample PDFEdit' 63 | IsControl = True 64 | end 65 | object Version: TLabel 66 | Left = 88 67 | Top = 40 68 | Width = 24 69 | Height = 13 70 | Caption = '1.0.0' 71 | IsControl = True 72 | end 73 | object Copyright: TLabel 74 | Left = 8 75 | Top = 80 76 | Width = 71 77 | Height = 13 78 | Caption = 'Copyright 2016' 79 | IsControl = True 80 | end 81 | object Comments: TLabel 82 | Left = 8 83 | Top = 104 84 | Width = 257 85 | Height = 39 86 | Caption = 'Delphi Examples for PDF-XChangeEditCore SDK ' 87 | WordWrap = True 88 | IsControl = True 89 | end 90 | end 91 | object OKButton: TButton 92 | Left = 111 93 | Top = 180 94 | Width = 75 95 | Height = 25 96 | Caption = 'OK' 97 | Default = True 98 | ModalResult = 1 99 | TabOrder = 1 100 | OnClick = OKButtonClick 101 | end 102 | end 103 | -------------------------------------------------------------------------------- /Delphi/SamplePDFEdit/about.pas: -------------------------------------------------------------------------------- 1 | unit About; 2 | 3 | interface 4 | 5 | uses WinApi.Windows, System.SysUtils, System.Classes, Vcl.Graphics, 6 | Vcl.Forms, Vcl.Controls, Vcl.StdCtrls, Vcl.Buttons, Vcl.ExtCtrls; 7 | 8 | type 9 | TAboutBox = class(TForm) 10 | Panel1: TPanel; 11 | ProgramIcon: TImage; 12 | ProductName: TLabel; 13 | Version: TLabel; 14 | Copyright: TLabel; 15 | Comments: TLabel; 16 | OKButton: TButton; 17 | procedure OKButtonClick(Sender: TObject); 18 | private 19 | { Private declarations } 20 | public 21 | { Public declarations } 22 | end; 23 | 24 | var 25 | AboutBox: TAboutBox; 26 | 27 | implementation 28 | 29 | {$R *.dfm} 30 | 31 | procedure TAboutBox.OKButtonClick(Sender: TObject); 32 | begin 33 | Close; 34 | end; 35 | 36 | end. 37 | 38 | -------------------------------------------------------------------------------- /Delphi/SamplePDFEditGoto/Project1.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/Delphi/SamplePDFEditGoto/Project1.res -------------------------------------------------------------------------------- /Delphi/SamplePDFEditGoto/SamplePDFEditGoto.dpr: -------------------------------------------------------------------------------- 1 | program SamplePDFEditGoto; 2 | 3 | uses 4 | Vcl.Forms, 5 | Unit1 in 'Unit1.pas' {Form1}; 6 | 7 | {$R *.res} 8 | 9 | begin 10 | Application.Initialize; 11 | Application.MainFormOnTaskbar := True; 12 | Application.CreateForm(TForm1, Form1); 13 | Application.Run; 14 | end. 15 | -------------------------------------------------------------------------------- /Delphi/SamplePDFEditGoto/SamplePDFEditGoto.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdf-xchange/PDFEditorSDKExamples/22e452a335ca35ce53203b1dcd05801e1cc7695f/Delphi/SamplePDFEditGoto/SamplePDFEditGoto.res -------------------------------------------------------------------------------- /Delphi/SamplePDFEditGoto/Unit1.dfm: -------------------------------------------------------------------------------- 1 | object Form1: TForm1 2 | Left = 0 3 | Top = 0 4 | Caption = 'Form1' 5 | ClientHeight = 360 6 | ClientWidth = 582 7 | Color = clBtnFace 8 | Font.Charset = DEFAULT_CHARSET 9 | Font.Color = clWindowText 10 | Font.Height = -11 11 | Font.Name = 'Tahoma' 12 | Font.Style = [] 13 | OldCreateOrder = False 14 | PixelsPerInch = 96 15 | TextHeight = 13 16 | object ToolBar1: TToolBar 17 | Left = 0 18 | Top = 0 19 | Width = 582 20 | Height = 29 21 | ButtonHeight = 21 22 | ButtonWidth = 52 23 | Caption = 'ToolBar1' 24 | ShowCaptions = True 25 | TabOrder = 0 26 | object ToolButton2: TToolButton 27 | Left = 0 28 | Top = 0 29 | Caption = 'Open File' 30 | ImageIndex = 1 31 | OnClick = ToolButton2Click 32 | end 33 | object ToolButton1: TToolButton 34 | Left = 52 35 | Top = 0 36 | Caption = 'Goto' 37 | ImageIndex = 0 38 | OnClick = ToolButton1Click 39 | end 40 | end 41 | object PXV_Control1: TPXV_Control 42 | Left = 0 43 | Top = 29 44 | Width = 582 45 | Height = 331 46 | Align = alClient 47 | TabOrder = 1 48 | ExplicitLeft = 120 49 | ExplicitTop = 112 50 | ExplicitWidth = 192 51 | ExplicitHeight = 192 52 | ControlData = { 53 | 000E0000273C0000362200000800000000001300000000000B00FFFF0B00FFFF 54 | 0B0000000B000000130003000000} 55 | end 56 | object FileOpenDialog1: TFileOpenDialog 57 | FavoriteLinks = <> 58 | FileTypes = <> 59 | Options = [] 60 | Left = 24 61 | Top = 56 62 | end 63 | end 64 | -------------------------------------------------------------------------------- /Delphi/SamplePDFEditGoto/Unit1.pas: -------------------------------------------------------------------------------- 1 | unit Unit1; 2 | 3 | interface 4 | 5 | uses 6 | Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, 7 | Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.ToolWin, Vcl.OleCtrls, 8 | PDFXEdit_TLB; 9 | 10 | type 11 | TForm1 = class(TForm) 12 | ToolBar1: TToolBar; 13 | ToolButton1: TToolButton; 14 | ToolButton2: TToolButton; 15 | FileOpenDialog1: TFileOpenDialog; 16 | PXV_Control1: TPXV_Control; 17 | procedure ToolButton2Click(Sender: TObject); 18 | procedure ToolButton1Click(Sender: TObject); 19 | private 20 | { Private declarations } 21 | public 22 | { Public declarations } 23 | end; 24 | 25 | var 26 | Form1: TForm1; 27 | 28 | implementation 29 | 30 | {$R *.dfm} 31 | 32 | procedure TForm1.ToolButton1Click(Sender: TObject); 33 | const 34 | nPageNumber = 1; 35 | var 36 | APage: IPXC_Page; 37 | rc: PXC_Rect; 38 | dest: PXC_Destination; 39 | begin 40 | PXV_Control1.Doc.CoreDoc.Pages.Get_Item(nPageNumber, APage); 41 | APage.Get_Box(PDFXEdit_TLB.PBox_PageBox, rc); 42 | dest.nType := PDFXEdit_TLB.Dest_XYZ; 43 | dest.dValues[0] := rc.left + 10; 44 | dest.dValues[1] := rc.top - 100; 45 | dest.nNullFlags := 12; 46 | dest.nPageNum := nPageNumber; 47 | PXV_Control1.GoToDestination(dest, nPageNumber); 48 | end; 49 | 50 | procedure TForm1.ToolButton2Click(Sender: TObject); 51 | var 52 | i: integer; 53 | begin 54 | if (FileOpenDialog1.Execute) then 55 | Begin 56 | for i := 0 to FileOpenDialog1.Files.Count - 1 do 57 | PXV_Control1.OpenDocFromPath(FileOpenDialog1.Files[i], nil); 58 | End; 59 | end; 60 | 61 | end. 62 | -------------------------------------------------------------------------------- /Java/PDFEditSDKSimple/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Java/PDFEditSDKSimple/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | PDFEditSDKSimple 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /Java/PDFEditSDKSimple/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: PDFEditSDK-Java 4 | Bundle-SymbolicName: PDFEditSDKSimple 5 | Bundle-Version: 1.0.0.qualifier 6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 7 | -------------------------------------------------------------------------------- /Java/PDFEditSDKSimple/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = plugin.xml,\ 4 | META-INF/,\ 5 | . 6 | -------------------------------------------------------------------------------- /Java/PDFEditSDKSimple/src/PDFEditSDKSimple.java: -------------------------------------------------------------------------------- 1 | 2 | import org.eclipse.swt.SWT; 3 | import org.eclipse.swt.layout.FillLayout; 4 | import org.eclipse.swt.ole.win32.OLE; 5 | import org.eclipse.swt.ole.win32.OleAutomation; 6 | import org.eclipse.swt.ole.win32.OleControlSite; 7 | import org.eclipse.swt.ole.win32.OleFrame; 8 | import org.eclipse.swt.ole.win32.Variant; 9 | import org.eclipse.swt.widgets.Display; 10 | import org.eclipse.swt.widgets.Shell; 11 | 12 | public class PDFEditSDKSimple { 13 | 14 | public static void main(String[] args) { 15 | final Display display = new Display(); 16 | Shell shell = new Shell(display); 17 | shell.setSize(600, 400); 18 | shell.setLayout(new FillLayout()); 19 | 20 | OleControlSite oleControlSite; 21 | OleFrame oleFrame = new OleFrame(shell, SWT.NONE); 22 | 23 | oleControlSite = new OleControlSite(oleFrame, SWT.NONE, "PDFXEdit.PXV_Control.1"); 24 | oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE); 25 | shell.open(); 26 | 27 | OleAutomation viewer = new OleAutomation(oleControlSite); 28 | 29 | try { 30 | // prepare parameters Inst 31 | int[] opPropIDs = viewer.getIDsOfNames(new String[] {"Inst"}); 32 | Variant resInst = viewer.getProperty(opPropIDs[0]); 33 | OleAutomation gInst = resInst.getAutomation(); 34 | // prepare parameters CreateOpenDocParams 35 | int[] opInstIDs = gInst.getIDsOfNames(new String[] {"CreateOpenDocParams"}); 36 | Variant resCab = gInst.invoke(opInstIDs[0]); 37 | OleAutomation cab1 = resCab.getAutomation(); 38 | // lookup method to open document --> returns null, no such method can be found 39 | int[] opIDs = viewer.getIDsOfNames(new String[] { "OpenDocFromPath", "sSrcPath", "pOpenParams"}); 40 | // prepare parameters 41 | Variant[] address = new Variant[] { new Variant("http://www.dpconline.org/docs/reports/dpctw08-02.pdf"), new Variant(cab1)}; 42 | // invoke method 43 | viewer.invoke(opIDs[0], address, new int[] { opIDs[1], opIDs[2] }); 44 | 45 | /* int[] opIDs = viewer.getIDsOfNames(new String[] { "CreateNewBlankDoc", "nPageWidth", "nPageHeight", "nPagesCount", "nPageRotation"}); 46 | // prepare parameters 47 | Variant[] address = new Variant[] { new Variant((double)600.0), new Variant((double)800.0), new Variant((long)2), new Variant((long)0)}; 48 | // invoke method 49 | //Variant res = viewer.invoke(opIDs[0], address, new int[] { opIDs[1], opIDs[2], opIDs[3], opIDs[4]}); 50 | Variant res = viewer.invoke(opIDs[0], address); 51 | */ 52 | System.out.println(viewer.getName(opIDs[0])); 53 | System.out.println(viewer.getLastError()); 54 | System.out.println("Hello, World!"); 55 | } 56 | catch(Exception e) 57 | { 58 | System.out.println("eRROR"); 59 | } 60 | 61 | while (!shell.isDisposed()) { 62 | if (!display.readAndDispatch()) 63 | display.sleep(); 64 | } 65 | viewer.dispose(); 66 | display.dispose(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /PDFEditorSDKExamples.x64/README.md: -------------------------------------------------------------------------------- 1 | # PDFCoreSDKExamples 2 | Examples for PDF-XChange Editor SDK 3 | 4 | Directoru output x64 build file -------------------------------------------------------------------------------- /PDFEditorSDKExamples.x86/README.md: -------------------------------------------------------------------------------- 1 | # PDFCoreSDKExamples 2 | Examples for PDF-XChange Editor SDK 3 | 4 | Directoru output x86 build file -------------------------------------------------------------------------------- /Python/DemoApp/DemoApp.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | import comtypes 4 | from ctypes import c_ulong, byref 5 | from comtypes.client import GetModule, CreateObject 6 | path = os.environ['PXCE_BIN32D_PATH'] 7 | # pathDLL = path + "\\PDFXEditCore.x86.dll" 8 | # generate wrapper code for the type library, this needs 9 | # to be done only once (but also each time the IDL file changes) 10 | GetModule(path + "\\PDFXEditCore.x86.dll"); 11 | 12 | import comtypes.gen.PDFXEdit as PDFXEdit 13 | 14 | g_Inst = CreateObject("PDFXEdit.PXV_Inst", None, None, PDFXEdit.IPXV_Inst) 15 | g_Inst.Init(None, "Key", None, None, None, 0, None); 16 | g_Inst.StartLoadingPlugins(); 17 | g_Inst.AddPluginFromFile(path + "\\Plugins.x86\\ConvertPDF.pvp"); 18 | g_Inst.FinishLoadingPlugins(); 19 | 20 | pxcInst = g_Inst.GetExtension("PXC").QueryInterface(PDFXEdit.IPXC_Inst); 21 | afsInst = g_Inst.GetExtension("AFS").QueryInterface(PDFXEdit.IAFS_Inst); 22 | pDoc = None; 23 | try: 24 | cnv = None; 25 | for i in range(0, g_Inst.ExportConvertersCount): 26 | if (g_Inst.ExportConverter[i].ID == "conv.exp.office.docx"): 27 | cnv = g_Inst.ExportConverter[i]; 28 | 29 | pDoc = pxcInst.OpenDocumentFromFile ("D:\\README11.pdf", None, None, 0, 0); 30 | 31 | fs = afsInst.DefaultFileSys; 32 | pName = fs.StringToName("D:\\TestFile_res.docx", 0, None); 33 | fileNew = fs.OpenFile(pName, PDFXEdit.AFS_OpenFile_CreateAlways| PDFXEdit.AFS_OpenFile_Read | PDFXEdit.AFS_OpenFile_ShareRead, None, None); 34 | cabNew = g_Inst.GetFormatConverterParams(False, u"conv.exp.office.docx"); 35 | cnv.Convert(g_Inst, pDoc, fileNew, 0, cabNew, None, 0, None, None); 36 | except comtypes.COMError as e: 37 | print(e.text) 38 | pDoc.Close() 39 | g_Inst.Shutdown(0) 40 | -------------------------------------------------------------------------------- /Python/DemoApp/DemoApp.pyproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | 2.0 6 | 1b2c7682-e220-472c-b741-bd71a4743a4c 7 | . 8 | DemoApp.py 9 | 10 | 11 | . 12 | . 13 | DemoApp 14 | DemoApp 15 | 16 | 17 | true 18 | false 19 | 20 | 21 | true 22 | false 23 | 24 | 25 | 26 | 27 | 28 | 10.0 29 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Python/DemoApp/DemoApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "DemoApp", "DemoApp.pyproj", "{1B2C7682-E220-472C-B741-BD71A4743A4C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {1B2C7682-E220-472C-B741-BD71A4743A4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {1B2C7682-E220-472C-B741-BD71A4743A4C}.Release|Any CPU.ActiveCfg = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PDFEditorSDKExamples 2 | Examples for PDF-XChange Editor SDK 3 | 4 | To make the sample working do the following steps: 5 | 6 | 1. Download and install [PDF-XChange Editor Simple SDK](http://www.tracker-software.com/product/pdf-xchange-editor-simple-sdk) 7 | 2. Try to build this solution so that the Build directory will be generated. 8 | 3. Copy the PDFXEditSimple.x64.dll and PDFXEditSimple.x86.dll from where the PDF-XChange Editor Simple SDK was installed into the project Build directory (i.e. bin where the exe file lies). 9 | 4. Launch the application again 10 | -------------------------------------------------------------------------------- /WebExamples/ASPNETbasic/Default.aspx: -------------------------------------------------------------------------------- 1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 44 | 45 | 46 |
47 |
48 | 50 | 52 | 54 |
56 | 57 |
58 |
59 | 60 | 61 | -------------------------------------------------------------------------------- /WebExamples/ASPNETbasic/Default.aspx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.UI; 6 | using System.Web.UI.WebControls; 7 | 8 | namespace WebApplication1 9 | { 10 | public partial class _Default : System.Web.UI.Page 11 | { 12 | protected void Page_Load(object sender, EventArgs e) 13 | { 14 | 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /WebExamples/ASPNETbasic/Default.aspx.designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // 5 | // Changes to this file may cause incorrect behavior and will be lost if 6 | // the code is regenerated. 7 | // 8 | //------------------------------------------------------------------------------ 9 | 10 | namespace WebApplication1 { 11 | 12 | 13 | public partial class _Default { 14 | 15 | /// 16 | /// form1 control. 17 | /// 18 | /// 19 | /// Auto-generated field. 20 | /// To modify move field declaration from designer file to code-behind file. 21 | /// 22 | protected global::System.Web.UI.HtmlControls.HtmlForm form1; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /WebExamples/ASPNETbasic/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("WebApplication1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WebApplication1")] 13 | [assembly: AssemblyCopyright("Copyright © 2009")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /WebExamples/ASPNETbasic/WebApplication1.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication1", "WebApplication1.csproj", "{60C13CAA-A67E-4E38-8B09-87476F83B604}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {60C13CAA-A67E-4E38-8B09-87476F83B604}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {60C13CAA-A67E-4E38-8B09-87476F83B604}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {60C13CAA-A67E-4E38-8B09-87476F83B604}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {60C13CAA-A67E-4E38-8B09-87476F83B604}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /WebExamples/HTML_JavaScript/PDFXChangeViewer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | PDF-XChange Viewer ActiveX test 4 | 44 | 45 | 46 | 47 |

48 | 49 | 50 | 51 | 52 |

53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /cpp/QTFullDemo/QTFullDemo.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-12-22T21:15:16 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui axcontainer 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = QTFullDemo 12 | TEMPLATE = app 13 | 14 | # The following define makes your compiler emit warnings if you use 15 | # any feature of Qt which has been marked as deprecated (the exact warnings 16 | # depend on your compiler). Please consult the documentation of the 17 | # deprecated API in order to know how to port your code away from it. 18 | DEFINES += QT_DEPRECATED_WARNINGS 19 | 20 | # You can also make your code fail to compile if you use deprecated APIs. 21 | # In order to do so, uncomment the following line. 22 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 23 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 24 | 25 | 26 | SOURCES += \ 27 | main.cpp \ 28 | mainwindow.cpp 29 | 30 | HEADERS += \ 31 | mainwindow.h 32 | 33 | FORMS += \ 34 | mainwindow.ui 35 | -------------------------------------------------------------------------------- /cpp/QTFullDemo/main.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | MainWindow w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /cpp/QTFullDemo/mainwindow.cpp: -------------------------------------------------------------------------------- 1 | #include "mainwindow.h" 2 | #include "ui_mainwindow.h" 3 | 4 | MainWindow::MainWindow(QWidget *parent) : 5 | QMainWindow(parent), 6 | ui(new Ui::MainWindow) 7 | { 8 | ui->setupUi(this); 9 | } 10 | 11 | MainWindow::~MainWindow() 12 | { 13 | delete ui; 14 | } 15 | -------------------------------------------------------------------------------- /cpp/QTFullDemo/mainwindow.h: -------------------------------------------------------------------------------- 1 | #ifndef MAINWINDOW_H 2 | #define MAINWINDOW_H 3 | 4 | #if defined _M_X64 5 | #define Api_File "PDFXEditCore.x64.dll" 6 | #else 7 | #define Api_File "PDFXEditCore.x86.dll" 8 | #endif 9 | 10 | #pragma warning(push) 11 | #pragma warning(disable:4192 4278) 12 | #import Api_File rename_namespace("PXV"), raw_interfaces_only, exclude("LONG_PTR", "ULONG_PTR", "UINT_PTR") 13 | #pragma warning(pop) 14 | 15 | #include 16 | 17 | namespace Ui { 18 | class MainWindow; 19 | } 20 | 21 | class MainWindow : public QMainWindow 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | explicit MainWindow(QWidget *parent = 0); 27 | ~MainWindow(); 28 | 29 | private: 30 | Ui::MainWindow *ui; 31 | }; 32 | 33 | #endif // MAINWINDOW_H 34 | -------------------------------------------------------------------------------- /tempbuild/README.md: -------------------------------------------------------------------------------- 1 | # PDFCoreSDKExamples 2 | Examples for PDF-XChange Editor SDK 3 | 4 | Directoru output temp files --------------------------------------------------------------------------------