diff --git a/root/cli/CSRender/CSRender.cs b/root/cli/CSRender/CSRender.cs
index f4e87326ea715d11f28e0fb84441fb0fa1a63657..d3bd85c6f1e43e4ff4d43737b4c43c622d90f653 100644
--- a/root/cli/CSRender/CSRender.cs
+++ b/root/cli/CSRender/CSRender.cs
@@ -188,7 +188,8 @@ namespace CSRender {
var format = System.Drawing.Imaging.PixelFormat.Format24bppRgb;
var clonebitmap = bitmap.Clone(cloneRect, format);
//
- //bitmap.Dispose();
+ // オリジナルbitmapの解放 S.Hishi 2023/08/22
+ bitmap.Dispose();
return clonebitmap;
/*
保存時にBitmapのクローンを作成し、その際のBitmapの形式に24bitRGB(PixelFormat.Format24bppRgb)を
@@ -227,7 +228,8 @@ namespace CSRender {
pm = new RenderConditionParams();
using (var memStrm = new MemoryStream()) {
- PdfRenderFlags flg = (PdfRenderFlags.ForPrinting | PdfRenderFlags.CorrectFromDpi);
+ // PdfRenderFlags.LimitImageCacheSizeの追加 S.Hihsi 2023/08/22
+ PdfRenderFlags flg = (PdfRenderFlags.ForPrinting | PdfRenderFlags.CorrectFromDpi| PdfRenderFlags.LimitImageCacheSize);
using(var img = RenderRgbBitMap(docG, index, (float)pm.Dpi, (float)pm.Dpi, flg) ){
img.Save(memStrm, System.Drawing.Imaging.ImageFormat.Bmp);
/*
@@ -508,7 +510,8 @@ namespace CSRender {
var bThDump = Check.bThDump;
if (pm == null)
pm = new RenderConditionParams();
- PdfRenderFlags flg = (PdfRenderFlags.ForPrinting | PdfRenderFlags.CorrectFromDpi);
+ // PdfRenderFlags.LimitImageCacheSizeの追加 S.Hishi 2023/08/22
+ PdfRenderFlags flg = (PdfRenderFlags.ForPrinting | PdfRenderFlags.CorrectFromDpi | PdfRenderFlags.LimitImageCacheSize);
System.Drawing.Image img =RenderRgbBitMap(docG, index, (float)pm.Dpi, (float)pm.Dpi, flg);
img.Save(memStrm, System.Drawing.Imaging.ImageFormat.Bmp);
//img.Save(memStrm, System.Drawing.Imaging.ImageFormat.Jpeg);
diff --git a/root/cli/CSRender/CSRender2019.csproj b/root/cli/CSRender/CSRender2019.csproj
index f35f288a5349c09e06aaba3010270d63c8305b16..0c8b97d594ed8232e86d016f514e0403e9b8141a 100644
--- a/root/cli/CSRender/CSRender2019.csproj
+++ b/root/cli/CSRender/CSRender2019.csproj
@@ -58,6 +58,10 @@
app.manifest
+
+ False
+ ..\PdfiumViewer-master\PdfiumViewer\bin\Release\PdfiumViewer.dll
+
@@ -107,12 +111,6 @@
10.0.19041.1
-
- 2.13.0
-
-
- 2018.4.8.256
-
5.0.0-preview.5.20278.1
diff --git a/root/cli/CSRender2019.sln b/root/cli/CSRender2019.sln
index 9259ae92e6386ddfd17bbc9856bf45453a5b8d0a..3d24d0805af793f2a638e1022bb78cf414ae11f8 100644
--- a/root/cli/CSRender2019.sln
+++ b/root/cli/CSRender2019.sln
@@ -1,9 +1,14 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
-VisualStudioVersion = 16.0.31613.86
+VisualStudioVersion = 16.0.33927.289
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSRender2019", "CSRender\CSRender2019.csproj", "{FD99EFAA-2479-4E3B-BD1A-5B785288E3B3}"
+ ProjectSection(ProjectDependencies) = postProject
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F} = {438914B6-5D1C-482C-B942-5C0E057EEF6F}
+ EndProjectSection
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PdfiumViewer", "PdfiumViewer-master\PdfiumViewer\PdfiumViewer.csproj", "{438914B6-5D1C-482C-B942-5C0E057EEF6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,11 +20,15 @@ Global
{FD99EFAA-2479-4E3B-BD1A-5B785288E3B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD99EFAA-2479-4E3B-BD1A-5B785288E3B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD99EFAA-2479-4E3B-BD1A-5B785288E3B3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {8B1418EB-CA5D-4F34-9026-020B0B30AE79}
+ SolutionGuid = {5A59DF7F-F182-4DB6-B2F9-60DD07DBE657}
EndGlobalSection
EndGlobal
diff --git a/root/cli/PdfiumViewer-master/Contrib/pdfiumviewer.cpp b/root/cli/PdfiumViewer-master/Contrib/pdfiumviewer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c137607cf1b73eca1e988a3b0068137d4b4ecef1
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/Contrib/pdfiumviewer.cpp
@@ -0,0 +1,102 @@
+// Copyright (c) 2015 Pieter van Ginkel. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "public/fpdfview.h"
+#if PDF_ENABLE_V8
+#include "v8/include/v8.h"
+#include "v8/include/libplatform/libplatform.h"
+#endif // PDF_ENABLE_V8
+
+extern "C"
+{
+ DLLEXPORT void STDCALL FPDF_AddRef();
+ DLLEXPORT void STDCALL FPDF_Release();
+}
+
+class RefCounter
+{
+private:
+ CRITICAL_SECTION cs;
+ int refCount;
+#if PDF_ENABLE_V8
+ v8::Platform* platform;
+#endif // PDF_ENABLE_V8
+
+public:
+ RefCounter()
+ {
+ ::InitializeCriticalSection(&cs);
+ refCount = 0;
+#if PDF_ENABLE_V8
+ platform = NULL;
+#endif // PDF_ENABLE_V8
+ }
+
+ ~RefCounter()
+ {
+ ::DeleteCriticalSection(&cs);
+ }
+
+ void Enter()
+ {
+ ::EnterCriticalSection(&cs);
+ }
+
+ void Leave()
+ {
+ ::LeaveCriticalSection(&cs);
+ }
+
+ void AddRef()
+ {
+ ::EnterCriticalSection(&cs);
+
+ if (refCount == 0)
+ {
+#if PDF_ENABLE_V8
+ v8::V8::InitializeICU();
+ platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(platform);
+ v8::V8::Initialize();
+#endif // PDF_ENABLE_V8
+
+ FPDF_InitLibrary();
+ }
+
+ refCount++;
+
+ ::LeaveCriticalSection(&cs);
+ }
+
+ void Release()
+ {
+ ::EnterCriticalSection(&cs);
+
+ refCount--;
+
+ if (refCount == 0)
+ {
+ FPDF_DestroyLibrary();
+#if PDF_ENABLE_V8
+ v8::V8::ShutdownPlatform();
+ delete platform;
+#endif // PDF_ENABLE_V8
+ }
+
+ ::LeaveCriticalSection(&cs);
+ }
+};
+
+static RefCounter refCounter;
+
+
+DLLEXPORT void STDCALL FPDF_AddRef()
+{
+ refCounter.AddRef();
+}
+
+DLLEXPORT void STDCALL FPDF_Release()
+{
+ refCounter.Release();
+}
diff --git a/root/cli/PdfiumViewer-master/LICENSE b/root/cli/PdfiumViewer-master/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..d645695673349e3947e8e5ae42332d0ac3164cd7
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/root/cli/PdfiumViewer-master/LICENSE PDFium b/root/cli/PdfiumViewer-master/LICENSE PDFium
new file mode 100644
index 0000000000000000000000000000000000000000..b534b725b461b000debbec5273e3a169018f4fbe
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/LICENSE PDFium
@@ -0,0 +1 @@
+See the PDFium License directory for the licenses associated with PDFium.
diff --git a/root/cli/PdfiumViewer-master/Libraries/NuGet/NuGet.exe b/root/cli/PdfiumViewer-master/Libraries/NuGet/NuGet.exe
new file mode 100644
index 0000000000000000000000000000000000000000..34ad49b494dd855dabf1b1cee5d3a8d51525d3b9
Binary files /dev/null and b/root/cli/PdfiumViewer-master/Libraries/NuGet/NuGet.exe differ
diff --git a/root/cli/PdfiumViewer-master/Libraries/Pdfium/README.md b/root/cli/PdfiumViewer-master/Libraries/Pdfium/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..32914658ac996f8f5947b2b3a97674e152470a02
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/Libraries/Pdfium/README.md
@@ -0,0 +1,3 @@
+The native PDFium libraries have been removed from this repository.
+Please see the [README](https://github.com/pvginkel/PdfiumViewer/blob/master/README.markdown)
+or the [PdfiumBuild](https://github.com/pvginkel/PdfiumBuild) for more information.
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PDFium License/LICENSE b/root/cli/PdfiumViewer-master/PDFium License/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..2cb7e358aecc415e9608191e1ba2b8a504aa1521
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PDFium License/LICENSE
@@ -0,0 +1,54 @@
+This license applies to all parts of V8 that are not externally
+maintained libraries. The externally maintained libraries used by V8
+are:
+
+ - PCRE test suite, located in
+ test/mjsunit/third_party/regexp-pcre.js. This is based on the
+ test suite from PCRE-7.3, which is copyrighted by the University
+ of Cambridge and Google, Inc. The copyright notice and license
+ are embedded in regexp-pcre.js.
+
+ - Layout tests, located in test/mjsunit/third_party. These are
+ based on layout tests from webkit.org which are copyrighted by
+ Apple Computer, Inc. and released under a 3-clause BSD license.
+
+ - Strongtalk assembler, the basis of the files assembler-arm-inl.h,
+ assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h,
+ assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h,
+ assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h,
+ assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h.
+ This code is copyrighted by Sun Microsystems Inc. and released
+ under a 3-clause BSD license.
+
+ - Valgrind client API header, located at third_party/valgrind/valgrind.h
+ This is release under the BSD license.
+
+These libraries have their own licenses; we recommend you read them,
+as their terms may differ from the terms below.
+
+Copyright 2014, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of Google Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/root/cli/PdfiumViewer-master/PDFium License/LICENSE.strongtalk b/root/cli/PdfiumViewer-master/PDFium License/LICENSE.strongtalk
new file mode 100644
index 0000000000000000000000000000000000000000..9bd62e4f231a357d47073bdece85373325dd732f
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PDFium License/LICENSE.strongtalk
@@ -0,0 +1,29 @@
+Copyright (c) 1994-2006 Sun Microsystems Inc.
+All Rights Reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+
+- Redistribution in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+- Neither the name of Sun Microsystems or the names of contributors may
+be used to endorse or promote products derived from this software without
+specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/root/cli/PdfiumViewer-master/PDFium License/LICENSE.v8 b/root/cli/PdfiumViewer-master/PDFium License/LICENSE.v8
new file mode 100644
index 0000000000000000000000000000000000000000..933718a9ef9dae4cb4afa56e490211760d8a949f
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PDFium License/LICENSE.v8
@@ -0,0 +1,26 @@
+Copyright 2006-2011, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of Google Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/root/cli/PdfiumViewer-master/PDFium License/LICENSE.valgrind b/root/cli/PdfiumViewer-master/PDFium License/LICENSE.valgrind
new file mode 100644
index 0000000000000000000000000000000000000000..fd8ebaf50992130504530eb002daad634f3125e8
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PDFium License/LICENSE.valgrind
@@ -0,0 +1,45 @@
+----------------------------------------------------------------
+
+Notice that the following BSD-style license applies to this one
+file (valgrind.h) only. The rest of Valgrind is licensed under the
+terms of the GNU General Public License, version 2, unless
+otherwise indicated. See the COPYING file in the source
+distribution for details.
+
+----------------------------------------------------------------
+
+This file is part of Valgrind, a dynamic binary instrumentation
+framework.
+
+Copyright (C) 2000-2007 Julian Seward. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product
+ documentation would be appreciated but is not required.
+
+3. Altered source versions must be plainly marked as such, and must
+ not be misrepresented as being the original software.
+
+4. The name of the author may not be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
+OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/root/cli/PdfiumViewer-master/Pack NuGet.bat b/root/cli/PdfiumViewer-master/Pack NuGet.bat
new file mode 100644
index 0000000000000000000000000000000000000000..0f9d0f71eb029a785a3fd5d1558d559d33fa2c77
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/Pack NuGet.bat
@@ -0,0 +1,10 @@
+@echo off
+
+pushd "%~dp0"
+
+cd PdfiumViewer
+..\Libraries\NuGet\NuGet.exe pack -Prop "configuration=release;platform=anycpu"
+
+pause
+
+popd
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/.gitignore b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..10714b4d2a33e9a66572c72605f0f48c187accae
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/.gitignore
@@ -0,0 +1,4 @@
+/*.suo
+/*.user
+/bin
+/obj
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/ExportBitmapsForm.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/ExportBitmapsForm.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..fd913e8e228d2c7838e353f08dcbc8bc570c8147
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/ExportBitmapsForm.Designer.cs
@@ -0,0 +1,128 @@
+namespace PdfiumViewer.Demo
+{
+ partial class ExportBitmapsForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this._dpiXTextBox = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this._dpiYTextBox = new System.Windows.Forms.TextBox();
+ this._acceptButton = new System.Windows.Forms.Button();
+ this._cancelButton = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 15);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(78, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Horizontal DPI:";
+ //
+ // _dpiXTextBox
+ //
+ this._dpiXTextBox.Location = new System.Drawing.Point(106, 12);
+ this._dpiXTextBox.Name = "_dpiXTextBox";
+ this._dpiXTextBox.Size = new System.Drawing.Size(240, 20);
+ this._dpiXTextBox.TabIndex = 1;
+ this._dpiXTextBox.Text = "96";
+ this._dpiXTextBox.TextChanged += new System.EventHandler(this._dpiX_TextChanged);
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(12, 41);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(66, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "Vertical DPI:";
+ //
+ // _dpiYTextBox
+ //
+ this._dpiYTextBox.Location = new System.Drawing.Point(106, 38);
+ this._dpiYTextBox.Name = "_dpiYTextBox";
+ this._dpiYTextBox.Size = new System.Drawing.Size(240, 20);
+ this._dpiYTextBox.TabIndex = 3;
+ this._dpiYTextBox.Text = "96";
+ this._dpiYTextBox.TextChanged += new System.EventHandler(this._dpiY_TextChanged);
+ //
+ // _acceptButton
+ //
+ this._acceptButton.Location = new System.Drawing.Point(190, 64);
+ this._acceptButton.Name = "_acceptButton";
+ this._acceptButton.Size = new System.Drawing.Size(75, 23);
+ this._acceptButton.TabIndex = 4;
+ this._acceptButton.Text = "OK";
+ this._acceptButton.UseVisualStyleBackColor = true;
+ this._acceptButton.Click += new System.EventHandler(this._acceptButton_Click);
+ //
+ // _cancelButton
+ //
+ this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this._cancelButton.Location = new System.Drawing.Point(271, 64);
+ this._cancelButton.Name = "_cancelButton";
+ this._cancelButton.Size = new System.Drawing.Size(75, 23);
+ this._cancelButton.TabIndex = 5;
+ this._cancelButton.Text = "Cancel";
+ this._cancelButton.UseVisualStyleBackColor = true;
+ //
+ // ExportBitmapsForm
+ //
+ this.AcceptButton = this._acceptButton;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this._cancelButton;
+ this.ClientSize = new System.Drawing.Size(358, 99);
+ this.Controls.Add(this._cancelButton);
+ this.Controls.Add(this._acceptButton);
+ this.Controls.Add(this._dpiYTextBox);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this._dpiXTextBox);
+ this.Controls.Add(this.label1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "ExportBitmapsForm";
+ this.ShowInTaskbar = false;
+ this.Text = "Export bitmaps";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox _dpiXTextBox;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox _dpiYTextBox;
+ private System.Windows.Forms.Button _acceptButton;
+ private System.Windows.Forms.Button _cancelButton;
+ }
+}
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/ExportBitmapsForm.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/ExportBitmapsForm.cs
new file mode 100644
index 0000000000000000000000000000000000000000..8053d04d27cb17b9b8604b1da07cab1cf9f44574
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/ExportBitmapsForm.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer.Demo
+{
+ public partial class ExportBitmapsForm : Form
+ {
+ private int _dpiX;
+ private int _dpiY;
+
+ public int DpiX
+ {
+ get { return _dpiX; }
+ }
+
+ public int DpiY
+ {
+ get { return _dpiY; }
+ }
+
+ public ExportBitmapsForm()
+ {
+ InitializeComponent();
+ UpdateEnabled();
+ }
+
+ private void _acceptButton_Click(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.OK;
+ }
+
+ private void _dpiX_TextChanged(object sender, EventArgs e)
+ {
+ UpdateEnabled();
+ }
+
+ private void _dpiY_TextChanged(object sender, EventArgs e)
+ {
+ UpdateEnabled();
+ }
+
+ private void UpdateEnabled()
+ {
+ _acceptButton.Enabled =
+ int.TryParse(_dpiXTextBox.Text, out _dpiX) &&
+ int.TryParse(_dpiYTextBox.Text, out _dpiY);
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/ExportBitmapsForm.resx b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/ExportBitmapsForm.resx
new file mode 100644
index 0000000000000000000000000000000000000000..5ea0895e324fa7a86681adc56938bad2f2367ba0
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/ExportBitmapsForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/MainForm.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/MainForm.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..0c2cff90d905b72d85d8b4d6f78ff447f2419378
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/MainForm.Designer.cs
@@ -0,0 +1,630 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace PdfiumViewer.Demo
+{
+ partial class MainForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
+ this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+ this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
+ this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator();
+ this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem7 = new System.Windows.Forms.ToolStripSeparator();
+ this.renderToBitmapsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator();
+ this.cutMarginsWhenPrintingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.shrinkToMarginsWhenPrintingToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator();
+ this.deleteCurrentPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.rotateCurrentPageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.rotate0ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.rotate90ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.rotate180ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.rotate270ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripSeparator();
+ this.showRangeOfPagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator();
+ this.informationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
+ this._page = new System.Windows.Forms.ToolStripTextBox();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
+ this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
+ this._zoom = new System.Windows.Forms.ToolStripTextBox();
+ this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
+ this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
+ this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this._fitWidth = new System.Windows.Forms.ToolStripButton();
+ this._fitHeight = new System.Windows.Forms.ToolStripButton();
+ this._fitBest = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
+ this._rotateLeft = new System.Windows.Forms.ToolStripButton();
+ this._rotateRight = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
+ this._showToolbar = new System.Windows.Forms.ToolStripButton();
+ this._showBookmarks = new System.Windows.Forms.ToolStripButton();
+ this._getTextFromPage = new System.Windows.Forms.ToolStripButton();
+ this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+ this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
+ this._pageToolStripLabel = new System.Windows.Forms.ToolStripStatusLabel();
+ this.toolStripStatusLabel2 = new System.Windows.Forms.ToolStripStatusLabel();
+ this._coordinatesToolStripLabel = new System.Windows.Forms.ToolStripStatusLabel();
+ this.pdfViewer1 = new PdfiumViewer.PdfViewer();
+ this.printMultiplePagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.menuStrip1.SuspendLayout();
+ this.toolStrip1.SuspendLayout();
+ this.statusStrip1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // menuStrip1
+ //
+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.fileToolStripMenuItem,
+ this.toolsToolStripMenuItem});
+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip1.Name = "menuStrip1";
+ this.menuStrip1.Size = new System.Drawing.Size(1128, 24);
+ this.menuStrip1.TabIndex = 1;
+ this.menuStrip1.Text = "menuStrip1";
+ //
+ // fileToolStripMenuItem
+ //
+ this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.openToolStripMenuItem,
+ this.toolStripMenuItem1,
+ this.printPreviewToolStripMenuItem,
+ this.printMultiplePagesToolStripMenuItem,
+ this.toolStripMenuItem3,
+ this.exitToolStripMenuItem});
+ this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
+ this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
+ this.fileToolStripMenuItem.Text = "&File";
+ //
+ // openToolStripMenuItem
+ //
+ this.openToolStripMenuItem.Name = "openToolStripMenuItem";
+ this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
+ this.openToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ this.openToolStripMenuItem.Text = "&Open";
+ this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
+ //
+ // toolStripMenuItem1
+ //
+ this.toolStripMenuItem1.Name = "toolStripMenuItem1";
+ this.toolStripMenuItem1.Size = new System.Drawing.Size(177, 6);
+ //
+ // printPreviewToolStripMenuItem
+ //
+ this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
+ this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ this.printPreviewToolStripMenuItem.Text = "Print Preview";
+ this.printPreviewToolStripMenuItem.Click += new System.EventHandler(this.printPreviewToolStripMenuItem_Click);
+ //
+ // toolStripMenuItem3
+ //
+ this.toolStripMenuItem3.Name = "toolStripMenuItem3";
+ this.toolStripMenuItem3.Size = new System.Drawing.Size(177, 6);
+ //
+ // exitToolStripMenuItem
+ //
+ this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
+ this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
+ this.exitToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ this.exitToolStripMenuItem.Text = "E&xit";
+ this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
+ //
+ // toolsToolStripMenuItem
+ //
+ this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.findToolStripMenuItem,
+ this.toolStripMenuItem7,
+ this.renderToBitmapsToolStripMenuItem,
+ this.toolStripMenuItem2,
+ this.cutMarginsWhenPrintingToolStripMenuItem,
+ this.shrinkToMarginsWhenPrintingToolStripMenuItem,
+ this.toolStripMenuItem4,
+ this.deleteCurrentPageToolStripMenuItem,
+ this.rotateCurrentPageToolStripMenuItem,
+ this.toolStripMenuItem5,
+ this.showRangeOfPagesToolStripMenuItem,
+ this.toolStripMenuItem6,
+ this.informationToolStripMenuItem});
+ this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
+ this.toolsToolStripMenuItem.Size = new System.Drawing.Size(47, 20);
+ this.toolsToolStripMenuItem.Text = "&Tools";
+ //
+ // findToolStripMenuItem
+ //
+ this.findToolStripMenuItem.Name = "findToolStripMenuItem";
+ this.findToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
+ this.findToolStripMenuItem.Size = new System.Drawing.Size(244, 22);
+ this.findToolStripMenuItem.Text = "&Find";
+ this.findToolStripMenuItem.Click += new System.EventHandler(this.findToolStripMenuItem_Click);
+ //
+ // toolStripMenuItem7
+ //
+ this.toolStripMenuItem7.Name = "toolStripMenuItem7";
+ this.toolStripMenuItem7.Size = new System.Drawing.Size(241, 6);
+ //
+ // renderToBitmapsToolStripMenuItem
+ //
+ this.renderToBitmapsToolStripMenuItem.Name = "renderToBitmapsToolStripMenuItem";
+ this.renderToBitmapsToolStripMenuItem.Size = new System.Drawing.Size(244, 22);
+ this.renderToBitmapsToolStripMenuItem.Text = "&Render to Bitmaps";
+ this.renderToBitmapsToolStripMenuItem.Click += new System.EventHandler(this.renderToBitmapsToolStripMenuItem_Click);
+ //
+ // toolStripMenuItem2
+ //
+ this.toolStripMenuItem2.Name = "toolStripMenuItem2";
+ this.toolStripMenuItem2.Size = new System.Drawing.Size(241, 6);
+ //
+ // cutMarginsWhenPrintingToolStripMenuItem
+ //
+ this.cutMarginsWhenPrintingToolStripMenuItem.Name = "cutMarginsWhenPrintingToolStripMenuItem";
+ this.cutMarginsWhenPrintingToolStripMenuItem.Size = new System.Drawing.Size(244, 22);
+ this.cutMarginsWhenPrintingToolStripMenuItem.Text = "Cut margins when printing";
+ this.cutMarginsWhenPrintingToolStripMenuItem.Click += new System.EventHandler(this.cutMarginsWhenPrintingToolStripMenuItem_Click);
+ //
+ // shrinkToMarginsWhenPrintingToolStripMenuItem
+ //
+ this.shrinkToMarginsWhenPrintingToolStripMenuItem.Name = "shrinkToMarginsWhenPrintingToolStripMenuItem";
+ this.shrinkToMarginsWhenPrintingToolStripMenuItem.Size = new System.Drawing.Size(244, 22);
+ this.shrinkToMarginsWhenPrintingToolStripMenuItem.Text = "Shrink to margins when printing";
+ this.shrinkToMarginsWhenPrintingToolStripMenuItem.Click += new System.EventHandler(this.shrinkToMarginsWhenPrintingToolStripMenuItem_Click);
+ //
+ // toolStripMenuItem4
+ //
+ this.toolStripMenuItem4.Name = "toolStripMenuItem4";
+ this.toolStripMenuItem4.Size = new System.Drawing.Size(241, 6);
+ //
+ // deleteCurrentPageToolStripMenuItem
+ //
+ this.deleteCurrentPageToolStripMenuItem.Name = "deleteCurrentPageToolStripMenuItem";
+ this.deleteCurrentPageToolStripMenuItem.Size = new System.Drawing.Size(244, 22);
+ this.deleteCurrentPageToolStripMenuItem.Text = "Delete Current Page";
+ this.deleteCurrentPageToolStripMenuItem.Click += new System.EventHandler(this.deleteCurrentPageToolStripMenuItem_Click);
+ //
+ // rotateCurrentPageToolStripMenuItem
+ //
+ this.rotateCurrentPageToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.rotate0ToolStripMenuItem,
+ this.rotate90ToolStripMenuItem,
+ this.rotate180ToolStripMenuItem,
+ this.rotate270ToolStripMenuItem});
+ this.rotateCurrentPageToolStripMenuItem.Name = "rotateCurrentPageToolStripMenuItem";
+ this.rotateCurrentPageToolStripMenuItem.Size = new System.Drawing.Size(244, 22);
+ this.rotateCurrentPageToolStripMenuItem.Text = "Rotate Current Page";
+ //
+ // rotate0ToolStripMenuItem
+ //
+ this.rotate0ToolStripMenuItem.Name = "rotate0ToolStripMenuItem";
+ this.rotate0ToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
+ this.rotate0ToolStripMenuItem.Text = "Rotate 0°";
+ this.rotate0ToolStripMenuItem.Click += new System.EventHandler(this.rotate0ToolStripMenuItem_Click);
+ //
+ // rotate90ToolStripMenuItem
+ //
+ this.rotate90ToolStripMenuItem.Name = "rotate90ToolStripMenuItem";
+ this.rotate90ToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
+ this.rotate90ToolStripMenuItem.Text = "Rotate 90°";
+ this.rotate90ToolStripMenuItem.Click += new System.EventHandler(this.rotate90ToolStripMenuItem_Click);
+ //
+ // rotate180ToolStripMenuItem
+ //
+ this.rotate180ToolStripMenuItem.Name = "rotate180ToolStripMenuItem";
+ this.rotate180ToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
+ this.rotate180ToolStripMenuItem.Text = "Rotate 180°";
+ this.rotate180ToolStripMenuItem.Click += new System.EventHandler(this.rotate180ToolStripMenuItem_Click);
+ //
+ // rotate270ToolStripMenuItem
+ //
+ this.rotate270ToolStripMenuItem.Name = "rotate270ToolStripMenuItem";
+ this.rotate270ToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
+ this.rotate270ToolStripMenuItem.Text = "Rotate 270°";
+ this.rotate270ToolStripMenuItem.Click += new System.EventHandler(this.rotate270ToolStripMenuItem_Click);
+ //
+ // toolStripMenuItem5
+ //
+ this.toolStripMenuItem5.Name = "toolStripMenuItem5";
+ this.toolStripMenuItem5.Size = new System.Drawing.Size(241, 6);
+ //
+ // showRangeOfPagesToolStripMenuItem
+ //
+ this.showRangeOfPagesToolStripMenuItem.Name = "showRangeOfPagesToolStripMenuItem";
+ this.showRangeOfPagesToolStripMenuItem.Size = new System.Drawing.Size(244, 22);
+ this.showRangeOfPagesToolStripMenuItem.Text = "Show range of pages";
+ this.showRangeOfPagesToolStripMenuItem.Click += new System.EventHandler(this.showRangeOfPagesToolStripMenuItem_Click);
+ //
+ // toolStripMenuItem6
+ //
+ this.toolStripMenuItem6.Name = "toolStripMenuItem6";
+ this.toolStripMenuItem6.Size = new System.Drawing.Size(241, 6);
+ //
+ // informationToolStripMenuItem
+ //
+ this.informationToolStripMenuItem.Name = "informationToolStripMenuItem";
+ this.informationToolStripMenuItem.Size = new System.Drawing.Size(244, 22);
+ this.informationToolStripMenuItem.Text = "Information";
+ this.informationToolStripMenuItem.Click += new System.EventHandler(this.informationToolStripMenuItem_Click);
+ //
+ // toolStrip1
+ //
+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripLabel1,
+ this._page,
+ this.toolStripSeparator1,
+ this.toolStripButton1,
+ this.toolStripButton2,
+ this.toolStripSeparator2,
+ this.toolStripLabel2,
+ this._zoom,
+ this.toolStripSeparator7,
+ this.toolStripButton4,
+ this.toolStripButton3,
+ this.toolStripSeparator3,
+ this._fitWidth,
+ this._fitHeight,
+ this._fitBest,
+ this.toolStripSeparator5,
+ this._rotateLeft,
+ this._rotateRight,
+ this.toolStripSeparator6,
+ this._showToolbar,
+ this._showBookmarks,
+ this._getTextFromPage});
+ this.toolStrip1.Location = new System.Drawing.Point(0, 24);
+ this.toolStrip1.Name = "toolStrip1";
+ this.toolStrip1.Size = new System.Drawing.Size(1128, 25);
+ this.toolStrip1.TabIndex = 2;
+ this.toolStrip1.Text = "toolStrip1";
+ //
+ // toolStripLabel1
+ //
+ this.toolStripLabel1.Name = "toolStripLabel1";
+ this.toolStripLabel1.Size = new System.Drawing.Size(36, 22);
+ this.toolStripLabel1.Text = "Page:";
+ //
+ // _page
+ //
+ this._page.Name = "_page";
+ this._page.Size = new System.Drawing.Size(100, 25);
+ this._page.KeyDown += new System.Windows.Forms.KeyEventHandler(this._page_KeyDown);
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ //
+ // toolStripButton1
+ //
+ this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
+ this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.toolStripButton1.Name = "toolStripButton1";
+ this.toolStripButton1.Size = new System.Drawing.Size(23, 22);
+ this.toolStripButton1.Text = "<";
+ this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click_1);
+ //
+ // toolStripButton2
+ //
+ this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
+ this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.toolStripButton2.Name = "toolStripButton2";
+ this.toolStripButton2.Size = new System.Drawing.Size(23, 22);
+ this.toolStripButton2.Text = ">";
+ this.toolStripButton2.Click += new System.EventHandler(this.toolStripButton2_Click);
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
+ //
+ // toolStripLabel2
+ //
+ this.toolStripLabel2.Name = "toolStripLabel2";
+ this.toolStripLabel2.Size = new System.Drawing.Size(42, 22);
+ this.toolStripLabel2.Text = "Zoom:";
+ //
+ // _zoom
+ //
+ this._zoom.Name = "_zoom";
+ this._zoom.Size = new System.Drawing.Size(100, 25);
+ this._zoom.KeyDown += new System.Windows.Forms.KeyEventHandler(this._zoom_KeyDown);
+ //
+ // toolStripSeparator7
+ //
+ this.toolStripSeparator7.Name = "toolStripSeparator7";
+ this.toolStripSeparator7.Size = new System.Drawing.Size(6, 25);
+ //
+ // toolStripButton4
+ //
+ this.toolStripButton4.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.toolStripButton4.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image")));
+ this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.toolStripButton4.Name = "toolStripButton4";
+ this.toolStripButton4.Size = new System.Drawing.Size(23, 22);
+ this.toolStripButton4.Text = "+";
+ this.toolStripButton4.Click += new System.EventHandler(this.toolStripButton4_Click);
+ //
+ // toolStripButton3
+ //
+ this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
+ this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.toolStripButton3.Name = "toolStripButton3";
+ this.toolStripButton3.Size = new System.Drawing.Size(23, 22);
+ this.toolStripButton3.Text = "-";
+ this.toolStripButton3.Click += new System.EventHandler(this.toolStripButton3_Click);
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
+ //
+ // _fitWidth
+ //
+ this._fitWidth.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this._fitWidth.Image = ((System.Drawing.Image)(resources.GetObject("_fitWidth.Image")));
+ this._fitWidth.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this._fitWidth.Name = "_fitWidth";
+ this._fitWidth.Size = new System.Drawing.Size(59, 22);
+ this._fitWidth.Text = "Fit Width";
+ this._fitWidth.Click += new System.EventHandler(this._fitWidth_Click);
+ //
+ // _fitHeight
+ //
+ this._fitHeight.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this._fitHeight.Image = ((System.Drawing.Image)(resources.GetObject("_fitHeight.Image")));
+ this._fitHeight.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this._fitHeight.Name = "_fitHeight";
+ this._fitHeight.Size = new System.Drawing.Size(63, 22);
+ this._fitHeight.Text = "Fit Height";
+ this._fitHeight.Click += new System.EventHandler(this._fitHeight_Click);
+ //
+ // _fitBest
+ //
+ this._fitBest.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this._fitBest.Image = ((System.Drawing.Image)(resources.GetObject("_fitBest.Image")));
+ this._fitBest.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this._fitBest.Name = "_fitBest";
+ this._fitBest.Size = new System.Drawing.Size(49, 22);
+ this._fitBest.Text = "Fit Best";
+ this._fitBest.Click += new System.EventHandler(this._fitBest_Click);
+ //
+ // toolStripSeparator5
+ //
+ this.toolStripSeparator5.Name = "toolStripSeparator5";
+ this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25);
+ //
+ // _rotateLeft
+ //
+ this._rotateLeft.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this._rotateLeft.Image = ((System.Drawing.Image)(resources.GetObject("_rotateLeft.Image")));
+ this._rotateLeft.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this._rotateLeft.Name = "_rotateLeft";
+ this._rotateLeft.Size = new System.Drawing.Size(68, 22);
+ this._rotateLeft.Text = "Rotate Left";
+ this._rotateLeft.Click += new System.EventHandler(this._rotateLeft_Click);
+ //
+ // _rotateRight
+ //
+ this._rotateRight.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this._rotateRight.Image = ((System.Drawing.Image)(resources.GetObject("_rotateRight.Image")));
+ this._rotateRight.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this._rotateRight.Name = "_rotateRight";
+ this._rotateRight.Size = new System.Drawing.Size(76, 22);
+ this._rotateRight.Text = "Rotate Right";
+ this._rotateRight.Click += new System.EventHandler(this._rotateRight_Click);
+ //
+ // toolStripSeparator6
+ //
+ this.toolStripSeparator6.Name = "toolStripSeparator6";
+ this.toolStripSeparator6.Size = new System.Drawing.Size(6, 25);
+ //
+ // _showToolbar
+ //
+ this._showToolbar.CheckOnClick = true;
+ this._showToolbar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this._showToolbar.Image = ((System.Drawing.Image)(resources.GetObject("_showToolbar.Image")));
+ this._showToolbar.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this._showToolbar.Name = "_showToolbar";
+ this._showToolbar.Size = new System.Drawing.Size(83, 22);
+ this._showToolbar.Text = "Show Toolbar";
+ this._showToolbar.Click += new System.EventHandler(this._hideToolbar_Click);
+ //
+ // _showBookmarks
+ //
+ this._showBookmarks.CheckOnClick = true;
+ this._showBookmarks.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this._showBookmarks.Image = ((System.Drawing.Image)(resources.GetObject("_showBookmarks.Image")));
+ this._showBookmarks.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this._showBookmarks.Name = "_showBookmarks";
+ this._showBookmarks.Size = new System.Drawing.Size(102, 22);
+ this._showBookmarks.Text = "Show Bookmarks";
+ this._showBookmarks.Click += new System.EventHandler(this._hideBookmarks_Click);
+ //
+ // _getTextFromPage
+ //
+ this._getTextFromPage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this._getTextFromPage.Image = ((System.Drawing.Image)(resources.GetObject("_getTextFromPage.Image")));
+ this._getTextFromPage.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this._getTextFromPage.Name = "_getTextFromPage";
+ this._getTextFromPage.Size = new System.Drawing.Size(53, 22);
+ this._getTextFromPage.Text = "Get Text";
+ this._getTextFromPage.ToolTipText = "Get Text From Current Page";
+ this._getTextFromPage.Click += new System.EventHandler(this._getTextFromPage_Click);
+ //
+ // statusStrip1
+ //
+ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripStatusLabel1,
+ this._pageToolStripLabel,
+ this.toolStripStatusLabel2,
+ this._coordinatesToolStripLabel});
+ this.statusStrip1.Location = new System.Drawing.Point(0, 573);
+ this.statusStrip1.Name = "statusStrip1";
+ this.statusStrip1.Size = new System.Drawing.Size(1128, 22);
+ this.statusStrip1.TabIndex = 3;
+ this.statusStrip1.Text = "statusStrip1";
+ //
+ // toolStripStatusLabel1
+ //
+ this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
+ this.toolStripStatusLabel1.Size = new System.Drawing.Size(36, 17);
+ this.toolStripStatusLabel1.Text = "Page:";
+ //
+ // _pageToolStripLabel
+ //
+ this._pageToolStripLabel.Name = "_pageToolStripLabel";
+ this._pageToolStripLabel.Size = new System.Drawing.Size(41, 17);
+ this._pageToolStripLabel.Text = "(page)";
+ //
+ // toolStripStatusLabel2
+ //
+ this.toolStripStatusLabel2.Name = "toolStripStatusLabel2";
+ this.toolStripStatusLabel2.Size = new System.Drawing.Size(74, 17);
+ this.toolStripStatusLabel2.Text = "Coordinates:";
+ //
+ // _coordinatesToolStripLabel
+ //
+ this._coordinatesToolStripLabel.Name = "_coordinatesToolStripLabel";
+ this._coordinatesToolStripLabel.Size = new System.Drawing.Size(77, 17);
+ this._coordinatesToolStripLabel.Text = "(coordinates)";
+ //
+ // pdfViewer1
+ //
+ this.pdfViewer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pdfViewer1.Location = new System.Drawing.Point(0, 49);
+ this.pdfViewer1.Name = "pdfViewer1";
+ this.pdfViewer1.Size = new System.Drawing.Size(1128, 524);
+ this.pdfViewer1.TabIndex = 0;
+ //
+ // printMultiplePagesToolStripMenuItem
+ //
+ this.printMultiplePagesToolStripMenuItem.Name = "printMultiplePagesToolStripMenuItem";
+ this.printMultiplePagesToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+ this.printMultiplePagesToolStripMenuItem.Text = "Print Multiple Pages";
+ this.printMultiplePagesToolStripMenuItem.Click += new System.EventHandler(this.printMultiplePagesToolStripMenuItem_Click);
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(1128, 595);
+ this.Controls.Add(this.pdfViewer1);
+ this.Controls.Add(this.statusStrip1);
+ this.Controls.Add(this.toolStrip1);
+ this.Controls.Add(this.menuStrip1);
+ this.MainMenuStrip = this.menuStrip1;
+ this.Name = "MainForm";
+ this.Text = "Form1";
+ this.Shown += new System.EventHandler(this.MainForm_Shown);
+ this.menuStrip1.ResumeLayout(false);
+ this.menuStrip1.PerformLayout();
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
+ this.statusStrip1.ResumeLayout(false);
+ this.statusStrip1.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private global::PdfiumViewer.PdfViewer pdfViewer1;
+ private System.Windows.Forms.MenuStrip menuStrip1;
+ private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
+ private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem renderToBitmapsToolStripMenuItem;
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripLabel toolStripLabel1;
+ private System.Windows.Forms.ToolStripTextBox _page;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripButton toolStripButton1;
+ private System.Windows.Forms.ToolStripButton toolStripButton2;
+ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2;
+ private System.Windows.Forms.ToolStripMenuItem cutMarginsWhenPrintingToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem shrinkToMarginsWhenPrintingToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem3;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripButton _fitWidth;
+ private System.Windows.Forms.ToolStripButton _fitHeight;
+ private System.Windows.Forms.ToolStripLabel toolStripLabel2;
+ private System.Windows.Forms.ToolStripTextBox _zoom;
+ private System.Windows.Forms.ToolStripButton toolStripButton4;
+ private System.Windows.Forms.ToolStripButton toolStripButton3;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
+ private System.Windows.Forms.ToolStripButton _rotateLeft;
+ private System.Windows.Forms.ToolStripButton _rotateRight;
+ private System.Windows.Forms.ToolStripButton _fitBest;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
+ private System.Windows.Forms.ToolStripButton _showToolbar;
+ private System.Windows.Forms.ToolStripButton _showBookmarks;
+ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem4;
+ private System.Windows.Forms.ToolStripMenuItem deleteCurrentPageToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem rotateCurrentPageToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem rotate0ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem rotate90ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem rotate180ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem rotate270ToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
+ private System.Windows.Forms.StatusStrip statusStrip1;
+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
+ private System.Windows.Forms.ToolStripStatusLabel _pageToolStripLabel;
+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel2;
+ private System.Windows.Forms.ToolStripStatusLabel _coordinatesToolStripLabel;
+ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem5;
+ private System.Windows.Forms.ToolStripMenuItem showRangeOfPagesToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem6;
+ private System.Windows.Forms.ToolStripMenuItem informationToolStripMenuItem;
+ private System.Windows.Forms.ToolStripButton _getTextFromPage;
+ private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripMenuItem7;
+ private System.Windows.Forms.ToolStripMenuItem printMultiplePagesToolStripMenuItem;
+ }
+}
+
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/MainForm.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/MainForm.cs
new file mode 100644
index 0000000000000000000000000000000000000000..e65cddf5a075faed0395ef0a7f593b320cecd3f5
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/MainForm.cs
@@ -0,0 +1,382 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer.Demo
+{
+ public partial class MainForm : Form
+ {
+ private SearchForm _searchForm;
+
+ public MainForm()
+ {
+ InitializeComponent();
+
+ renderToBitmapsToolStripMenuItem.Enabled = false;
+
+ pdfViewer1.Renderer.DisplayRectangleChanged += Renderer_DisplayRectangleChanged;
+ pdfViewer1.Renderer.ZoomChanged += Renderer_ZoomChanged;
+
+ pdfViewer1.Renderer.MouseMove += Renderer_MouseMove;
+ pdfViewer1.Renderer.MouseLeave += Renderer_MouseLeave;
+ ShowPdfLocation(PdfPoint.Empty);
+
+ cutMarginsWhenPrintingToolStripMenuItem.PerformClick();
+
+ _zoom.Text = pdfViewer1.Renderer.Zoom.ToString();
+
+ Disposed += (s, e) => pdfViewer1.Document?.Dispose();
+ }
+
+ private void Renderer_MouseLeave(object sender, EventArgs e)
+ {
+ ShowPdfLocation(PdfPoint.Empty);
+ }
+
+ private void Renderer_MouseMove(object sender, MouseEventArgs e)
+ {
+ ShowPdfLocation(pdfViewer1.Renderer.PointToPdf(e.Location));
+ }
+
+ private void ShowPdfLocation(PdfPoint point)
+ {
+ if (!point.IsValid)
+ {
+ _pageToolStripLabel.Text = null;
+ _coordinatesToolStripLabel.Text = null;
+ }
+ else
+ {
+ _pageToolStripLabel.Text = (point.Page + 1).ToString();
+ _coordinatesToolStripLabel.Text = point.Location.X + "," + point.Location.Y;
+ }
+ }
+
+ void Renderer_ZoomChanged(object sender, EventArgs e)
+ {
+ _zoom.Text = pdfViewer1.Renderer.Zoom.ToString();
+ }
+
+ void Renderer_DisplayRectangleChanged(object sender, EventArgs e)
+ {
+ _page.Text = (pdfViewer1.Renderer.Page + 1).ToString();
+ }
+
+ private void MainForm_Shown(object sender, EventArgs e)
+ {
+ var args = Environment.GetCommandLineArgs();
+
+ if (args.Length > 1)
+ {
+ pdfViewer1.Document?.Dispose();
+ pdfViewer1.Document = OpenDocument(args[1]);
+ renderToBitmapsToolStripMenuItem.Enabled = true;
+ }
+ else
+ {
+ OpenFile();
+ }
+
+ _showBookmarks.Checked = pdfViewer1.ShowBookmarks;
+ _showToolbar.Checked = pdfViewer1.ShowToolbar;
+ }
+
+ private PdfDocument OpenDocument(string fileName)
+ {
+ try
+ {
+ return PdfDocument.Load(this, fileName);
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(this, ex.Message, Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
+ return null;
+ }
+ }
+
+ private void OpenFile()
+ {
+ using (var form = new OpenFileDialog())
+ {
+ form.Filter = "PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.*";
+ form.RestoreDirectory = true;
+ form.Title = "Open PDF File";
+
+ if (form.ShowDialog(this) != DialogResult.OK)
+ {
+ Dispose();
+ return;
+ }
+
+ pdfViewer1.Document?.Dispose();
+ pdfViewer1.Document = OpenDocument(form.FileName);
+ renderToBitmapsToolStripMenuItem.Enabled = true;
+ }
+ }
+
+ private void exitToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ Close();
+ }
+
+ private void openToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ OpenFile();
+ }
+
+ private void renderToBitmapsToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ int dpiX;
+ int dpiY;
+
+ using (var form = new ExportBitmapsForm())
+ {
+ if (form.ShowDialog() != DialogResult.OK)
+ return;
+
+ dpiX = form.DpiX;
+ dpiY = form.DpiY;
+ }
+
+ string path;
+
+ using (var form = new FolderBrowserDialog())
+ {
+ if (form.ShowDialog(this) != DialogResult.OK)
+ return;
+
+ path = form.SelectedPath;
+ }
+
+ var document = pdfViewer1.Document;
+
+ for (int i = 0; i < document.PageCount; i++)
+ {
+ using (var image = document.Render(i, (int)document.PageSizes[i].Width, (int)document.PageSizes[i].Height, dpiX, dpiY, false))
+ {
+ image.Save(Path.Combine(path, "Page " + i + ".png"));
+ }
+ }
+ }
+
+ private void toolStripButton1_Click_1(object sender, EventArgs e)
+ {
+ pdfViewer1.Renderer.Page--;
+ }
+
+ private void toolStripButton2_Click(object sender, EventArgs e)
+ {
+ pdfViewer1.Renderer.Page++;
+ }
+
+ private void cutMarginsWhenPrintingToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ cutMarginsWhenPrintingToolStripMenuItem.Checked = true;
+ shrinkToMarginsWhenPrintingToolStripMenuItem.Checked = false;
+
+ pdfViewer1.DefaultPrintMode = PdfPrintMode.CutMargin;
+ }
+
+ private void shrinkToMarginsWhenPrintingToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ shrinkToMarginsWhenPrintingToolStripMenuItem.Checked = true;
+ cutMarginsWhenPrintingToolStripMenuItem.Checked = false;
+
+ pdfViewer1.DefaultPrintMode = PdfPrintMode.ShrinkToMargin;
+ }
+
+ private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using (var form = new PrintPreviewDialog())
+ {
+ form.Document = pdfViewer1.Document.CreatePrintDocument(pdfViewer1.DefaultPrintMode);
+ form.ShowDialog(this);
+ }
+ }
+
+ private void _fitWidth_Click(object sender, EventArgs e)
+ {
+ FitPage(PdfViewerZoomMode.FitWidth);
+ }
+
+ private void FitPage(PdfViewerZoomMode zoomMode)
+ {
+ int page = pdfViewer1.Renderer.Page;
+ pdfViewer1.ZoomMode = zoomMode;
+ pdfViewer1.Renderer.Zoom = 1;
+ pdfViewer1.Renderer.Page = page;
+ }
+
+ private void _fitHeight_Click(object sender, EventArgs e)
+ {
+ FitPage(PdfViewerZoomMode.FitHeight);
+ }
+
+ private void _fitBest_Click(object sender, EventArgs e)
+ {
+ FitPage(PdfViewerZoomMode.FitBest);
+ }
+
+ private void _page_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ {
+ e.Handled = true;
+
+ int page;
+ if (int.TryParse(_page.Text, out page))
+ pdfViewer1.Renderer.Page = page - 1;
+ }
+ }
+
+ private void _zoom_KeyDown(object sender, KeyEventArgs e)
+ {
+ if (e.KeyCode == Keys.Enter)
+ {
+ e.Handled = true;
+
+ float zoom;
+ if (float.TryParse(_zoom.Text, out zoom))
+ pdfViewer1.Renderer.Zoom = zoom;
+ }
+ }
+
+ private void toolStripButton4_Click(object sender, EventArgs e)
+ {
+ pdfViewer1.Renderer.ZoomIn();
+ }
+
+ private void toolStripButton3_Click(object sender, EventArgs e)
+ {
+ pdfViewer1.Renderer.ZoomOut();
+ }
+
+ private void _rotateLeft_Click(object sender, EventArgs e)
+ {
+ pdfViewer1.Renderer.RotateLeft();
+ }
+
+ private void _rotateRight_Click(object sender, EventArgs e)
+ {
+ pdfViewer1.Renderer.RotateRight();
+ }
+
+ private void _hideToolbar_Click(object sender, EventArgs e)
+ {
+ pdfViewer1.ShowToolbar = _showToolbar.Checked;
+ }
+
+ private void _hideBookmarks_Click(object sender, EventArgs e)
+ {
+ pdfViewer1.ShowBookmarks = _showBookmarks.Checked;
+ }
+
+ private void deleteCurrentPageToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ // PdfRenderer does not support changes to the loaded document,
+ // so we fake it by reloading the document into the renderer.
+
+ int page = pdfViewer1.Renderer.Page;
+ var document = pdfViewer1.Document;
+ pdfViewer1.Document = null;
+ document.DeletePage(page);
+ pdfViewer1.Document = document;
+ pdfViewer1.Renderer.Page = page;
+ }
+
+ private void rotate0ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ Rotate(PdfRotation.Rotate0);
+ }
+
+ private void rotate90ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ Rotate(PdfRotation.Rotate90);
+ }
+
+ private void rotate180ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ Rotate(PdfRotation.Rotate180);
+ }
+
+ private void rotate270ToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ Rotate(PdfRotation.Rotate270);
+ }
+
+ private void Rotate(PdfRotation rotate)
+ {
+ // PdfRenderer does not support changes to the loaded document,
+ // so we fake it by reloading the document into the renderer.
+
+ int page = pdfViewer1.Renderer.Page;
+ var document = pdfViewer1.Document;
+ pdfViewer1.Document = null;
+ document.RotatePage(page, rotate);
+ pdfViewer1.Document = document;
+ pdfViewer1.Renderer.Page = page;
+ }
+
+ private void showRangeOfPagesToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using (var form = new PageRangeForm(pdfViewer1.Document))
+ {
+ if (form.ShowDialog(this) == DialogResult.OK)
+ {
+ pdfViewer1.Document = form.Document;
+ }
+ }
+ }
+
+ private void informationToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ PdfInformation info = pdfViewer1.Document.GetInformation();
+ StringBuilder sz = new StringBuilder();
+ sz.AppendLine($"Author: {info.Author}");
+ sz.AppendLine($"Creator: {info.Creator}");
+ sz.AppendLine($"Keywords: {info.Keywords}");
+ sz.AppendLine($"Producer: {info.Producer}");
+ sz.AppendLine($"Subject: {info.Subject}");
+ sz.AppendLine($"Title: {info.Title}");
+ sz.AppendLine($"Create Date: {info.CreationDate}");
+ sz.AppendLine($"Modified Date: {info.ModificationDate}");
+
+ MessageBox.Show(sz.ToString(), "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+
+ private void _getTextFromPage_Click(object sender, EventArgs e)
+ {
+ int page = pdfViewer1.Renderer.Page;
+ string text = pdfViewer1.Document.GetPdfText(page);
+ string caption = string.Format("Page {0} contains {1} character(s):", page + 1, text.Length);
+
+ if (text.Length > 128) text = text.Substring(0, 125) + "...\n\n\n\n..." + text.Substring(text.Length - 125);
+ MessageBox.Show(this, text, caption, MessageBoxButtons.OK, MessageBoxIcon.Information);
+ }
+
+ private void findToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (_searchForm == null)
+ {
+ _searchForm = new SearchForm(pdfViewer1.Renderer);
+ _searchForm.Disposed += (s, ea) => _searchForm = null;
+ _searchForm.Show(this);
+ }
+
+ _searchForm.Focus();
+ }
+
+ private void printMultiplePagesToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using (var form = new PrintMultiplePagesForm(pdfViewer1))
+ {
+ form.ShowDialog(this);
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/MainForm.resx b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/MainForm.resx
new file mode 100644
index 0000000000000000000000000000000000000000..98e3b46ec84298d65590d55b235365ae87f705e8
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/MainForm.resx
@@ -0,0 +1,310 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 132, 17
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
+ YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
+ 0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
+ bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
+ VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
+ c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
+ Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
+ mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
+ kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
+ TgDQASA1MVpwzwAAAABJRU5ErkJggg==
+
+
+
+ 237, 17
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PageRangeForm.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PageRangeForm.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..8b9868348128c4e13ca660bee9e80e5b2c19ffb1
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PageRangeForm.Designer.cs
@@ -0,0 +1,126 @@
+namespace PdfiumViewer.Demo
+{
+ partial class PageRangeForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this._startPage = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this._endPage = new System.Windows.Forms.TextBox();
+ this._acceptButton = new System.Windows.Forms.Button();
+ this._cancelButton = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 15);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(59, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Start page:";
+ //
+ // _startPage
+ //
+ this._startPage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this._startPage.Location = new System.Drawing.Point(83, 12);
+ this._startPage.Name = "_startPage";
+ this._startPage.Size = new System.Drawing.Size(264, 20);
+ this._startPage.TabIndex = 1;
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(12, 41);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(56, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "End page:";
+ //
+ // _endPage
+ //
+ this._endPage.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this._endPage.Location = new System.Drawing.Point(83, 38);
+ this._endPage.Name = "_endPage";
+ this._endPage.Size = new System.Drawing.Size(264, 20);
+ this._endPage.TabIndex = 3;
+ //
+ // _acceptButton
+ //
+ this._acceptButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this._acceptButton.Location = new System.Drawing.Point(191, 64);
+ this._acceptButton.Name = "_acceptButton";
+ this._acceptButton.Size = new System.Drawing.Size(75, 23);
+ this._acceptButton.TabIndex = 4;
+ this._acceptButton.Text = "OK";
+ this._acceptButton.UseVisualStyleBackColor = true;
+ this._acceptButton.Click += new System.EventHandler(this._acceptButton_Click);
+ //
+ // _cancelButton
+ //
+ this._cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this._cancelButton.Location = new System.Drawing.Point(272, 64);
+ this._cancelButton.Name = "_cancelButton";
+ this._cancelButton.Size = new System.Drawing.Size(75, 23);
+ this._cancelButton.TabIndex = 5;
+ this._cancelButton.Text = "Cancel";
+ this._cancelButton.UseVisualStyleBackColor = true;
+ //
+ // PageRangeForm
+ //
+ this.AcceptButton = this._acceptButton;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this._cancelButton;
+ this.ClientSize = new System.Drawing.Size(359, 99);
+ this.Controls.Add(this._cancelButton);
+ this.Controls.Add(this._acceptButton);
+ this.Controls.Add(this._endPage);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this._startPage);
+ this.Controls.Add(this.label1);
+ this.Name = "PageRangeForm";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Show Range of Pages";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox _startPage;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox _endPage;
+ private System.Windows.Forms.Button _acceptButton;
+ private System.Windows.Forms.Button _cancelButton;
+ }
+}
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PageRangeForm.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PageRangeForm.cs
new file mode 100644
index 0000000000000000000000000000000000000000..b0a694fa00fbc459d9795fae48cfc6200e285e7d
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PageRangeForm.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer.Demo
+{
+ public partial class PageRangeForm : Form
+ {
+ private readonly IPdfDocument _document;
+
+ public IPdfDocument Document { get; private set; }
+
+ public PageRangeForm(IPdfDocument document)
+ {
+ _document = document;
+
+ InitializeComponent();
+
+ _startPage.Text = "1";
+ _endPage.Text = document.PageCount.ToString();
+ }
+
+ private void _acceptButton_Click(object sender, EventArgs e)
+ {
+ int startPage;
+ int endPage;
+
+ if (
+ !int.TryParse(_startPage.Text, out startPage) ||
+ !int.TryParse(_endPage.Text, out endPage) ||
+ startPage < 1 ||
+ endPage > _document.PageCount ||
+ startPage > endPage
+ )
+ {
+ MessageBox.Show(this, "Invalid start/end page");
+ }
+ else
+ {
+ Document = PdfRangeDocument.FromDocument(_document, startPage - 1, endPage - 1);
+
+ DialogResult = DialogResult.OK;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PageRangeForm.resx b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PageRangeForm.resx
new file mode 100644
index 0000000000000000000000000000000000000000..5ea0895e324fa7a86681adc56938bad2f2367ba0
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PageRangeForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PdfRangeDocument.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PdfRangeDocument.cs
new file mode 100644
index 0000000000000000000000000000000000000000..c56f4010e3775b8cbbc08a514a98f4a3eb41fe62
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PdfRangeDocument.cs
@@ -0,0 +1,303 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Printing;
+using System.IO;
+using System.Text;
+
+namespace PdfiumViewer.Demo
+{
+ public class PdfRangeDocument : IPdfDocument
+ {
+ public static PdfRangeDocument FromDocument(IPdfDocument document, int startPage, int endPage)
+ {
+ if (document == null)
+ throw new ArgumentNullException(nameof(document));
+
+ if (endPage < startPage)
+ throw new ArgumentException("End page cannot be less than start page");
+ if (startPage < 0)
+ throw new ArgumentException("Start page cannot be less than zero");
+ if (endPage >= document.PageCount)
+ throw new ArgumentException("End page cannot be more than the number of pages in the document");
+
+ return new PdfRangeDocument(
+ document,
+ startPage,
+ endPage
+ );
+ }
+
+ private readonly IPdfDocument _document;
+ private readonly int _startPage;
+ private readonly int _endPage;
+ private PdfBookmarkCollection _bookmarks;
+ private IList _sizes;
+
+ private PdfRangeDocument(IPdfDocument document, int startPage, int endPage)
+ {
+ _document = document;
+ _startPage = startPage;
+ _endPage = endPage;
+ }
+
+ public int PageCount
+ {
+ get { return _endPage - _startPage + 1; }
+ }
+
+ public PdfBookmarkCollection Bookmarks
+ {
+ get
+ {
+ if (_bookmarks == null)
+ _bookmarks = TranslateBookmarks(_document.Bookmarks);
+ return _bookmarks;
+ }
+ }
+
+ private PdfBookmarkCollection TranslateBookmarks(PdfBookmarkCollection bookmarks)
+ {
+ var result = new PdfBookmarkCollection();
+
+ TranslateBookmarks(result, bookmarks);
+
+ return result;
+ }
+
+ private void TranslateBookmarks(PdfBookmarkCollection result, PdfBookmarkCollection bookmarks)
+ {
+ foreach (var bookmark in bookmarks)
+ {
+ if (bookmark.PageIndex >= _startPage && bookmark.PageIndex <= _endPage)
+ {
+ var resultBookmark = new PdfBookmark
+ {
+ PageIndex = bookmark.PageIndex - _startPage,
+ Title = bookmark.Title
+ };
+
+ TranslateBookmarks(resultBookmark.Children, bookmark.Children);
+
+ result.Add(resultBookmark);
+ }
+ }
+ }
+
+ public IList PageSizes
+ {
+ get
+ {
+ if (_sizes == null)
+ _sizes = TranslateSizes(_document.PageSizes);
+ return _sizes;
+ }
+ }
+
+ private IList TranslateSizes(IList pageSizes)
+ {
+ var result = new List();
+
+ for (int i = _startPage; i <= _endPage; i++)
+ {
+ result.Add(pageSizes[i]);
+ }
+
+ return result;
+ }
+
+ public void Render(int page, Graphics graphics, float dpiX, float dpiY, Rectangle bounds, bool forPrinting)
+ {
+ _document.Render(TranslatePage(page), graphics, dpiX, dpiY, bounds, forPrinting);
+ }
+
+ public void Render(int page, Graphics graphics, float dpiX, float dpiY, Rectangle bounds, PdfRenderFlags flags)
+ {
+ _document.Render(TranslatePage(page), graphics, dpiX, dpiY, bounds, flags);
+ }
+
+ public Image Render(int page, float dpiX, float dpiY, bool forPrinting)
+ {
+ return _document.Render(TranslatePage(page), dpiX, dpiY, forPrinting);
+ }
+
+ public Image Render(int page, float dpiX, float dpiY, PdfRenderFlags flags)
+ {
+ return _document.Render(TranslatePage(page), dpiX, dpiY, flags);
+ }
+
+ public Image Render(int page, int width, int height, float dpiX, float dpiY, bool forPrinting)
+ {
+ return _document.Render(TranslatePage(page), width, height, dpiX, dpiY, forPrinting);
+ }
+
+ public Image Render(int page, int width, int height, float dpiX, float dpiY, PdfRenderFlags flags)
+ {
+ return _document.Render(TranslatePage(page), width, height, dpiX, dpiY, flags);
+ }
+
+ public Image Render(int page, int width, int height, float dpiX, float dpiY, PdfRotation rotate, PdfRenderFlags flags)
+ {
+ return _document.Render(page, width, height, dpiX, dpiY, rotate, flags);
+ }
+
+ public void Save(string path)
+ {
+ _document.Save(path);
+ }
+
+ public void Save(Stream stream)
+ {
+ _document.Save(stream);
+ }
+
+ public PdfMatches Search(string text, bool matchCase, bool wholeWord)
+ {
+ return TranslateMatches(_document.Search(text, matchCase, wholeWord));
+ }
+
+ public PdfMatches Search(string text, bool matchCase, bool wholeWord, int page)
+ {
+ return TranslateMatches(_document.Search(text, matchCase, wholeWord, page));
+ }
+
+ public PdfMatches Search(string text, bool matchCase, bool wholeWord, int startPage, int endPage)
+ {
+ return TranslateMatches(_document.Search(text, matchCase, wholeWord, startPage, endPage));
+ }
+
+ private PdfMatches TranslateMatches(PdfMatches search)
+ {
+ if (search == null)
+ return null;
+
+ var matches = new List();
+
+ foreach (var match in search.Items)
+ {
+ matches.Add(new PdfMatch(
+ match.Text,
+ new PdfTextSpan(match.TextSpan.Page + _startPage, match.TextSpan.Offset, match.TextSpan.Length),
+ match.Page + _startPage
+ ));
+ }
+
+ return new PdfMatches(
+ search.StartPage + _startPage,
+ search.EndPage + _startPage,
+ matches
+ );
+ }
+
+ public PrintDocument CreatePrintDocument()
+ {
+ return _document.CreatePrintDocument();
+ }
+
+ public PrintDocument CreatePrintDocument(PdfPrintMode printMode)
+ {
+ return _document.CreatePrintDocument(printMode);
+ }
+
+ public PrintDocument CreatePrintDocument(PdfPrintSettings settings)
+ {
+ return _document.CreatePrintDocument(settings);
+ }
+
+ public PdfPageLinks GetPageLinks(int pageNumber, Size pageSize)
+ {
+ return TranslateLinks(_document.GetPageLinks(pageNumber + _startPage, pageSize));
+ }
+
+ private PdfPageLinks TranslateLinks(PdfPageLinks pageLinks)
+ {
+ if (pageLinks == null)
+ return null;
+
+ var links = new List();
+
+ foreach (var link in pageLinks.Links)
+ {
+ links.Add(new PdfPageLink(
+ link.Bounds,
+ link.TargetPage + _startPage,
+ link.Uri
+ ));
+ }
+
+ return new PdfPageLinks(links);
+ }
+
+ public void DeletePage(int pageNumber)
+ {
+ _document.DeletePage(TranslatePage(pageNumber));
+ }
+
+ public void RotatePage(int pageNumber, PdfRotation rotation)
+ {
+ _document.RotatePage(TranslatePage(pageNumber), rotation);
+ }
+
+ public PdfInformation GetInformation()
+ {
+ return _document.GetInformation();
+ }
+
+ public string GetPdfText(int page)
+ {
+ return _document.GetPdfText(TranslatePage(page));
+ }
+
+ public string GetPdfText(PdfTextSpan textSpan)
+ {
+ return _document.GetPdfText(textSpan);
+ }
+
+ public IList GetTextBounds(PdfTextSpan textSpan)
+ {
+ var result = new List();
+
+ foreach (var rectangle in _document.GetTextBounds(textSpan))
+ {
+ result.Add(new PdfRectangle(
+ rectangle.Page + _startPage,
+ rectangle.Bounds
+ ));
+ }
+
+ return result;
+ }
+
+ public PointF PointToPdf(int page, Point point)
+ {
+ return _document.PointToPdf(TranslatePage(page), point);
+ }
+
+ public Point PointFromPdf(int page, PointF point)
+ {
+ return _document.PointFromPdf(TranslatePage(page), point);
+ }
+
+ public RectangleF RectangleToPdf(int page, Rectangle rect)
+ {
+ return _document.RectangleToPdf(TranslatePage(page), rect);
+ }
+
+ public Rectangle RectangleFromPdf(int page, RectangleF rect)
+ {
+ return _document.RectangleFromPdf(TranslatePage(page), rect);
+ }
+
+ private int TranslatePage(int page)
+ {
+ if (page < 0 || page >= PageCount)
+ throw new ArgumentException("Page number out of range");
+ return page + _startPage;
+ }
+
+ public void Dispose()
+ {
+ _document.Dispose();
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PdfiumViewer.Demo.csproj b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PdfiumViewer.Demo.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..b878a3d8a1112c48902d483aec51b7433d2cc70d
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PdfiumViewer.Demo.csproj
@@ -0,0 +1,181 @@
+
+
+
+
+
+ Debug
+ x86
+ 8.0.30703
+ 2.0
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}
+ WinExe
+ Properties
+ PdfiumViewer.Demo
+ PdfiumViewer.Demo
+ v4.6.1
+ 512
+
+
+
+
+
+ true
+ bin\Debug\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ false
+
+
+ bin\Release\
+ TRACE
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ false
+
+
+ true
+ bin\x86\Debug\
+ DEBUG;TRACE
+ full
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+ false
+
+
+ bin\x86\Release\
+ TRACE
+ true
+ pdbonly
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+ false
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ full
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ false
+
+
+ bin\x64\Release\
+ TRACE
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ false
+
+
+
+
+
+
+
+
+
+
+
+ Form
+
+
+ ExportBitmapsForm.cs
+
+
+ Form
+
+
+ MainForm.cs
+
+
+ Form
+
+
+ PageRangeForm.cs
+
+
+
+ Form
+
+
+ PrintMultiplePagesForm.cs
+
+
+
+
+ Form
+
+
+ SearchForm.cs
+
+
+ ExportBitmapsForm.cs
+
+
+ MainForm.cs
+
+
+ PageRangeForm.cs
+
+
+ PrintMultiplePagesForm.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+ SearchForm.cs
+
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+ {438914b6-5d1c-482c-b942-5c0e057eef6f}
+ PdfiumViewer
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PrintMultiplePagesForm.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PrintMultiplePagesForm.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..63c2e44b276aec7ee4a9c70e95eeece55513ddd2
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PrintMultiplePagesForm.Designer.cs
@@ -0,0 +1,199 @@
+namespace PdfiumViewer.Demo
+{
+ partial class PrintMultiplePagesForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this._horizontal = new System.Windows.Forms.TextBox();
+ this.label2 = new System.Windows.Forms.Label();
+ this._vertical = new System.Windows.Forms.TextBox();
+ this.label3 = new System.Windows.Forms.Label();
+ this._margin = new System.Windows.Forms.TextBox();
+ this.groupBox1 = new System.Windows.Forms.GroupBox();
+ this._horizontalOrientation = new System.Windows.Forms.RadioButton();
+ this._verticalOrientation = new System.Windows.Forms.RadioButton();
+ this._acceptButton = new System.Windows.Forms.Button();
+ this._cancelButton = new System.Windows.Forms.Button();
+ this.groupBox1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 15);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(57, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Horizontal:";
+ //
+ // _horizontal
+ //
+ this._horizontal.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this._horizontal.Location = new System.Drawing.Point(86, 12);
+ this._horizontal.Name = "_horizontal";
+ this._horizontal.Size = new System.Drawing.Size(308, 20);
+ this._horizontal.TabIndex = 1;
+ this._horizontal.Text = "2";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Location = new System.Drawing.Point(12, 41);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(45, 13);
+ this.label2.TabIndex = 2;
+ this.label2.Text = "Vertical:";
+ //
+ // _vertical
+ //
+ this._vertical.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this._vertical.Location = new System.Drawing.Point(86, 38);
+ this._vertical.Name = "_vertical";
+ this._vertical.Size = new System.Drawing.Size(308, 20);
+ this._vertical.TabIndex = 3;
+ this._vertical.Text = "2";
+ //
+ // label3
+ //
+ this.label3.AutoSize = true;
+ this.label3.Location = new System.Drawing.Point(12, 67);
+ this.label3.Name = "label3";
+ this.label3.Size = new System.Drawing.Size(42, 13);
+ this.label3.TabIndex = 4;
+ this.label3.Text = "Margin:";
+ //
+ // _margin
+ //
+ this._margin.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this._margin.Location = new System.Drawing.Point(86, 64);
+ this._margin.Name = "_margin";
+ this._margin.Size = new System.Drawing.Size(308, 20);
+ this._margin.TabIndex = 5;
+ this._margin.Text = "5";
+ //
+ // groupBox1
+ //
+ this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this.groupBox1.Controls.Add(this._verticalOrientation);
+ this.groupBox1.Controls.Add(this._horizontalOrientation);
+ this.groupBox1.Location = new System.Drawing.Point(86, 90);
+ this.groupBox1.Name = "groupBox1";
+ this.groupBox1.Size = new System.Drawing.Size(308, 70);
+ this.groupBox1.TabIndex = 6;
+ this.groupBox1.TabStop = false;
+ this.groupBox1.Text = "Orientation";
+ //
+ // _horizontalOrientation
+ //
+ this._horizontalOrientation.AutoSize = true;
+ this._horizontalOrientation.Checked = true;
+ this._horizontalOrientation.Location = new System.Drawing.Point(13, 20);
+ this._horizontalOrientation.Name = "_horizontalOrientation";
+ this._horizontalOrientation.Size = new System.Drawing.Size(72, 17);
+ this._horizontalOrientation.TabIndex = 0;
+ this._horizontalOrientation.TabStop = true;
+ this._horizontalOrientation.Text = "Horizontal";
+ this._horizontalOrientation.UseVisualStyleBackColor = true;
+ //
+ // _verticalOrientation
+ //
+ this._verticalOrientation.AutoSize = true;
+ this._verticalOrientation.Location = new System.Drawing.Point(13, 43);
+ this._verticalOrientation.Name = "_verticalOrientation";
+ this._verticalOrientation.Size = new System.Drawing.Size(60, 17);
+ this._verticalOrientation.TabIndex = 1;
+ this._verticalOrientation.Text = "Vertical";
+ this._verticalOrientation.UseVisualStyleBackColor = true;
+ //
+ // _acceptButton
+ //
+ this._acceptButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this._acceptButton.Location = new System.Drawing.Point(238, 172);
+ this._acceptButton.Name = "_acceptButton";
+ this._acceptButton.Size = new System.Drawing.Size(75, 23);
+ this._acceptButton.TabIndex = 7;
+ this._acceptButton.Text = "Print";
+ this._acceptButton.UseVisualStyleBackColor = true;
+ this._acceptButton.Click += new System.EventHandler(this._acceptButton_Click);
+ //
+ // _cancelButton
+ //
+ this._cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this._cancelButton.Location = new System.Drawing.Point(319, 172);
+ this._cancelButton.Name = "_cancelButton";
+ this._cancelButton.Size = new System.Drawing.Size(75, 23);
+ this._cancelButton.TabIndex = 8;
+ this._cancelButton.Text = "Cancel";
+ this._cancelButton.UseVisualStyleBackColor = true;
+ //
+ // PrintMultiplePagesForm
+ //
+ this.AcceptButton = this._acceptButton;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this._cancelButton;
+ this.ClientSize = new System.Drawing.Size(406, 207);
+ this.Controls.Add(this._cancelButton);
+ this.Controls.Add(this._acceptButton);
+ this.Controls.Add(this.groupBox1);
+ this.Controls.Add(this._margin);
+ this.Controls.Add(this._vertical);
+ this.Controls.Add(this._horizontal);
+ this.Controls.Add(this.label3);
+ this.Controls.Add(this.label2);
+ this.Controls.Add(this.label1);
+ this.Name = "PrintMultiplePagesForm";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Print Multiple Pages";
+ this.groupBox1.ResumeLayout(false);
+ this.groupBox1.PerformLayout();
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox _horizontal;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox _vertical;
+ private System.Windows.Forms.Label label3;
+ private System.Windows.Forms.TextBox _margin;
+ private System.Windows.Forms.GroupBox groupBox1;
+ private System.Windows.Forms.RadioButton _verticalOrientation;
+ private System.Windows.Forms.RadioButton _horizontalOrientation;
+ private System.Windows.Forms.Button _acceptButton;
+ private System.Windows.Forms.Button _cancelButton;
+ }
+}
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PrintMultiplePagesForm.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PrintMultiplePagesForm.cs
new file mode 100644
index 0000000000000000000000000000000000000000..809a3a3e64bdb53f33d4ac7a89890f9c75aa62d5
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PrintMultiplePagesForm.cs
@@ -0,0 +1,65 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer.Demo
+{
+ public partial class PrintMultiplePagesForm : Form
+ {
+ private readonly PdfViewer _viewer;
+
+ public PrintMultiplePagesForm(PdfViewer viewer)
+ {
+ if (viewer == null)
+ throw new ArgumentNullException(nameof(viewer));
+
+ _viewer = viewer;
+
+ InitializeComponent();
+ }
+
+ private void _acceptButton_Click(object sender, EventArgs e)
+ {
+ int horizontal;
+ int vertical;
+ float margin;
+
+ if (!int.TryParse(_horizontal.Text, out horizontal))
+ {
+ MessageBox.Show(this, "Invalid horizontal");
+ }
+ else if (!int.TryParse(_vertical.Text, out vertical))
+ {
+ MessageBox.Show(this, "Invalid vertical");
+ }
+ else if (!float.TryParse(_margin.Text, out margin))
+ {
+ MessageBox.Show(this, "Invalid margin");
+ }
+ else
+ {
+ var settings = new PdfPrintSettings(
+ _viewer.DefaultPrintMode,
+ new PdfPrintMultiplePages(
+ horizontal,
+ vertical,
+ _horizontalOrientation.Checked ? Orientation.Horizontal : Orientation.Vertical,
+ margin
+ )
+ );
+
+ using (var form = new PrintPreviewDialog())
+ {
+ form.Document = _viewer.Document.CreatePrintDocument(settings);
+ form.ShowDialog(this);
+ }
+
+ DialogResult = DialogResult.OK;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PrintMultiplePagesForm.resx b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PrintMultiplePagesForm.resx
new file mode 100644
index 0000000000000000000000000000000000000000..5ea0895e324fa7a86681adc56938bad2f2367ba0
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/PrintMultiplePagesForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Program.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Program.cs
new file mode 100644
index 0000000000000000000000000000000000000000..2a86074b8f746a816de532452bd972e942d74dfb
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Program.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer.Demo
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main()
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+ Application.Run(new MainForm());
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/AssemblyInfo.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000000000000000000000000000000000..138c6a33b1aff31cca1e562414c16073a6a0e5e3
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/AssemblyInfo.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("PdfViewer.Demo")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Pieter van Ginkel")]
+[assembly: AssemblyProduct("PdfViewer.Demo")]
+[assembly: AssemblyCopyright("Pieter van Ginkel © 2012-2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: CLSCompliant(true)]
+[assembly: ComVisible(false)]
+
+[assembly: Guid("975b4cd9-0202-4b28-80a6-faac73629152")]
+
+[assembly: AssemblyVersion("2.11.0.0")]
+[assembly: AssemblyFileVersion("2.11.0.0")]
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Resources.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Resources.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..021a7fb971eda7b95bcc9f20f17b82de69230179
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// このコードはツールによって生成されました。
+// ランタイム バージョン:4.0.30319.42000
+//
+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
+// コードが再生成されるときに損失したりします。
+//
+//------------------------------------------------------------------------------
+
+namespace PdfiumViewer.Demo.Properties {
+ using System;
+
+
+ ///
+ /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
+ ///
+ // このクラスは StronglyTypedResourceBuilder クラスが ResGen
+ // または Visual Studio のようなツールを使用して自動生成されました。
+ // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
+ // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PdfiumViewer.Demo.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
+ /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Resources.resx b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Resources.resx
new file mode 100644
index 0000000000000000000000000000000000000000..ffecec851ab4deae63e81647b4655c7d1fe6dfd7
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Settings.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Settings.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..332fa2a4f800455ef7bbbd1a9e8e2d2d5f4e3cb0
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// このコードはツールによって生成されました。
+// ランタイム バージョン:4.0.30319.42000
+//
+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
+// コードが再生成されるときに損失したりします。
+//
+//------------------------------------------------------------------------------
+
+namespace PdfiumViewer.Demo.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Settings.settings b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Settings.settings
new file mode 100644
index 0000000000000000000000000000000000000000..abf36c5d3d7a33baabb780c9dffef3d804ceb62f
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/SearchForm.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/SearchForm.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..eb293624c1e772bb60920a58584af1531c8248f2
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/SearchForm.Designer.cs
@@ -0,0 +1,145 @@
+namespace PdfiumViewer.Demo
+{
+ partial class SearchForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.label1 = new System.Windows.Forms.Label();
+ this._find = new System.Windows.Forms.TextBox();
+ this._matchCase = new System.Windows.Forms.CheckBox();
+ this._matchWholeWord = new System.Windows.Forms.CheckBox();
+ this._highlightAll = new System.Windows.Forms.CheckBox();
+ this._findPrevious = new System.Windows.Forms.Button();
+ this._findNext = new System.Windows.Forms.Button();
+ this.SuspendLayout();
+ //
+ // label1
+ //
+ this.label1.AutoSize = true;
+ this.label1.Location = new System.Drawing.Point(12, 15);
+ this.label1.Name = "label1";
+ this.label1.Size = new System.Drawing.Size(30, 13);
+ this.label1.TabIndex = 0;
+ this.label1.Text = "Find:";
+ //
+ // _find
+ //
+ this._find.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
+ | System.Windows.Forms.AnchorStyles.Right)));
+ this._find.Location = new System.Drawing.Point(65, 12);
+ this._find.Name = "_find";
+ this._find.Size = new System.Drawing.Size(321, 20);
+ this._find.TabIndex = 1;
+ this._find.TextChanged += new System.EventHandler(this._find_TextChanged);
+ //
+ // _matchCase
+ //
+ this._matchCase.AutoSize = true;
+ this._matchCase.Location = new System.Drawing.Point(65, 38);
+ this._matchCase.Name = "_matchCase";
+ this._matchCase.Size = new System.Drawing.Size(82, 17);
+ this._matchCase.TabIndex = 2;
+ this._matchCase.Text = "Match case";
+ this._matchCase.UseVisualStyleBackColor = true;
+ this._matchCase.CheckedChanged += new System.EventHandler(this._matchCase_CheckedChanged);
+ //
+ // _matchWholeWord
+ //
+ this._matchWholeWord.AutoSize = true;
+ this._matchWholeWord.Location = new System.Drawing.Point(65, 61);
+ this._matchWholeWord.Name = "_matchWholeWord";
+ this._matchWholeWord.Size = new System.Drawing.Size(113, 17);
+ this._matchWholeWord.TabIndex = 3;
+ this._matchWholeWord.Text = "Match whole word";
+ this._matchWholeWord.UseVisualStyleBackColor = true;
+ this._matchWholeWord.CheckedChanged += new System.EventHandler(this._matchWholeWord_CheckedChanged);
+ //
+ // _highlightAll
+ //
+ this._highlightAll.AutoSize = true;
+ this._highlightAll.Location = new System.Drawing.Point(65, 84);
+ this._highlightAll.Name = "_highlightAll";
+ this._highlightAll.Size = new System.Drawing.Size(123, 17);
+ this._highlightAll.TabIndex = 4;
+ this._highlightAll.Text = "Highlight all matches";
+ this._highlightAll.UseVisualStyleBackColor = true;
+ this._highlightAll.CheckedChanged += new System.EventHandler(this._highlightAll_CheckedChanged);
+ //
+ // _findPrevious
+ //
+ this._findPrevious.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this._findPrevious.Location = new System.Drawing.Point(186, 115);
+ this._findPrevious.Name = "_findPrevious";
+ this._findPrevious.Size = new System.Drawing.Size(97, 23);
+ this._findPrevious.TabIndex = 5;
+ this._findPrevious.Text = "Find &Previous";
+ this._findPrevious.UseVisualStyleBackColor = true;
+ this._findPrevious.Click += new System.EventHandler(this._findPrevious_Click);
+ //
+ // _findNext
+ //
+ this._findNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
+ this._findNext.Location = new System.Drawing.Point(289, 115);
+ this._findNext.Name = "_findNext";
+ this._findNext.Size = new System.Drawing.Size(97, 23);
+ this._findNext.TabIndex = 6;
+ this._findNext.Text = "Find &Next";
+ this._findNext.UseVisualStyleBackColor = true;
+ this._findNext.Click += new System.EventHandler(this._findNext_Click);
+ //
+ // SearchForm
+ //
+ this.AcceptButton = this._findNext;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(398, 150);
+ this.Controls.Add(this._findNext);
+ this.Controls.Add(this._findPrevious);
+ this.Controls.Add(this._highlightAll);
+ this.Controls.Add(this._matchWholeWord);
+ this.Controls.Add(this._matchCase);
+ this.Controls.Add(this._find);
+ this.Controls.Add(this.label1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
+ this.Name = "SearchForm";
+ this.Text = "Search";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label label1;
+ private System.Windows.Forms.TextBox _find;
+ private System.Windows.Forms.CheckBox _matchCase;
+ private System.Windows.Forms.CheckBox _matchWholeWord;
+ private System.Windows.Forms.CheckBox _highlightAll;
+ private System.Windows.Forms.Button _findPrevious;
+ private System.Windows.Forms.Button _findNext;
+ }
+}
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/SearchForm.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/SearchForm.cs
new file mode 100644
index 0000000000000000000000000000000000000000..8a4ed930170d4f637d3483fc6a44b4eeca1f5775
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/SearchForm.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer.Demo
+{
+ public partial class SearchForm : Form
+ {
+ private readonly PdfSearchManager _searchManager;
+ private bool _findDirty;
+
+ public SearchForm(PdfRenderer renderer)
+ {
+ if (renderer == null)
+ throw new ArgumentNullException(nameof(renderer));
+
+ InitializeComponent();
+
+ _searchManager = new PdfSearchManager(renderer);
+
+ _matchCase.Checked = _searchManager.MatchCase;
+ _matchWholeWord.Checked = _searchManager.MatchWholeWord;
+ _highlightAll.Checked = _searchManager.HighlightAllMatches;
+ }
+
+ private void _matchCase_CheckedChanged(object sender, EventArgs e)
+ {
+ _findDirty = true;
+ _searchManager.MatchCase = _matchCase.Checked;
+ }
+
+ private void _matchWholeWord_CheckedChanged(object sender, EventArgs e)
+ {
+ _findDirty = true;
+ _searchManager.MatchWholeWord = _matchWholeWord.Checked;
+ }
+
+ private void _highlightAll_CheckedChanged(object sender, EventArgs e)
+ {
+ _searchManager.HighlightAllMatches = _highlightAll.Checked;
+ }
+
+ private void _find_TextChanged(object sender, EventArgs e)
+ {
+ _findDirty = true;
+ }
+
+ private void _findPrevious_Click(object sender, EventArgs e)
+ {
+ Find(false);
+ }
+
+ private void _findNext_Click(object sender, EventArgs e)
+ {
+ Find(true);
+ }
+
+ private void Find(bool forward)
+ {
+ if (_findDirty)
+ {
+ _findDirty = false;
+
+ if (!_searchManager.Search(_find.Text))
+ {
+ MessageBox.Show(this, "No matches found.");
+ return;
+ }
+ }
+
+ if (!_searchManager.FindNext(forward))
+ MessageBox.Show(this, "Find reached the starting point of the search.");
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/SearchForm.resx b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/SearchForm.resx
new file mode 100644
index 0000000000000000000000000000000000000000..5ea0895e324fa7a86681adc56938bad2f2367ba0
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/SearchForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/app.config b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/app.config
new file mode 100644
index 0000000000000000000000000000000000000000..d40509835204c28996481b33fdbf3aee87bf3141
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/app.config
@@ -0,0 +1,3 @@
+
+
+
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/packages.config b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/packages.config
new file mode 100644
index 0000000000000000000000000000000000000000..60ebdc94003b7196fcbe527a7e963a80e5c1402c
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Demo/packages.config
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Test/.gitignore b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..10714b4d2a33e9a66572c72605f0f48c187accae
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/.gitignore
@@ -0,0 +1,4 @@
+/*.suo
+/*.user
+/bin
+/obj
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Test/Example1.pdf b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/Example1.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..ed00f5918b2b89b0931bee78b6d2471a9c44b691
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/Example1.pdf differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Test/Example2.pdf b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/Example2.pdf
new file mode 100644
index 0000000000000000000000000000000000000000..1e6a94561523a4d90967ae6efaa7b6b3785fc47e
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/Example2.pdf differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Test/MultiAppDomainFixture.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/MultiAppDomainFixture.cs
new file mode 100644
index 0000000000000000000000000000000000000000..567c6d39b15c1a0717f32f7b15343fcca29222cd
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/MultiAppDomainFixture.cs
@@ -0,0 +1,130 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading;
+using NUnit.Framework;
+
+namespace PdfiumViewer.Test
+{
+ [TestFixture]
+ public class MultiAppDomainFixture
+ {
+ [Test]
+ public void MultipleAppDomains()
+ {
+ RunThreads();
+ }
+
+ [Test]
+ public void MultipleAppDomainsAndCurrent()
+ {
+ using (var runner = new Runner())
+ {
+ runner.Run();
+
+ RunThreads();
+ }
+ }
+
+ private void RunThreads()
+ {
+ const int scripts = 10;
+ const int iterations = 20;
+ var threads = new List();
+
+ for (int i = 0; i < scripts; i++)
+ {
+ var thread = new Thread(() =>
+ {
+ try
+ {
+ for (int j = 0; j < iterations; j++)
+ {
+ using (var runner = new Runner())
+ {
+ runner.Run();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(ex);
+ Console.WriteLine(ex.StackTrace);
+ }
+ });
+
+ threads.Add(thread);
+ thread.Start();
+ }
+
+ foreach (var thread in threads)
+ {
+ thread.Join();
+ }
+ }
+
+ private class Script : MarshalByRefObject
+ {
+ public void Run()
+ {
+ using (var stream = typeof(MultiAppDomainFixture).Assembly.GetManifestResourceStream(
+ typeof(MultiAppDomainFixture).Namespace + ".Example" + (new Random().Next(2) + 1) + ".pdf"
+ ))
+ {
+ var document = PdfDocument.Load(stream);
+
+ for (int i = 0; i < document.PageCount; i++)
+ {
+ using (document.Render(i, 96, 96, false))
+ {
+ }
+ }
+ }
+ }
+ }
+
+ private class Runner : IDisposable
+ {
+ private bool _disposed;
+ private AppDomain _appDomain;
+
+ public Runner()
+ {
+ _appDomain = AppDomain.CreateDomain(
+ "Unit test",
+ AppDomain.CurrentDomain.Evidence,
+ new AppDomainSetup
+ {
+ ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase,
+ ApplicationName = "Unit test"
+ }
+ );
+ }
+
+ public void Run()
+ {
+ var script = (Script)_appDomain.CreateInstanceAndUnwrap(
+ typeof(Script).Assembly.FullName,
+ typeof(Script).FullName
+ );
+
+ script.Run();
+ }
+
+ public void Dispose()
+ {
+ if (!_disposed)
+ {
+ if (_appDomain != null)
+ {
+ AppDomain.Unload(_appDomain);
+ _appDomain = null;
+ }
+
+ _disposed = true;
+ }
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Test/PdfiumViewer.Test.csproj b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/PdfiumViewer.Test.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..c10d65d8245b7d1b17addc3c930238fcbf35e5a9
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/PdfiumViewer.Test.csproj
@@ -0,0 +1,68 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}
+ Library
+ Properties
+ PdfiumViewer.Test
+ PdfiumViewer.Test
+ v4.0
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\NUnit.2.6.4\lib\nunit.framework.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {438914b6-5d1c-482c-b942-5c0e057eef6f}
+ PdfiumViewer
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Test/Properties/AssemblyInfo.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000000000000000000000000000000000..61930bccba60252fe7154888ca8c77124f27a455
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("PdfiumViewer.Test")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("PdfiumViewer.Test")]
+[assembly: AssemblyCopyright("Copyright © 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("6593d801-664d-4848-bcde-1602ba7b4908")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.Test/packages.config b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/packages.config
new file mode 100644
index 0000000000000000000000000000000000000000..512ce05d0dbf09ee1683a56c8cc1d3049c9b9f7f
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.Test/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/.gitignore b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..3b43a2fd5a19ebfc5514160d784aae8c5ad71309
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/.gitignore
@@ -0,0 +1,5 @@
+/*.suo
+/*.user
+/bin
+/obj
+/*.nupkg
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/App.config b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/App.config
new file mode 100644
index 0000000000000000000000000000000000000000..8e15646352ec1d9a84bbc6504ef6b46e16bf7823
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/App.xaml b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/App.xaml
new file mode 100644
index 0000000000000000000000000000000000000000..8a3d80c3c1205cb4cda9feeadb0db2f9346d01b8
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/App.xaml.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/App.xaml.cs
new file mode 100644
index 0000000000000000000000000000000000000000..39b2cc8ae09c78796633f9fe7b0631b20ff55cfc
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace PdfiumViewer.WPFDemo
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/BitmapHelper.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/BitmapHelper.cs
new file mode 100644
index 0000000000000000000000000000000000000000..94d9991b0f5b6cd628c611bcb3a0a76d5f37aeb6
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/BitmapHelper.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Windows.Media.Imaging;
+using System.Drawing;
+using System.Windows.Media;
+
+namespace PdfiumViewer.WPFDemo
+{
+ internal class BitmapHelper
+ {
+
+ public static BitmapSource ToBitmapSource(Image image)
+ {
+ return ToBitmapSource(image as Bitmap);
+ }
+
+ ///
+ /// Convert an IImage to a WPF BitmapSource. The result can be used in the Set Property of Image.Source
+ ///
+ /// The Source Bitmap
+ /// The equivalent BitmapSource
+ public static BitmapSource ToBitmapSource(System.Drawing.Bitmap bitmap)
+ {
+ if (bitmap == null) return null;
+
+ using (System.Drawing.Bitmap source = (System.Drawing.Bitmap)bitmap.Clone())
+ {
+ IntPtr ptr = source.GetHbitmap(); //obtain the Hbitmap
+
+ BitmapSource bs = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
+ ptr,
+ IntPtr.Zero,
+ System.Windows.Int32Rect.Empty,
+ System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
+
+ NativeMethods.DeleteObject(ptr); //release the HBitmap
+ bs.Freeze();
+ return bs;
+ }
+ }
+
+ public static BitmapSource ToBitmapSource(byte[] bytes, int width, int height, int dpiX, int dpiY)
+ {
+ var result = BitmapSource.Create(
+ width,
+ height,
+ dpiX,
+ dpiY,
+ PixelFormats.Bgra32,
+ null /* palette */,
+ bytes,
+ width * 4 /* stride */);
+ result.Freeze();
+
+ return result;
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/MainWindow.xaml b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/MainWindow.xaml
new file mode 100644
index 0000000000000000000000000000000000000000..924b81b1cde0056902bcabd8ca2327aadb6c85fa
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/MainWindow.xaml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/MainWindow.xaml.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/MainWindow.xaml.cs
new file mode 100644
index 0000000000000000000000000000000000000000..9055c3002c68a3ee35f3f5696183cb02dd3edcd7
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/MainWindow.xaml.cs
@@ -0,0 +1,136 @@
+using System;
+using System.Diagnostics;
+using System.Text;
+using System.Threading;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media.Imaging;
+
+namespace PdfiumViewer.WPFDemo
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ CancellationTokenSource tokenSource;
+ Process currentProcess = Process.GetCurrentProcess();
+ PdfDocument pdfDoc;
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+ private async void RenderToMemDCButton_Click(object sender, RoutedEventArgs e)
+ {
+ if (pdfDoc == null)
+ {
+ MessageBox.Show("First load the document");
+ return;
+ }
+
+ int width = (int)(this.ActualWidth - 30) / 2;
+ int height = (int)this.ActualHeight - 30;
+
+ Stopwatch sw = new Stopwatch();
+ sw.Start();
+
+ try
+ {
+ for (int i = 1; i < pdfDoc.PageCount; i++)
+ {
+ imageMemDC.Source =
+ await
+ Task.Run(
+ new Func(
+ () =>
+ {
+ tokenSource.Token.ThrowIfCancellationRequested();
+
+ return RenderPageToMemDC(i, width, height);
+ }
+ ), tokenSource.Token);
+
+ labelMemDC.Content = String.Format("Renderd Pages: {0}, Memory: {1} MB, Time: {2:0.0} sec",
+ i,
+ currentProcess.PrivateMemorySize64 / (1024 * 1024),
+ sw.Elapsed.TotalSeconds);
+
+ currentProcess.Refresh();
+
+ GC.Collect();
+ }
+ }
+ catch (Exception ex)
+ {
+ tokenSource.Cancel();
+ MessageBox.Show(ex.Message);
+ }
+
+ sw.Stop();
+ labelMemDC.Content = String.Format("Rendered {0} Pages within {1:0.0} seconds, Memory: {2} MB",
+ pdfDoc.PageCount,
+ sw.Elapsed.TotalSeconds,
+ currentProcess.PrivateMemorySize64 / (1024 * 1024));
+ }
+
+ private BitmapSource RenderPageToMemDC(int page, int width, int height)
+ {
+ var image = pdfDoc.Render(page, width, height, 96, 96, false);
+ return BitmapHelper.ToBitmapSource(image);
+ }
+
+ private void LoadPDFButton_Click(object sender, RoutedEventArgs e)
+ {
+ using (var dialog = new System.Windows.Forms.OpenFileDialog())
+ {
+ dialog.Filter = "PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.*";
+ dialog.Title = "Open PDF File";
+
+ if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ {
+ pdfDoc = PdfDocument.Load(dialog.FileName);
+ }
+ }
+ }
+
+ private void Window_Loaded(object sender, RoutedEventArgs e)
+ {
+ tokenSource = new CancellationTokenSource();
+ }
+
+ private void Window_Closed(object sender, EventArgs e)
+ {
+ if (tokenSource != null)
+ tokenSource.Cancel();
+
+ if (pdfDoc != null)
+ pdfDoc.Dispose();
+ }
+
+ private void DoSearch_Click(object sender, RoutedEventArgs e)
+ {
+ string text = searchValueTextBox.Text;
+ bool matchCase = matchCaseCheckBox.IsChecked.GetValueOrDefault();
+ bool wholeWordOnly = wholeWordOnlyCheckBox.IsChecked.GetValueOrDefault();
+
+ DoSearch(text, matchCase, wholeWordOnly);
+ }
+
+ private void DoSearch(string text, bool matchCase, bool wholeWord)
+ {
+ var matches = pdfDoc.Search(text, matchCase, wholeWord);
+ var sb = new StringBuilder();
+
+ foreach (var match in matches.Items)
+ {
+ sb.AppendLine(
+ String.Format(
+ "Found \"{0}\" in page: {1}", match.Text, match.Page)
+ );
+ }
+
+ searchResultLabel.Text = sb.ToString();
+ }
+
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/NativeMethods.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/NativeMethods.cs
new file mode 100644
index 0000000000000000000000000000000000000000..d3d25056d808c139af1e0b0b42d5d72925297ca1
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/NativeMethods.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PdfiumViewer.WPFDemo
+{
+ internal static class NativeMethods
+ {
+ [DllImport("gdi32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool DeleteObject([In] IntPtr hObject);
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/PdfiumViewer.WPFDemo.csproj b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/PdfiumViewer.WPFDemo.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..614d2b7d3c31188f8cc120ad9a4a1aa55c2bf808
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/PdfiumViewer.WPFDemo.csproj
@@ -0,0 +1,154 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}
+ WinExe
+ Properties
+ PdfiumViewer.WPFDemo
+ PdfiumViewer.WPFDemo
+ v4.5
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ true
+ bin\x86\Debug\
+ DEBUG;TRACE
+ full
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\x86\Release\
+ TRACE
+ true
+ pdbonly
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE
+ full
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+ bin\x64\Release\
+ TRACE
+ true
+ pdbonly
+ x64
+ prompt
+ MinimumRecommendedRules.ruleset
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+ {438914b6-5d1c-482c-b942-5c0e057eef6f}
+ PdfiumViewer
+
+
+
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/AssemblyInfo.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000000000000000000000000000000000..1cdc67fa38660842feeeb8a91f7f6aa2da7c2ef9
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("PdfiumViewer.WPFDemo")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("IRISTED")]
+[assembly: AssemblyProduct("PdfiumViewer.WPFDemo")]
+[assembly: AssemblyCopyright("Copyright © 2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+//In order to begin building localizable applications, set
+//CultureYouAreCodingWith in your .csproj file
+//inside a . For example, if you are using US english
+//in your source files, set the to en-US. Then uncomment
+//the NeutralResourceLanguage attribute below. Update the "en-US" in
+//the line below to match the UICulture setting in the project file.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
+
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Resources.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Resources.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..0c40e3a1f80b0f07717b2d88e13697e88f9bd265
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.36323
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace PdfiumViewer.WPFDemo.Properties
+{
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PdfiumViewer.WPFDemo.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Resources.resx b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Resources.resx
new file mode 100644
index 0000000000000000000000000000000000000000..af7dbebbacef595e3089c01c05671016c21a8304
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Settings.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Settings.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..638c15f405b6eba9b80b44837e068e1f8d17dcf7
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.36323
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace PdfiumViewer.WPFDemo.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Settings.settings b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Settings.settings
new file mode 100644
index 0000000000000000000000000000000000000000..033d7a5e9e2266753180f4e3a9299f575046701e
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.WPFDemo/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer.sln b/root/cli/PdfiumViewer-master/PdfiumViewer.sln
new file mode 100644
index 0000000000000000000000000000000000000000..f21b44c2c82bf10c2d8275c63a2f6d3400ffe401
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer.sln
@@ -0,0 +1,75 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25420.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PdfiumViewer", "PdfiumViewer\PdfiumViewer.csproj", "{438914B6-5D1C-482C-B942-5C0E057EEF6F}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PdfiumViewer.Demo", "PdfiumViewer.Demo\PdfiumViewer.Demo.csproj", "{ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PdfiumViewer.WPFDemo", "PdfiumViewer.WPFDemo\PdfiumViewer.WPFDemo.csproj", "{CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PdfiumViewer.Test", "PdfiumViewer.Test\PdfiumViewer.Test.csproj", "{61083268-3F14-47B7-8753-AF69BB3D0891}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Debug|x64.Build.0 = Debug|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Debug|x86.Build.0 = Debug|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Release|x64.ActiveCfg = Release|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Release|x64.Build.0 = Release|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Release|x86.ActiveCfg = Release|Any CPU
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}.Release|x86.Build.0 = Release|Any CPU
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Debug|x64.ActiveCfg = Debug|x64
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Debug|x64.Build.0 = Debug|x64
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Debug|x86.ActiveCfg = Debug|x86
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Debug|x86.Build.0 = Debug|x86
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Release|x64.ActiveCfg = Release|x64
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Release|x64.Build.0 = Release|x64
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Release|x86.ActiveCfg = Release|Any CPU
+ {ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}.Release|x86.Build.0 = Release|Any CPU
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Debug|x64.ActiveCfg = Debug|x64
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Debug|x64.Build.0 = Debug|x64
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Debug|x86.ActiveCfg = Debug|x86
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Debug|x86.Build.0 = Debug|x86
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Release|Any CPU.Build.0 = Release|Any CPU
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Release|x64.ActiveCfg = Release|x64
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Release|x64.Build.0 = Release|x64
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Release|x86.ActiveCfg = Release|x86
+ {CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}.Release|x86.Build.0 = Release|x86
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Debug|x64.Build.0 = Debug|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Debug|x86.Build.0 = Debug|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Release|Any CPU.Build.0 = Release|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Release|x64.ActiveCfg = Release|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Release|x64.Build.0 = Release|Any CPU
+ {61083268-3F14-47B7-8753-AF69BB3D0891}.Release|x86.ActiveCfg = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/.gitignore b/root/cli/PdfiumViewer-master/PdfiumViewer/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..3b43a2fd5a19ebfc5514160d784aae8c5ad71309
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/.gitignore
@@ -0,0 +1,5 @@
+/*.suo
+/*.user
+/bin
+/obj
+/*.nupkg
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/CustomScrollControl.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/CustomScrollControl.cs
new file mode 100644
index 0000000000000000000000000000000000000000..b8f167e92ec47dd10356796fb7959af463b0340f
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/CustomScrollControl.cs
@@ -0,0 +1,754 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Runtime.InteropServices;
+using System.Security.Permissions;
+using System.Text;
+using System.Windows.Forms;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public class CustomScrollControl : Control
+ {
+ private Size _displaySize;
+ private Rectangle _displayRect;
+ private readonly ScrollProperties _verticalScroll;
+ private readonly ScrollProperties _horizontalScroll;
+
+ public event ScrollEventHandler Scroll;
+
+ protected virtual void OnScroll(ScrollEventArgs se)
+ {
+ var ev = Scroll;
+
+ if (ev != null)
+ ev(this, se);
+ }
+
+ public event EventHandler DisplayRectangleChanged;
+
+ protected virtual void OnDisplayRectangleChanged(EventArgs e)
+ {
+ var ev = DisplayRectangleChanged;
+ if (ev != null)
+ ev(this, e);
+ }
+
+ public event SetCursorEventHandler SetCursor;
+
+ protected virtual void OnSetCursor(SetCursorEventArgs e)
+ {
+ var handler = SetCursor;
+ if (handler != null)
+ handler(this, e);
+ }
+
+ protected override CreateParams CreateParams
+ {
+ get
+ {
+ CreateParams cp = base.CreateParams;
+
+ if (HScroll || _horizontalScroll.Visible)
+ cp.Style |= NativeMethods.WS_HSCROLL;
+ else
+ cp.Style &= (~NativeMethods.WS_HSCROLL);
+ if (VScroll || _verticalScroll.Visible)
+ cp.Style |= NativeMethods.WS_VSCROLL;
+ else
+ cp.Style &= (~NativeMethods.WS_VSCROLL);
+
+ return cp;
+ }
+ }
+
+ public override Rectangle DisplayRectangle
+ {
+ get
+ {
+ Rectangle rect = ClientRectangle;
+
+ if (!_displayRect.IsEmpty)
+ {
+ rect.X = _displayRect.X;
+ rect.Y = _displayRect.Y;
+
+ if (HScroll)
+ rect.Width = _displayRect.Width;
+ if (VScroll)
+ rect.Height = _displayRect.Height;
+ }
+
+ return rect;
+ }
+ }
+
+ [Browsable(false)]
+ public bool HScroll { get; private set; }
+
+ [Browsable(false)]
+ public bool VScroll { get; private set; }
+
+ public CustomScrollControl()
+ {
+ SetStyle(ControlStyles.ContainerControl, true);
+ SetStyle(ControlStyles.AllPaintingInWmPaint, false);
+
+ _horizontalScroll = new ScrollProperties(this, NativeMethods.SB_HORZ);
+ _verticalScroll = new ScrollProperties(this, NativeMethods.SB_VERT);
+ }
+
+ protected void SetDisplaySize(Size size)
+ {
+ if (_displaySize != size)
+ {
+ _displaySize = size;
+
+ AdjustFormScrollbars();
+ }
+ }
+
+ private void AdjustFormScrollbars()
+ {
+ if (ApplyScrollbarChanges())
+ PerformLayout();
+ }
+
+ private bool ApplyScrollbarChanges()
+ {
+ var fullClient = ClientRectangle;
+ var minClient = fullClient;
+
+ if (HScroll)
+ fullClient.Height += SystemInformation.HorizontalScrollBarHeight;
+ else
+ minClient.Height -= SystemInformation.HorizontalScrollBarHeight;
+
+ if (VScroll)
+ fullClient.Width += SystemInformation.VerticalScrollBarWidth;
+ else
+ minClient.Width -= SystemInformation.VerticalScrollBarWidth;
+
+ int maxX = _displaySize.Width;
+ int maxY = _displaySize.Height;
+
+ // Check maxX/maxY against the clientRect, we must compare it to the
+ // clientRect without any scrollbars, and then we can check it against
+ // the clientRect with the "new" scrollbars. This will make the
+ // scrollbars show and hide themselves correctly at the boundaries.
+ //
+ bool needHscroll = maxX > fullClient.Width;
+ bool needVscroll = maxY > fullClient.Height;
+
+ var clientToBe = fullClient;
+
+ if (needHscroll)
+ clientToBe.Height -= SystemInformation.HorizontalScrollBarHeight;
+ if (needVscroll)
+ clientToBe.Width -= SystemInformation.VerticalScrollBarWidth;
+
+ if (needHscroll && maxY > clientToBe.Height)
+ needVscroll = true;
+ if (needVscroll && maxX > clientToBe.Width)
+ needHscroll = true;
+
+ if (!needHscroll)
+ maxX = clientToBe.Width;
+ if (!needVscroll)
+ maxY = clientToBe.Height;
+
+ bool needLayout = SetVisibleScrollbars(needHscroll, needVscroll);
+
+ if (HScroll || VScroll)
+ needLayout = (SetDisplayRectangleSize(maxX, maxY) || needLayout);
+ else
+ SetDisplayRectangleSize(maxX, maxY);
+
+ SyncScrollbars();
+
+ return needLayout;
+ }
+
+ protected override void OnLayout(LayoutEventArgs levent)
+ {
+ AdjustFormScrollbars();
+
+ base.OnLayout(levent);
+ }
+
+ protected override void OnMouseWheel(MouseEventArgs e)
+ {
+ // Favor the vertical scroll bar, since it's the most
+ // common use. However, if there isn't a vertical
+ // scroll and the horizontal is on, then wheel it around.
+
+ if (VScroll)
+ {
+ var client = ClientRectangle;
+ int pos = -_displayRect.Y;
+ int maxPos = -(client.Height - _displayRect.Height);
+
+ pos = Math.Max(pos - e.Delta, 0);
+ pos = Math.Min(pos, maxPos);
+
+ SetDisplayRectLocation(_displayRect.X, -pos);
+ SyncScrollbars();
+
+ if (e is HandledMouseEventArgs)
+ ((HandledMouseEventArgs)e).Handled = true;
+ }
+ else if (HScroll)
+ {
+ var client = ClientRectangle;
+ int pos = -_displayRect.X;
+ int maxPos = -(client.Width - _displayRect.Width);
+
+ pos = Math.Max(pos - e.Delta, 0);
+ pos = Math.Min(pos, maxPos);
+
+ SetDisplayRectLocation(-pos, _displayRect.Y);
+ SyncScrollbars();
+
+ if (e is HandledMouseEventArgs)
+ ((HandledMouseEventArgs)e).Handled = true;
+ }
+
+ base.OnMouseWheel(e);
+ }
+
+ protected override void OnVisibleChanged(EventArgs e)
+ {
+ if (Visible)
+ PerformLayout();
+
+ base.OnVisibleChanged(e);
+ }
+
+ public void SetDisplayRectLocation(Point offset)
+ {
+ SetDisplayRectLocation(offset, true);
+ }
+
+ public void SetDisplayRectLocation(Point offset, bool preserveContents)
+ {
+ SetDisplayRectLocation(offset.X, offset.Y, preserveContents);
+ SyncScrollbars();
+ }
+
+ private void SetDisplayRectLocation(int x, int y)
+ {
+ SetDisplayRectLocation(x, y, true);
+ }
+
+ private void SetDisplayRectLocation(int x, int y, bool preserveContents)
+ {
+ int xDelta = 0;
+ int yDelta = 0;
+
+ var client = ClientRectangle;
+ var displayRectangle = _displayRect;
+ int minX = Math.Min(client.Width - displayRectangle.Width, 0);
+ int minY = Math.Min(client.Height - displayRectangle.Height, 0);
+
+ if (x > 0)
+ x = 0;
+ if (x < minX)
+ x = minX;
+ if (y > 0)
+ y = 0;
+ if (y < minY)
+ y = minY;
+
+ if (displayRectangle.X != x)
+ xDelta = x - displayRectangle.X;
+ if (displayRectangle.Y != y)
+ yDelta = y - displayRectangle.Y;
+
+ _displayRect.X = x;
+ _displayRect.Y = y;
+
+ if ((xDelta != 0 || yDelta != 0) && IsHandleCreated && preserveContents)
+ {
+ var cr = ClientRectangle;
+ var rcClip = new NativeMethods.RECT(cr);
+ var rcUpdate = new NativeMethods.RECT(cr);
+
+ NativeMethods.ScrollWindowEx(
+ new HandleRef(this, Handle), xDelta, yDelta,
+ IntPtr.Zero,
+ ref rcClip,
+ IntPtr.Zero,
+ ref rcUpdate,
+ NativeMethods.SW_INVALIDATE | NativeMethods.SW_SCROLLCHILDREN
+ );
+ }
+
+ OnDisplayRectangleChanged(EventArgs.Empty);
+ }
+
+ private int ScrollThumbPosition(int fnBar)
+ {
+ var si = new NativeMethods.SCROLLINFO
+ {
+ fMask = NativeMethods.SIF_TRACKPOS
+ };
+
+ NativeMethods.GetScrollInfo(new HandleRef(this, Handle), fnBar, si);
+
+ return si.nTrackPos;
+ }
+
+ private void ResetScrollProperties(ScrollProperties scrollProperties)
+ {
+ // Set only these two values as when the ScrollBars are not visible ...
+ // there is no meaning of the "value" property.
+
+ scrollProperties.Visible = false;
+ scrollProperties.Value = 0;
+ }
+
+ private bool SetVisibleScrollbars(bool horiz, bool vert)
+ {
+ bool needLayout = !horiz && HScroll || horiz && !HScroll || !vert && VScroll || vert && !VScroll;
+
+ if (needLayout)
+ {
+ int x = _displayRect.X;
+ int y = _displayRect.Y;
+
+ if (!horiz)
+ x = 0;
+ if (!vert)
+ y = 0;
+
+ SetDisplayRectLocation(x, y);
+ HScroll = horiz;
+ VScroll = vert;
+
+ //Update the visible member of ScrollBars....
+ if (horiz)
+ _horizontalScroll.Visible = true;
+ else
+ ResetScrollProperties(_horizontalScroll);
+ if (vert)
+ _verticalScroll.Visible = true;
+ else
+ ResetScrollProperties(_verticalScroll);
+
+ UpdateStyles();
+ }
+
+ return needLayout;
+ }
+
+ private bool SetDisplayRectangleSize(int width, int height)
+ {
+ bool needLayout = false;
+
+ double hScale = (double)width / _displayRect.Height;
+ double vScale = (double)height / _displayRect.Height;
+
+ if (_displayRect.Width != width || _displayRect.Height != height)
+ {
+ _displayRect.Width = width;
+ _displayRect.Height = height;
+
+ needLayout = true;
+ }
+
+ int minX = ClientRectangle.Width - width;
+ int minY = ClientRectangle.Height - height;
+
+ if (minX > 0)
+ minX = 0;
+ if (minY > 0)
+ minY = 0;
+
+ int x = (int)(_displayRect.X * hScale);
+ int y = (int)(_displayRect.Y * vScale);
+
+ if (!HScroll || x > 0)
+ x = 0;
+ if (!VScroll || y > 0)
+ y = 0;
+
+ if (x < minX)
+ x = minX;
+ if (y < minY)
+ y = minY;
+
+ SetDisplayRectLocation(x, y);
+
+ return needLayout;
+ }
+
+ private void SyncScrollbars()
+ {
+ Rectangle displayRect = _displayRect;
+
+ if (!IsHandleCreated)
+ return;
+
+ if (HScroll)
+ {
+ _horizontalScroll.Maximum = displayRect.Width - 1;
+ _horizontalScroll.LargeChange = ClientRectangle.Width;
+ _horizontalScroll.SmallChange = 5;
+
+ if (-displayRect.X >= 0 && -displayRect.X < _horizontalScroll.Maximum)
+ _horizontalScroll.Value = -displayRect.X;
+
+ _horizontalScroll.UpdateScrollInfo();
+ }
+
+ if (VScroll)
+ {
+ _verticalScroll.Maximum = displayRect.Height - 1;
+ _verticalScroll.LargeChange = ClientRectangle.Height;
+ _verticalScroll.SmallChange = 5;
+
+ if (-displayRect.Y >= 0 && -displayRect.Y < _verticalScroll.Maximum)
+ _verticalScroll.Value = -displayRect.Y;
+
+ _verticalScroll.UpdateScrollInfo();
+ }
+ }
+
+ private void WmHScroll(ref System.Windows.Forms.Message m)
+ {
+ if (m.LParam != IntPtr.Zero)
+ {
+ base.WndProc(ref m);
+ return;
+ }
+
+ int pos = -_displayRect.X;
+ int oldValue = pos;
+
+ switch (NativeMethods.Util.LOWORD(m.WParam))
+ {
+ case NativeMethods.SB_THUMBPOSITION:
+ case NativeMethods.SB_THUMBTRACK:
+ SetDisplayRectLocation(
+ -ScrollThumbPosition(NativeMethods.SB_HORZ),
+ _displayRect.Y
+ );
+ SyncScrollbars();
+ break;
+
+ case NativeMethods.SB_LINEUP:
+ PerformScroll(ScrollAction.LineUp, Orientation.Horizontal);
+ break;
+
+ case NativeMethods.SB_LINEDOWN:
+ PerformScroll(ScrollAction.LineDown, Orientation.Horizontal);
+ break;
+
+ case NativeMethods.SB_PAGEUP:
+ PerformScroll(ScrollAction.PageUp, Orientation.Horizontal);
+ break;
+
+ case NativeMethods.SB_PAGEDOWN:
+ PerformScroll(ScrollAction.PageDown, Orientation.Horizontal);
+ break;
+
+ case NativeMethods.SB_LEFT:
+ PerformScroll(ScrollAction.Home, Orientation.Horizontal);
+ break;
+
+ case NativeMethods.SB_RIGHT:
+ PerformScroll(ScrollAction.End, Orientation.Horizontal);
+ break;
+ }
+
+ WmOnScroll(ref m, oldValue, pos, ScrollOrientation.HorizontalScroll);
+ }
+
+ private void WmVScroll(ref System.Windows.Forms.Message m)
+ {
+ if (m.LParam != IntPtr.Zero)
+ {
+ base.WndProc(ref m);
+ return;
+ }
+
+ int pos = -_displayRect.Y;
+ int oldValue = pos;
+
+ switch (NativeMethods.Util.LOWORD(m.WParam))
+ {
+ case NativeMethods.SB_THUMBPOSITION:
+ case NativeMethods.SB_THUMBTRACK:
+ SetDisplayRectLocation(
+ _displayRect.X,
+ -ScrollThumbPosition(NativeMethods.SB_VERT)
+ );
+ SyncScrollbars();
+ break;
+
+ case NativeMethods.SB_LINEUP:
+ PerformScroll(ScrollAction.LineUp, Orientation.Vertical);
+ break;
+
+ case NativeMethods.SB_LINEDOWN:
+ PerformScroll(ScrollAction.LineDown, Orientation.Vertical);
+ break;
+
+ case NativeMethods.SB_PAGEUP:
+ PerformScroll(ScrollAction.PageUp, Orientation.Vertical);
+ break;
+
+ case NativeMethods.SB_PAGEDOWN:
+ PerformScroll(ScrollAction.PageDown, Orientation.Vertical);
+ break;
+
+ case NativeMethods.SB_TOP:
+ PerformScroll(ScrollAction.Home, Orientation.Vertical);
+ break;
+
+ case NativeMethods.SB_BOTTOM:
+ PerformScroll(ScrollAction.End, Orientation.Vertical);
+ break;
+ }
+
+ WmOnScroll(ref m, oldValue, pos, ScrollOrientation.VerticalScroll);
+ }
+
+ public void PerformScroll(ScrollAction action, Orientation scrollBar)
+ {
+ if (scrollBar == Orientation.Horizontal)
+ {
+ int pos = -_displayRect.X;
+ int maxPos = _horizontalScroll.Maximum;
+
+ switch (action)
+ {
+ case ScrollAction.LineUp:
+ if (pos > _horizontalScroll.SmallChange)
+ pos -= _horizontalScroll.SmallChange;
+ else
+ pos = 0;
+ break;
+
+ case ScrollAction.LineDown:
+ if (pos < maxPos - _horizontalScroll.SmallChange)
+ pos += _horizontalScroll.SmallChange;
+ else
+ pos = maxPos;
+ break;
+
+ case ScrollAction.PageUp:
+ if (pos > _horizontalScroll.LargeChange)
+ pos -= _horizontalScroll.LargeChange;
+ else
+ pos = 0;
+ break;
+
+ case ScrollAction.PageDown:
+ if (pos < maxPos - _horizontalScroll.LargeChange)
+ pos += _horizontalScroll.LargeChange;
+ else
+ pos = maxPos;
+ break;
+
+ case ScrollAction.Home:
+ pos = 0;
+ break;
+
+ case ScrollAction.End:
+ pos = maxPos;
+ break;
+ }
+
+ SetDisplayRectLocation(-pos, _displayRect.Y);
+ }
+ else
+ {
+ int pos = -_displayRect.Y;
+ int maxPos = _verticalScroll.Maximum;
+
+ switch (action)
+ {
+ case ScrollAction.LineUp:
+ if (pos > 0)
+ pos -= _verticalScroll.SmallChange;
+ else
+ pos = 0;
+ break;
+
+ case ScrollAction.LineDown:
+ if (pos < maxPos - _verticalScroll.SmallChange)
+ pos += _verticalScroll.SmallChange;
+ else
+ pos = maxPos;
+ break;
+
+ case ScrollAction.PageUp:
+ if (pos > _verticalScroll.LargeChange)
+ pos -= _verticalScroll.LargeChange;
+ else
+ pos = 0;
+ break;
+
+ case ScrollAction.PageDown:
+ if (pos < maxPos - _verticalScroll.LargeChange)
+ pos += _verticalScroll.LargeChange;
+ else
+ pos = maxPos;
+ break;
+
+ case ScrollAction.Home:
+ pos = 0;
+ break;
+
+ case ScrollAction.End:
+ pos = maxPos;
+ break;
+ }
+
+ SetDisplayRectLocation(_displayRect.X, -pos);
+ }
+
+ SyncScrollbars();
+ }
+
+ private void WmOnScroll(ref System.Windows.Forms.Message m, int oldValue, int value, ScrollOrientation scrollOrientation)
+ {
+ var type = (ScrollEventType)NativeMethods.Util.LOWORD(m.WParam);
+
+ if (type != ScrollEventType.EndScroll)
+ OnScroll(new ScrollEventArgs(type, oldValue, value, scrollOrientation));
+ }
+
+ [EditorBrowsable(EditorBrowsableState.Advanced)]
+ [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
+ protected override void WndProc(ref System.Windows.Forms.Message m)
+ {
+ switch (m.Msg)
+ {
+ case NativeMethods.WM_VSCROLL:
+ WmVScroll(ref m);
+ break;
+
+ case NativeMethods.WM_HSCROLL:
+ WmHScroll(ref m);
+ break;
+
+ case NativeMethods.WM_SETCURSOR:
+ WmSetCursor(ref m);
+ break;
+
+
+ default:
+ base.WndProc(ref m);
+ break;
+ }
+ }
+
+ private void WmSetCursor(ref Message m)
+ {
+ var e = new SetCursorEventArgs(
+ PointToClient(Cursor.Position),
+ (HitTest)(m.LParam.ToInt32() & 0xffff)
+ );
+ OnSetCursor(e);
+ Cursor.Current = e.Cursor ?? Cursor;
+ }
+
+ ///
+ /// Determines whether the specified key is a regular input key or a special key that requires preprocessing.
+ ///
+ ///
+ /// true if the specified key is a regular input key; otherwise, false.
+ ///
+ /// One of the values.
+ protected override bool IsInputKey(Keys keyData)
+ {
+ switch ((keyData) & Keys.KeyCode)
+ {
+ case Keys.Up:
+ PerformScroll(ScrollAction.LineUp, Orientation.Vertical);
+ return true;
+
+ case Keys.Down:
+ PerformScroll(ScrollAction.LineDown, Orientation.Vertical);
+ return true;
+
+ case Keys.PageUp:
+ PerformScroll(ScrollAction.PageUp, Orientation.Vertical);
+ return true;
+
+ case Keys.PageDown:
+ PerformScroll(ScrollAction.PageDown, Orientation.Vertical);
+ return true;
+
+ case Keys.Home:
+ PerformScroll(ScrollAction.Home, Orientation.Vertical);
+ return true;
+
+ case Keys.End:
+ PerformScroll(ScrollAction.End, Orientation.Vertical);
+ return true;
+
+ default:
+ return base.IsInputKey(keyData);
+ }
+ }
+
+ private class ScrollProperties
+ {
+ private int _smallChange = 1;
+ private int _largeChange = 10;
+ private readonly int _orientation;
+ private readonly CustomScrollControl _parentControl;
+
+ public ScrollProperties(CustomScrollControl container, int orientation)
+ {
+ _parentControl = container;
+ _orientation = orientation;
+
+ Maximum = 100;
+ }
+
+ public int Maximum { get; set; }
+
+ public int Value { get; set; }
+
+ public bool Visible { get; set; }
+
+ public int LargeChange
+ {
+ get { return Math.Min(_largeChange, Maximum + 1); }
+ set { _largeChange = value; }
+ }
+
+ public int SmallChange
+ {
+ get { return Math.Min(_smallChange, LargeChange); }
+ set { _smallChange = value; }
+ }
+
+ public void UpdateScrollInfo()
+ {
+ if (!_parentControl.IsHandleCreated || !Visible)
+ return;
+
+ var si = new NativeMethods.SCROLLINFO
+ {
+ cbSize = Marshal.SizeOf(typeof(NativeMethods.SCROLLINFO)),
+ fMask = NativeMethods.SIF_ALL,
+ nMin = 0,
+ nMax = Maximum,
+ nPage = LargeChange,
+ nPos = Value,
+ nTrackPos = 0
+ };
+
+ NativeMethods.SetScrollInfo(new HandleRef(_parentControl, _parentControl.Handle), _orientation, si, true);
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/HitTest.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/HitTest.cs
new file mode 100644
index 0000000000000000000000000000000000000000..0732d9e63215c1f2635140f9a20202aed6bc586d
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/HitTest.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public enum HitTest
+ {
+ Border = NativeMethods.HitTestValues.HTBORDER,
+ Bottom = NativeMethods.HitTestValues.HTBOTTOM,
+ BottomLeft = NativeMethods.HitTestValues.HTBOTTOMLEFT,
+ BottomRight = NativeMethods.HitTestValues.HTBOTTOMRIGHT,
+ Caption = NativeMethods.HitTestValues.HTCAPTION,
+ Client = NativeMethods.HitTestValues.HTCLIENT,
+ CloseButton = NativeMethods.HitTestValues.HTCLOSE,
+ Error = NativeMethods.HitTestValues.HTERROR,
+ GrowBox = NativeMethods.HitTestValues.HTGROWBOX,
+ HelpButton = NativeMethods.HitTestValues.HTHELP,
+ HorizontalScroll = NativeMethods.HitTestValues.HTHSCROLL,
+ Left = NativeMethods.HitTestValues.HTLEFT,
+ MaximizeButton = NativeMethods.HitTestValues.HTMAXBUTTON,
+ Menu = NativeMethods.HitTestValues.HTMENU,
+ MinimizeButton = NativeMethods.HitTestValues.HTMINBUTTON,
+ Nowhere = NativeMethods.HitTestValues.HTNOWHERE,
+ Object = NativeMethods.HitTestValues.HTOBJECT,
+ Right = NativeMethods.HitTestValues.HTRIGHT,
+ SystemMenu = NativeMethods.HitTestValues.HTSYSMENU,
+ Top = NativeMethods.HitTestValues.HTTOP,
+ TopLeft = NativeMethods.HitTestValues.HTTOPLEFT,
+ TopRight = NativeMethods.HitTestValues.HTTOPRIGHT,
+ Transparent = NativeMethods.HitTestValues.HTTRANSPARENT,
+ VerticalScroll = NativeMethods.HitTestValues.HTVSCROLL
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/IPdfDocument.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/IPdfDocument.cs
new file mode 100644
index 0000000000000000000000000000000000000000..3baeebe92c8c56da1421c9f10039a846fc8853f6
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/IPdfDocument.cs
@@ -0,0 +1,256 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Printing;
+using System.IO;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Represents a PDF document.
+ ///
+ public interface IPdfDocument : IDisposable
+ {
+ ///
+ /// Number of pages in the PDF document.
+ ///
+ int PageCount { get; }
+
+ ///
+ /// Bookmarks stored in this PdfFile
+ ///
+ PdfBookmarkCollection Bookmarks { get; }
+
+ ///
+ /// Size of each page in the PDF document.
+ ///
+ IList PageSizes { get; }
+
+ ///
+ /// Renders a page of the PDF document to the provided graphics instance.
+ ///
+ /// Number of the page to render.
+ /// Graphics instance to render the page on.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Bounds to render the page in.
+ /// Render the page for printing.
+ void Render(int page, Graphics graphics, float dpiX, float dpiY, Rectangle bounds, bool forPrinting);
+
+ ///
+ /// Renders a page of the PDF document to the provided graphics instance.
+ ///
+ /// Number of the page to render.
+ /// Graphics instance to render the page on.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Bounds to render the page in.
+ /// Flags used to influence the rendering.
+ void Render(int page, Graphics graphics, float dpiX, float dpiY, Rectangle bounds, PdfRenderFlags flags);
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Render the page for printing.
+ /// The rendered image.
+ Image Render(int page, float dpiX, float dpiY, bool forPrinting);
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Flags used to influence the rendering.
+ /// The rendered image.
+ Image Render(int page, float dpiX, float dpiY, PdfRenderFlags flags);
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Width of the rendered image.
+ /// Height of the rendered image.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Render the page for printing.
+ /// The rendered image.
+ Image Render(int page, int width, int height, float dpiX, float dpiY, bool forPrinting);
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Width of the rendered image.
+ /// Height of the rendered image.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Flags used to influence the rendering.
+ /// The rendered image.
+ Image Render(int page, int width, int height, float dpiX, float dpiY, PdfRenderFlags flags);
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Width of the rendered image.
+ /// Height of the rendered image.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Rotation.
+ /// Flags used to influence the rendering.
+ /// The rendered image.
+ Image Render(int page, int width, int height, float dpiX, float dpiY, PdfRotation rotate, PdfRenderFlags flags);
+
+ ///
+ /// Save the PDF document to the specified location.
+ ///
+ /// Path to save the PDF document to.
+ void Save(string path);
+
+ ///
+ /// Save the PDF document to the specified location.
+ ///
+ /// Stream to save the PDF document to.
+ void Save(Stream stream);
+
+ ///
+ /// Finds all occurences of text.
+ ///
+ /// The text to search for.
+ /// Whether to match case.
+ /// Whether to match whole words only.
+ /// All matches.
+ PdfMatches Search(string text, bool matchCase, bool wholeWord);
+
+ ///
+ /// Finds all occurences of text.
+ ///
+ /// The text to search for.
+ /// Whether to match case.
+ /// Whether to match whole words only.
+ /// The page to search on.
+ /// All matches.
+ PdfMatches Search(string text, bool matchCase, bool wholeWord, int page);
+
+ ///
+ /// Finds all occurences of text.
+ ///
+ /// The text to search for.
+ /// Whether to match case.
+ /// Whether to match whole words only.
+ /// The page to start searching.
+ /// The page to end searching.
+ /// All matches.
+ PdfMatches Search(string text, bool matchCase, bool wholeWord, int startPage, int endPage);
+
+ ///
+ /// Creates a for the PDF document.
+ ///
+ ///
+ PrintDocument CreatePrintDocument();
+
+ ///
+ /// Creates a for the PDF document.
+ ///
+ /// Specifies the mode for printing. The default
+ /// value for this parameter is CutMargin.
+ ///
+ PrintDocument CreatePrintDocument(PdfPrintMode printMode);
+
+ ///
+ /// Creates a for the PDF document.
+ ///
+ /// The settings used to configure the print document.
+ ///
+ PrintDocument CreatePrintDocument(PdfPrintSettings settings);
+
+ ///
+ /// Returns all links on the PDF page.
+ ///
+ /// The page to get the links for.
+ /// The size of the page.
+ /// A collection with the links on the page.
+ PdfPageLinks GetPageLinks(int page, Size size);
+
+ ///
+ /// Delete the page from the PDF document.
+ ///
+ /// The page to delete.
+ void DeletePage(int page);
+
+ ///
+ /// Rotate the page.
+ ///
+ /// The page to rotate.
+ /// How to rotate the page.
+ void RotatePage(int page, PdfRotation rotation);
+
+ ///
+ /// Get metadata information from the PDF document.
+ ///
+ /// The PDF metadata.
+ PdfInformation GetInformation();
+
+ ///
+ /// Get all text on the page.
+ ///
+ /// The page to get the text for.
+ /// The text on the page.
+ string GetPdfText(int page);
+
+ ///
+ /// Get all text matching the text span.
+ ///
+ /// The span to get the text for.
+ /// The text matching the span.
+ string GetPdfText(PdfTextSpan textSpan);
+
+ ///
+ /// Get all bounding rectangles for the text span.
+ ///
+ ///
+ /// The algorithm used to get the bounding rectangles tries to join
+ /// adjacent character bounds into larger rectangles.
+ ///
+ /// The span to get the bounding rectangles for.
+ /// The bounding rectangles.
+ IList GetTextBounds(PdfTextSpan textSpan);
+
+ ///
+ /// Convert a point from device coordinates to page coordinates.
+ ///
+ /// The page number where the point is from.
+ /// The point to convert.
+ /// The converted point.
+ PointF PointToPdf(int page, Point point);
+
+ ///
+ /// Convert a point from page coordinates to device coordinates.
+ ///
+ /// The page number where the point is from.
+ /// The point to convert.
+ /// The converted point.
+ Point PointFromPdf(int page, PointF point);
+
+ ///
+ /// Convert a rectangle from device coordinates to page coordinates.
+ ///
+ /// The page where the rectangle is from.
+ /// The rectangle to convert.
+ /// The converted rectangle.
+ RectangleF RectangleToPdf(int page, Rectangle rect);
+
+ ///
+ /// Convert a rectangle from page coordinates to device coordinates.
+ ///
+ /// The page where the rectangle is from.
+ /// The rectangle to convert.
+ /// The converted rectangle.
+ Rectangle RectangleFromPdf(int page, RectangleF rect);
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/IPdfMarker.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/IPdfMarker.cs
new file mode 100644
index 0000000000000000000000000000000000000000..c8c2dd5b3b5b677bd6dbe73b06653823d211c4c7
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/IPdfMarker.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Represents a marker on a PDF page.
+ ///
+ public interface IPdfMarker
+ {
+ ///
+ /// The page where the marker is drawn on.
+ ///
+ int Page { get; }
+
+ ///
+ /// Draw the marker.
+ ///
+ /// The PdfRenderer to draw the marker with.
+ /// The Graphics to draw the marker with.
+ void Draw(PdfRenderer renderer, Graphics graphics);
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Key.snk b/root/cli/PdfiumViewer-master/PdfiumViewer/Key.snk
new file mode 100644
index 0000000000000000000000000000000000000000..7526af7afd535d4847c680ff6f5e077fba58a84c
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Key.snk differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/LinkClickEventHandler.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/LinkClickEventHandler.cs
new file mode 100644
index 0000000000000000000000000000000000000000..1549c127db1798869497b88349bf8fe69d38c7e0
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/LinkClickEventHandler.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public class LinkClickEventArgs : HandledEventArgs
+ {
+ ///
+ /// Gets the link that was clicked.
+ ///
+ public PdfPageLink Link { get; private set; }
+
+ public LinkClickEventArgs(PdfPageLink link)
+ {
+ Link = link;
+ }
+ }
+
+ public delegate void LinkClickEventHandler(object sender, LinkClickEventArgs e);
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/MouseWheelMode.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/MouseWheelMode.cs
new file mode 100644
index 0000000000000000000000000000000000000000..561682e91954e5e969133b29dff13255a8b2b886
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/MouseWheelMode.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public enum MouseWheelMode
+ {
+ PanAndZoom,
+ Pan,
+ Zoom
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/NativeMethods.Pdfium.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/NativeMethods.Pdfium.cs
new file mode 100644
index 0000000000000000000000000000000000000000..33c245aefdcc07b9bc721ce1519ac15501b5b9d3
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/NativeMethods.Pdfium.cs
@@ -0,0 +1,980 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Windows.Forms;
+using System.IO;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ partial class NativeMethods
+ {
+ // Interned strings are cached over AppDomains. This means that when we
+ // lock on this string, we actually lock over AppDomain's. The Pdfium
+ // library is not thread safe, and this way of locking
+ // guarantees that we don't access the Pdfium library from different
+ // threads, even when there are multiple AppDomain's in play.
+ private static readonly string LockString = String.Intern("e362349b-001d-4cb2-bf55-a71606a3e36f");
+
+ public static void FPDF_AddRef()
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_AddRef();
+ }
+ }
+
+ public static void FPDF_Release()
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_Release();
+ }
+ }
+
+ public static IntPtr FPDF_LoadMemDocument(SafeHandle data_buf, int size, string password)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDF_LoadMemDocument(data_buf, size, password);
+ }
+ }
+
+ public static IntPtr FPDF_LoadMemDocument(byte[] data_buf, int size, string password)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDF_LoadMemDocument(data_buf, size, password);
+ }
+ }
+
+ public static void FPDF_CloseDocument(IntPtr document)
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_CloseDocument(document);
+ }
+ }
+
+ public static int FPDF_GetPageCount(IntPtr document)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDF_GetPageCount(document);
+ }
+ }
+
+ public static uint FPDF_GetDocPermissions(IntPtr document)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDF_GetDocPermissions(document);
+ }
+ }
+
+ public static IntPtr FPDFDOC_InitFormFillEnvironment(IntPtr document, FPDF_FORMFILLINFO formInfo)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFDOC_InitFormFillEnvironment(document, formInfo);
+ }
+ }
+
+ public static void FPDF_SetFormFieldHighlightColor(IntPtr hHandle, int fieldType, uint color)
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_SetFormFieldHighlightColor(hHandle, fieldType, color);
+ }
+ }
+
+ public static void FPDF_SetFormFieldHighlightAlpha(IntPtr hHandle, byte alpha)
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_SetFormFieldHighlightAlpha(hHandle, alpha);
+ }
+ }
+
+ public static void FORM_DoDocumentJSAction(IntPtr hHandle)
+ {
+ lock (LockString)
+ {
+ Imports.FORM_DoDocumentJSAction(hHandle);
+ }
+ }
+
+ public static void FORM_DoDocumentOpenAction(IntPtr hHandle)
+ {
+ lock (LockString)
+ {
+ Imports.FORM_DoDocumentOpenAction(hHandle);
+ }
+ }
+
+ public static void FPDFDOC_ExitFormFillEnvironment(IntPtr hHandle)
+ {
+ lock (LockString)
+ {
+ Imports.FPDFDOC_ExitFormFillEnvironment(hHandle);
+ }
+ }
+
+ public static void FORM_DoDocumentAAction(IntPtr hHandle, FPDFDOC_AACTION aaType)
+ {
+ lock (LockString)
+ {
+ Imports.FORM_DoDocumentAAction(hHandle, aaType);
+ }
+ }
+
+ public static IntPtr FPDF_LoadPage(IntPtr document, int page_index)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDF_LoadPage(document, page_index);
+ }
+ }
+
+ public static IntPtr FPDFText_LoadPage(IntPtr page)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFText_LoadPage(page);
+ }
+ }
+
+ public static void FORM_OnAfterLoadPage(IntPtr page, IntPtr _form)
+ {
+ lock (LockString)
+ {
+ Imports.FORM_OnAfterLoadPage(page, _form);
+ }
+ }
+
+ public static void FORM_DoPageAAction(IntPtr page, IntPtr _form, FPDFPAGE_AACTION fPDFPAGE_AACTION)
+ {
+ lock (LockString)
+ {
+ Imports.FORM_DoPageAAction(page, _form, fPDFPAGE_AACTION);
+ }
+ }
+
+ public static double FPDF_GetPageWidth(IntPtr page)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDF_GetPageWidth(page);
+ }
+ }
+
+ public static double FPDF_GetPageHeight(IntPtr page)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDF_GetPageHeight(page);
+ }
+ }
+
+ public static void FORM_OnBeforeClosePage(IntPtr page, IntPtr _form)
+ {
+ lock (LockString)
+ {
+ Imports.FORM_OnBeforeClosePage(page, _form);
+ }
+ }
+
+ public static void FPDFText_ClosePage(IntPtr text_page)
+ {
+ lock (LockString)
+ {
+ Imports.FPDFText_ClosePage(text_page);
+ }
+ }
+
+ public static void FPDF_ClosePage(IntPtr page)
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_ClosePage(page);
+ }
+ }
+
+ public static void FPDF_RenderPage(IntPtr dc, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags)
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_RenderPage(dc, page, start_x, start_y, size_x, size_y, rotate, flags);
+ }
+ }
+
+ public static void FPDF_RenderPageBitmap(IntPtr bitmapHandle, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags)
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_RenderPageBitmap(bitmapHandle, page, start_x, start_y, size_x, size_y, rotate, flags);
+ }
+ }
+
+ public static int FPDF_GetPageSizeByIndex(IntPtr document, int page_index, out double width, out double height)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDF_GetPageSizeByIndex(document, page_index, out width, out height);
+ }
+ }
+
+ public static IntPtr FPDFBitmap_CreateEx(int width, int height, int format, IntPtr first_scan, int stride)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFBitmap_CreateEx(width, height, format, first_scan, stride);
+ }
+ }
+
+ public static void FPDFBitmap_FillRect(IntPtr bitmapHandle, int left, int top, int width, int height, uint color)
+ {
+ lock (LockString)
+ {
+ Imports.FPDFBitmap_FillRect(bitmapHandle, left, top, width, height, color);
+ }
+ }
+
+ public static IntPtr FPDFBitmap_Destroy(IntPtr bitmapHandle)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFBitmap_Destroy(bitmapHandle);
+ }
+ }
+
+ public static IntPtr FPDFText_FindStart(IntPtr page, byte[] findWhat, FPDF_SEARCH_FLAGS flags, int start_index)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFText_FindStart(page, findWhat, flags, start_index);
+ }
+ }
+
+ public static int FPDFText_GetSchResultIndex(IntPtr handle)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFText_GetSchResultIndex(handle);
+ }
+ }
+
+ public static int FPDFText_GetSchCount(IntPtr handle)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFText_GetSchCount(handle);
+ }
+ }
+
+ public static int FPDFText_GetText(IntPtr page, int start_index, int count, byte[] result)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFText_GetText(page, start_index, count, result);
+ }
+ }
+
+ public static void FPDFText_GetCharBox(IntPtr page, int index, out double left, out double right, out double bottom, out double top)
+ {
+ lock (LockString)
+ {
+ Imports.FPDFText_GetCharBox(page, index, out left, out right, out bottom, out top);
+ }
+ }
+
+ public static int FPDFText_CountChars(IntPtr page)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFText_CountChars(page);
+ }
+ }
+
+ public static bool FPDFText_FindNext(IntPtr handle)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFText_FindNext(handle);
+ }
+ }
+
+ public static void FPDFText_FindClose(IntPtr handle)
+ {
+ lock (LockString)
+ {
+ Imports.FPDFText_FindClose(handle);
+ }
+ }
+
+ public static bool FPDFLink_Enumerate(IntPtr page, ref int startPos, out IntPtr linkAnnot)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFLink_Enumerate(page, ref startPos, out linkAnnot);
+ }
+ }
+
+ public static IntPtr FPDFLink_GetDest(IntPtr document, IntPtr link)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFLink_GetDest(document, link);
+ }
+ }
+
+ public static uint FPDFDest_GetPageIndex(IntPtr document, IntPtr dest)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFDest_GetPageIndex(document, dest);
+ }
+ }
+
+ public static bool FPDFLink_GetAnnotRect(IntPtr linkAnnot, FS_RECTF rect)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFLink_GetAnnotRect(linkAnnot, rect);
+ }
+ }
+
+ public static void FPDF_DeviceToPage(IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, int device_x, int device_y, out double page_x, out double page_y)
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_DeviceToPage(page, start_x, start_y, size_x, size_y, rotate, device_x, device_y, out page_x, out page_y);
+ }
+ }
+
+ public static void FPDF_PageToDevice(IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, double page_x, double page_y, out int device_x, out int device_y)
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_PageToDevice(page, start_x, start_y, size_x, size_y, rotate, page_x, page_y, out device_x, out device_y);
+ }
+ }
+
+ public static IntPtr FPDFLink_GetAction(IntPtr link)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFLink_GetAction(link);
+ }
+ }
+
+ public static uint FPDFAction_GetURIPath(IntPtr document, IntPtr action, StringBuilder buffer, uint buflen)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFAction_GetURIPath(document, action, buffer, buflen);
+ }
+ }
+
+ public static IntPtr FPDF_BookmarkGetFirstChild(IntPtr document, IntPtr bookmark)
+ {
+ lock (LockString)
+ return Imports.FPDFBookmark_GetFirstChild(document, bookmark);
+ }
+
+ public static IntPtr FPDF_BookmarkGetNextSibling(IntPtr document, IntPtr bookmark)
+ {
+ lock (LockString)
+ return Imports.FPDFBookmark_GetNextSibling(document, bookmark);
+ }
+
+ public static uint FPDF_BookmarkGetTitle(IntPtr bookmark, byte[] buffer, uint buflen)
+ {
+ lock (LockString)
+ return Imports.FPDFBookmark_GetTitle(bookmark, buffer, buflen);
+ }
+
+ public static IntPtr FPDF_BookmarkGetAction(IntPtr bookmark)
+ {
+ lock (LockString)
+ return Imports.FPDFBookmark_GetAction(bookmark);
+ }
+
+ public static IntPtr FPDF_BookmarkGetDest(IntPtr document, IntPtr bookmark)
+ {
+ lock (LockString)
+ return Imports.FPDFBookmark_GetDest(document, bookmark);
+ }
+
+ public static uint FPDF_ActionGetType(IntPtr action)
+ {
+ lock (LockString)
+ return Imports.FPDFAction_GetType(action);
+ }
+
+ ///
+ /// Opens a document using a .NET Stream. Allows opening huge
+ /// PDFs without loading them into memory first.
+ ///
+ /// The input Stream. Don't dispose prior to closing the pdf.
+ /// Password, if the PDF is protected. Can be null.
+ /// Retrieves an IntPtr to the COM object for the Stream. The caller must release this with Marshal.Release prior to Disposing the Stream.
+ /// An IntPtr to the FPDF_DOCUMENT object.
+ public static IntPtr FPDF_LoadCustomDocument(Stream input, string password, int id)
+ {
+ var getBlock = Marshal.GetFunctionPointerForDelegate(_getBlockDelegate);
+
+ var access = new FPDF_FILEACCESS
+ {
+ m_FileLen = (uint)input.Length,
+ m_GetBlock = getBlock,
+ m_Param = (IntPtr)id
+ };
+
+ lock (LockString)
+ {
+ return Imports.FPDF_LoadCustomDocument(access, password);
+ }
+ }
+
+ public static FPDF_ERR FPDF_GetLastError()
+ {
+ lock (LockString)
+ {
+ return (FPDF_ERR)Imports.FPDF_GetLastError();
+ }
+ }
+
+ public static uint FPDF_GetMetaText(IntPtr document, string tag, byte[] buffer, uint buflen)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDF_GetMetaText(document, tag, buffer, buflen);
+ }
+ }
+
+ #region Save / Edit Methods
+
+ public static void FPDFPage_SetRotation(IntPtr page, PdfRotation rotation)
+ {
+ lock (LockString)
+ {
+ Imports.FPDFPage_SetRotation(page, (int)rotation);
+ }
+ }
+
+ public static bool FPDFPage_GenerateContent(IntPtr page)
+ {
+ lock (LockString)
+ {
+ return Imports.FPDFPage_GenerateContent(page);
+ }
+ }
+
+ public static void FPDFPage_Delete(IntPtr doc, int page)
+ {
+ lock (LockString)
+ {
+ Imports.FPDFPage_Delete(doc, page);
+ }
+ }
+
+ public static bool FPDF_SaveAsCopy(IntPtr doc, Stream output, FPDF_SAVE_FLAGS flags)
+ {
+ int id = StreamManager.Register(output);
+
+ try
+ {
+ var write = new FPDF_FILEWRITE
+ {
+ stream = (IntPtr)id,
+ version = 1,
+ WriteBlock = Marshal.GetFunctionPointerForDelegate(_saveBlockDelegate)
+ };
+
+ lock (LockString)
+ {
+ return Imports.FPDF_SaveAsCopy(doc, write, flags);
+ }
+ }
+ finally
+ {
+ StreamManager.Unregister(id);
+ }
+ }
+
+ public static bool FPDF_SaveWithVersion(IntPtr doc, Stream output, FPDF_SAVE_FLAGS flags, int fileVersion)
+ {
+ int id = StreamManager.Register(output);
+
+ try
+ {
+ var write = new FPDF_FILEWRITE
+ {
+ stream = (IntPtr)id,
+ version = 1,
+ WriteBlock = Marshal.GetFunctionPointerForDelegate(_saveBlockDelegate)
+ };
+
+ lock (LockString)
+ {
+ return Imports.FPDF_SaveWithVersion(doc, write, flags, fileVersion);
+ }
+ }
+ finally
+ {
+ StreamManager.Unregister(id);
+ }
+ }
+
+ public static void FPDF_FFLDraw(IntPtr form, IntPtr bitmap, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags)
+ {
+ lock (LockString)
+ {
+ Imports.FPDF_FFLDraw(form, bitmap, page, start_x, start_y, size_x, size_y, rotate, flags);
+ }
+ }
+ #endregion
+
+ #region Custom Load/Save Logic
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate int FPDF_GetBlockDelegate(IntPtr param, uint position, IntPtr buffer, uint size);
+
+ private static readonly FPDF_GetBlockDelegate _getBlockDelegate = FPDF_GetBlock;
+
+ [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
+ private delegate int FPDF_SaveBlockDelegate(IntPtr fileWrite, IntPtr data, uint size);
+
+ private static readonly FPDF_SaveBlockDelegate _saveBlockDelegate = FPDF_SaveBlock;
+
+ private static int FPDF_GetBlock(IntPtr param, uint position, IntPtr buffer, uint size)
+ {
+ var stream = StreamManager.Get((int)param);
+ if (stream == null)
+ return 0;
+ byte[] managedBuffer = new byte[size];
+
+ stream.Position = position;
+ int read = stream.Read(managedBuffer, 0, (int)size);
+ if (read != size)
+ return 0;
+
+ Marshal.Copy(managedBuffer, 0, buffer, (int)size);
+ return 1;
+ }
+
+ private static int FPDF_SaveBlock(IntPtr fileWrite, IntPtr data, uint size)
+ {
+ var write = new FPDF_FILEWRITE();
+ Marshal.PtrToStructure(fileWrite, write);
+
+ var stream = StreamManager.Get((int)write.stream);
+ if (stream == null)
+ return 0;
+
+ byte[] buffer = new byte[size];
+ Marshal.Copy(data, buffer, 0, (int)size);
+
+ try
+ {
+ stream.Write(buffer, 0, (int)size);
+ return (int)size;
+ }
+ catch
+ {
+ return 0;
+ }
+ }
+ #endregion
+
+ private static class Imports
+ {
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_AddRef();
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_Release();
+
+ [DllImport("pdfium.dll", CharSet = CharSet.Ansi)]
+ public static extern IntPtr FPDF_LoadCustomDocument([MarshalAs(UnmanagedType.LPStruct)]FPDF_FILEACCESS access, string password);
+
+ [DllImport("pdfium.dll", CharSet = CharSet.Ansi)]
+ public static extern IntPtr FPDF_LoadMemDocument(SafeHandle data_buf, int size, string password);
+
+ [DllImport("pdfium.dll", CharSet = CharSet.Ansi)]
+ public static extern IntPtr FPDF_LoadMemDocument(byte[] data_buf, int size, string password);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_CloseDocument(IntPtr document);
+
+ [DllImport("pdfium.dll")]
+ public static extern int FPDF_GetPageCount(IntPtr document);
+
+ [DllImport("pdfium.dll")]
+ public static extern uint FPDF_GetDocPermissions(IntPtr document);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFDOC_InitFormFillEnvironment(IntPtr document, FPDF_FORMFILLINFO formInfo);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_SetFormFieldHighlightColor(IntPtr hHandle, int fieldType, uint color);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_SetFormFieldHighlightAlpha(IntPtr hHandle, byte alpha);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FORM_DoDocumentJSAction(IntPtr hHandle);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FORM_DoDocumentOpenAction(IntPtr hHandle);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDFDOC_ExitFormFillEnvironment(IntPtr hHandle);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FORM_DoDocumentAAction(IntPtr hHandle, FPDFDOC_AACTION aaType);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDF_LoadPage(IntPtr document, int page_index);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFText_LoadPage(IntPtr page);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FORM_OnAfterLoadPage(IntPtr page, IntPtr _form);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FORM_DoPageAAction(IntPtr page, IntPtr _form, FPDFPAGE_AACTION fPDFPAGE_AACTION);
+
+ [DllImport("pdfium.dll")]
+ public static extern double FPDF_GetPageWidth(IntPtr page);
+
+ [DllImport("pdfium.dll")]
+ public static extern double FPDF_GetPageHeight(IntPtr page);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FORM_OnBeforeClosePage(IntPtr page, IntPtr _form);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDFText_ClosePage(IntPtr text_page);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_ClosePage(IntPtr page);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_RenderPage(IntPtr dc, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_RenderPageBitmap(IntPtr bitmapHandle, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags);
+
+ [DllImport("pdfium.dll")]
+ public static extern int FPDF_GetPageSizeByIndex(IntPtr document, int page_index, out double width, out double height);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFBitmap_CreateEx(int width, int height, int format, IntPtr first_scan, int stride);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDFBitmap_FillRect(IntPtr bitmapHandle, int left, int top, int width, int height, uint color);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFBitmap_Destroy(IntPtr bitmapHandle);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFText_FindStart(IntPtr page, byte[] findWhat, FPDF_SEARCH_FLAGS flags, int start_index);
+
+ [DllImport("pdfium.dll")]
+ public static extern int FPDFText_GetSchResultIndex(IntPtr handle);
+
+ [DllImport("pdfium.dll")]
+ public static extern int FPDFText_GetSchCount(IntPtr handle);
+
+ [DllImport("pdfium.dll")]
+ public static extern int FPDFText_GetText(IntPtr page, int start_index, int count, byte[] result);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDFText_GetCharBox(IntPtr page, int index, out double left, out double right, out double bottom, out double top);
+
+ [DllImport("pdfium.dll")]
+ public static extern int FPDFText_CountChars(IntPtr page);
+
+ [DllImport("pdfium.dll")]
+ public static extern bool FPDFText_FindNext(IntPtr handle);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDFText_FindClose(IntPtr handle);
+
+ [DllImport("pdfium.dll")]
+ public static extern bool FPDFLink_Enumerate(IntPtr page, ref int startPos, out IntPtr linkAnnot);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFLink_GetDest(IntPtr document, IntPtr link);
+
+ [DllImport("pdfium.dll")]
+ public static extern uint FPDFDest_GetPageIndex(IntPtr document, IntPtr dest);
+
+ [DllImport("pdfium.dll")]
+ public static extern bool FPDFLink_GetAnnotRect(IntPtr linkAnnot, FS_RECTF rect);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_DeviceToPage(IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, int device_x, int device_y, out double page_x, out double page_y);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_PageToDevice(IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, double page_x, double page_y, out int device_x, out int device_y);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFLink_GetAction(IntPtr link);
+
+ [DllImport("pdfium.dll")]
+ public static extern uint FPDFAction_GetURIPath(IntPtr document, IntPtr action, StringBuilder buffer, uint buflen);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFBookmark_GetFirstChild(IntPtr document, IntPtr bookmark);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFBookmark_GetNextSibling(IntPtr document, IntPtr bookmark);
+
+ [DllImport("pdfium.dll")]
+ public static extern uint FPDFBookmark_GetTitle(IntPtr bookmark, byte[] buffer, uint buflen);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFBookmark_GetAction(IntPtr bookmark);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFBookmark_GetDest(IntPtr document, IntPtr bookmark);
+
+ [DllImport("pdfium.dll")]
+ public static extern uint FPDFAction_GetType(IntPtr action);
+
+ [DllImport("pdfium.dll")]
+ public static extern uint FPDF_GetLastError();
+
+ [DllImport("pdfium.dll")]
+ public static extern uint FPDF_GetMetaText(IntPtr document, string tag, byte[] buffer, uint buflen);
+
+ #region Save/Edit APIs
+
+ [DllImport("pdfium.dll")]
+ public static extern bool FPDF_ImportPages(IntPtr destDoc, IntPtr srcDoc, [MarshalAs(UnmanagedType.LPStr)]string pageRange, int index);
+
+ [DllImport("pdfium.dll")]
+ public static extern bool FPDF_SaveAsCopy(IntPtr doc,
+ [MarshalAs(UnmanagedType.LPStruct)]FPDF_FILEWRITE writer,
+ [MarshalAs(UnmanagedType.I4)]FPDF_SAVE_FLAGS flag);
+
+ [DllImport("pdfium.dll")]
+ public static extern bool FPDF_SaveWithVersion(IntPtr doc,
+ [MarshalAs(UnmanagedType.LPStruct)]FPDF_FILEWRITE writer,
+ [MarshalAs(UnmanagedType.I4)]FPDF_SAVE_FLAGS flags,
+ int fileVersion);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFPage_New(IntPtr doc, int index, double width, double height);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDFPage_Delete(IntPtr doc, int index);
+
+ [DllImport("pdfium.dll")]
+ public static extern int FPDFPage_GetRotation(IntPtr page);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDFPage_SetRotation(IntPtr page, int rotate);
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDF_CreateNewDocument();
+
+ [DllImport("pdfium.dll")]
+ public static extern IntPtr FPDFPageObj_NewImgeObj(IntPtr document);
+
+ [DllImport("pdfium.dll")]
+ public static extern bool FPDFImageObj_SetBitmap(IntPtr pages, int count, IntPtr imageObject, IntPtr bitmap);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDFPageObj_Transform(IntPtr page, double a, double b, double c, double d, double e, double f);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDFPage_InsertObject(IntPtr page, IntPtr pageObject);
+
+ [DllImport("pdfium.dll")]
+ public static extern bool FPDFPage_GenerateContent(IntPtr page);
+
+ [DllImport("pdfium.dll")]
+ public static extern void FPDF_FFLDraw(IntPtr form, IntPtr bitmap, IntPtr page, int start_x, int start_y, int size_x, int size_y, int rotate, FPDF flags);
+
+ #endregion
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public class FPDF_FORMFILLINFO
+ {
+ public int version;
+
+ private IntPtr Release;
+
+ private IntPtr FFI_Invalidate;
+
+ private IntPtr FFI_OutputSelectedRect;
+
+ private IntPtr FFI_SetCursor;
+
+ private IntPtr FFI_SetTimer;
+
+ private IntPtr FFI_KillTimer;
+
+ private IntPtr FFI_GetLocalTime;
+
+ private IntPtr FFI_OnChange;
+
+ private IntPtr FFI_GetPage;
+
+ private IntPtr FFI_GetCurrentPage;
+
+ private IntPtr FFI_GetRotation;
+
+ private IntPtr FFI_ExecuteNamedAction;
+
+ private IntPtr FFI_SetTextFieldFocus;
+
+ private IntPtr FFI_DoURIAction;
+
+ private IntPtr FFI_DoGoToAction;
+
+ private IntPtr m_pJsPlatform;
+
+ // XFA support i.e. version 2
+
+ private IntPtr FFI_DisplayCaret;
+
+ private IntPtr FFI_GetCurrentPageIndex;
+
+ private IntPtr FFI_SetCurrentPage;
+
+ private IntPtr FFI_GotoURL;
+
+ private IntPtr FFI_GetPageViewRect;
+
+ private IntPtr FFI_PageEvent;
+
+ private IntPtr FFI_PopupMenu;
+
+ private IntPtr FFI_OpenFile;
+
+ private IntPtr FFI_EmailTo;
+
+ private IntPtr FFI_UploadTo;
+
+ private IntPtr FFI_GetPlatform;
+
+ private IntPtr FFI_GetLanguage;
+
+ private IntPtr FFI_DownloadFromURL;
+
+ private IntPtr FFI_PostRequestURL;
+
+ private IntPtr FFI_PutRequestURL;
+ }
+
+ public enum FPDF_UNSP
+ {
+ DOC_XFAFORM = 1,
+ DOC_PORTABLECOLLECTION = 2,
+ DOC_ATTACHMENT = 3,
+ DOC_SECURITY = 4,
+ DOC_SHAREDREVIEW = 5,
+ DOC_SHAREDFORM_ACROBAT = 6,
+ DOC_SHAREDFORM_FILESYSTEM = 7,
+ DOC_SHAREDFORM_EMAIL = 8,
+ ANNOT_3DANNOT = 11,
+ ANNOT_MOVIE = 12,
+ ANNOT_SOUND = 13,
+ ANNOT_SCREEN_MEDIA = 14,
+ ANNOT_SCREEN_RICHMEDIA = 15,
+ ANNOT_ATTACHMENT = 16,
+ ANNOT_SIG = 17
+ }
+
+ public enum FPDFDOC_AACTION
+ {
+ WC = 0x10,
+ WS = 0x11,
+ DS = 0x12,
+ WP = 0x13,
+ DP = 0x14
+ }
+
+ public enum FPDFPAGE_AACTION
+ {
+ OPEN = 0,
+ CLOSE = 1
+ }
+
+ [Flags]
+ public enum FPDF
+ {
+ ANNOT = 0x01,
+ LCD_TEXT = 0x02,
+ NO_NATIVETEXT = 0x04,
+ GRAYSCALE = 0x08,
+ DEBUG_INFO = 0x80,
+ NO_CATCH = 0x100,
+ RENDER_LIMITEDIMAGECACHE = 0x200,
+ RENDER_FORCEHALFTONE = 0x400,
+ PRINTING = 0x800,
+ REVERSE_BYTE_ORDER = 0x10
+ }
+
+ [Flags]
+ public enum FPDF_SEARCH_FLAGS
+ {
+ FPDF_MATCHCASE = 1,
+ FPDF_MATCHWHOLEWORD = 2
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public class FS_RECTF
+ {
+ public float left;
+ public float top;
+ public float right;
+ public float bottom;
+ }
+
+ public enum FPDF_ERR : uint
+ {
+ FPDF_ERR_SUCCESS = 0, // No error.
+ FPDF_ERR_UNKNOWN = 1, // Unknown error.
+ FPDF_ERR_FILE = 2, // File not found or could not be opened.
+ FPDF_ERR_FORMAT = 3, // File not in PDF format or corrupted.
+ FPDF_ERR_PASSWORD = 4, // Password required or incorrect password.
+ FPDF_ERR_SECURITY = 5, // Unsupported security scheme.
+ FPDF_ERR_PAGE = 6 // Page not found or content error.
+ }
+
+ #region Save/Edit Structs and Flags
+ [Flags]
+ public enum FPDF_SAVE_FLAGS
+ {
+ FPDF_INCREMENTAL = 1,
+ FPDF_NO_INCREMENTAL = 2,
+ FPDF_REMOVE_SECURITY = 3
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public class FPDF_FILEACCESS
+ {
+ public uint m_FileLen;
+ public IntPtr m_GetBlock;
+ public IntPtr m_Param;
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public class FPDF_FILEWRITE
+ {
+ public int version;
+ public IntPtr WriteBlock;
+ public IntPtr stream;
+ }
+ #endregion
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/NativeMethods.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/NativeMethods.cs
new file mode 100644
index 0000000000000000000000000000000000000000..e4c5ca1c481c9b072cc5f8f3b4cceead7b735e82
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/NativeMethods.cs
@@ -0,0 +1,312 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.IO;
+using System.Runtime.ConstrainedExecution;
+using System.Runtime.InteropServices;
+using System.Security.Permissions;
+using System.Text;
+using System.Windows.Forms;
+using Microsoft.Win32.SafeHandles;
+
+namespace PdfiumViewer
+{
+ internal static partial class NativeMethods
+ {
+ static NativeMethods()
+ {
+ // First try the custom resolving mechanism.
+
+ string fileName = PdfiumResolver.GetPdfiumFileName();
+ if (fileName != null && File.Exists(fileName) && LoadLibrary(fileName) != IntPtr.Zero)
+ return;
+
+ // Load the platform dependent Pdfium.dll if it exists.
+
+ if (!TryLoadNativeLibrary(AppDomain.CurrentDomain.RelativeSearchPath))
+ TryLoadNativeLibrary(Path.GetDirectoryName(typeof(NativeMethods).Assembly.Location));
+ }
+
+ private static bool TryLoadNativeLibrary(string path)
+ {
+ if (path == null)
+ return false;
+
+ path = Path.Combine(path, IntPtr.Size == 4 ? "x86" : "x64");
+ path = Path.Combine(path, "Pdfium.dll");
+
+ return File.Exists(path) && LoadLibrary(path) != IntPtr.Zero;
+ }
+
+ [DllImport("kernel32", SetLastError = true, CharSet = CharSet.Auto)]
+ private static extern IntPtr LoadLibrary([MarshalAs(UnmanagedType.LPTStr)] string lpFileName);
+
+ [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)]
+ public static extern MemoryMappedHandle CreateFileMapping(SafeHandle hFile, IntPtr lpFileMappingAttributes, FileMapProtection flProtect, uint dwMaximumSizeHigh, uint dwMaximumSizeLow, [MarshalAs(UnmanagedType.LPTStr)] string lpName);
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool CloseHandle(IntPtr hObject);
+
+ [Flags]
+ public enum FileMapProtection : uint
+ {
+ PageReadonly = 0x02,
+ PageReadWrite = 0x04,
+ PageWriteCopy = 0x08,
+ PageExecuteRead = 0x20,
+ PageExecuteReadWrite = 0x40,
+ SectionCommit = 0x8000000,
+ SectionImage = 0x1000000,
+ SectionNoCache = 0x10000000,
+ SectionReserve = 0x4000000,
+ }
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ public static extern MappedViewHandle MapViewOfFile(SafeHandle hFileMappingObject, FileMapAccess dwDesiredAccess, uint dwFileOffsetHigh, uint dwFileOffsetLow, uint dwNumberOfBytesToMap);
+
+ [Flags]
+ public enum FileMapAccess : uint
+ {
+ FileMapCopy = 0x0001,
+ FileMapWrite = 0x0002,
+ FileMapRead = 0x0004,
+ FileMapAllAccess = 0x001f,
+ FileMapExecute = 0x0020,
+ }
+
+ [DllImport("kernel32.dll", SetLastError = true)]
+ public static extern bool UnmapViewOfFile(IntPtr lpBaseAddress);
+
+ [DllImport("user32.dll")]
+ public static extern int ScrollWindowEx(IntPtr hWnd, int dx, int dy, RECT prcScroll, RECT prcClip, IntPtr hrgnUpdate, IntPtr prcUpdate, uint flags);
+
+ [DllImport("user32.dll")]
+ public static extern int ScrollWindowEx(IntPtr hWnd, int dx, int dy, IntPtr prcScroll, IntPtr prcClip, IntPtr hrgnUpdate, IntPtr prcUpdate, uint flags);
+
+ [SecurityPermission(SecurityAction.InheritanceDemand, UnmanagedCode = true)]
+ [SecurityPermission(SecurityAction.Demand, UnmanagedCode = true)]
+ public class MemoryMappedHandle : SafeHandleZeroOrMinusOneIsInvalid
+ {
+ public MemoryMappedHandle()
+ : base(true)
+ {
+ }
+
+ [ReliabilityContract(Consistency.WillNotCorruptState, Cer.MayFail)]
+ protected override bool ReleaseHandle()
+ {
+ return CloseHandle(handle);
+ }
+ }
+
+ public class MappedViewHandle : SafeHandleZeroOrMinusOneIsInvalid
+ {
+ public MappedViewHandle()
+ : base(true)
+ {
+ }
+
+ protected override bool ReleaseHandle()
+ {
+ return UnmapViewOfFile(handle);
+ }
+ }
+
+ public const int GM_ADVANCED = 2;
+
+ [DllImport("gdi32.dll")]
+ public static extern int SetGraphicsMode(IntPtr hdc, int iMode);
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct XFORM
+ {
+ public float eM11;
+ public float eM12;
+ public float eM21;
+ public float eM22;
+ public float eDx;
+ public float eDy;
+ }
+
+ public const uint MWT_LEFTMULTIPLY = 2;
+
+ [DllImport("gdi32.dll")]
+ public static extern bool ModifyWorldTransform(IntPtr hdc, [In] ref XFORM lpXform, uint iMode);
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct POINT
+ {
+ public int X;
+ public int Y;
+ }
+
+ [DllImport("gdi32.dll")]
+ public static extern bool SetViewportOrgEx(IntPtr hdc, int X, int Y, out POINT lpPoint);
+
+ public const uint SW_ERASE = 0x0004;
+ public const uint SW_SMOOTHSCROLL = 0x0010;
+ public const int WS_VSCROLL = 0x00200000;
+ public const int WS_HSCROLL = 0x00100000;
+ public const int WM_MOUSEWHEEL = 0x20a;
+ public const int SB_HORZ = 0x0;
+ public const int SB_VERT = 0x1;
+ public const uint SW_INVALIDATE = 0x0002;
+ public const uint SW_SCROLLCHILDREN = 0x0001;
+ public const int SB_LINEUP = 0;
+ public const int SB_LINELEFT = 0;
+ public const int SB_LINEDOWN = 1;
+ public const int SB_LINERIGHT = 1;
+ public const int SB_PAGEUP = 2;
+ public const int SB_PAGELEFT = 2;
+ public const int SB_PAGEDOWN = 3;
+ public const int SB_PAGERIGHT = 3;
+ public const int SB_THUMBPOSITION = 4;
+ public const int SB_THUMBTRACK = 5;
+ public const int SB_TOP = 6;
+ public const int SB_LEFT = 6;
+ public const int SB_BOTTOM = 7;
+ public const int SB_RIGHT = 7;
+ public const int SB_ENDSCROLL = 8;
+ public const int WM_HSCROLL = 0x114;
+ public const int WM_VSCROLL = 0x115;
+ public const int WM_SETCURSOR = 0x20;
+ public const int SIF_TRACKPOS = 0x10;
+ public const int SIF_RANGE = 0x1;
+ public const int SIF_POS = 0x4;
+ public const int SIF_PAGE = 0x2;
+ public const int SIF_ALL = SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS;
+
+ [StructLayout(LayoutKind.Sequential)]
+ public struct RECT
+ {
+ public int left;
+ public int top;
+ public int right;
+ public int bottom;
+
+ public RECT(Rectangle r)
+ {
+ left = r.Left;
+ top = r.Top;
+ right = r.Right;
+ bottom = r.Bottom;
+ }
+
+ public Rectangle ToRectangle()
+ {
+ return new Rectangle(left, top, right - left, bottom - top);
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ public class SCROLLINFO
+ {
+ public int cbSize = Marshal.SizeOf(typeof(SCROLLINFO));
+ public int fMask;
+ public int nMin;
+ public int nMax;
+ public int nPage;
+ public int nPos;
+ public int nTrackPos;
+
+ public SCROLLINFO()
+ {
+ }
+
+ public SCROLLINFO(int mask, int min, int max, int page, int pos)
+ {
+ fMask = mask;
+ nMin = min;
+ nMax = max;
+ nPage = page;
+ nPos = pos;
+ }
+ }
+
+ [DllImport("user32.dll")]
+ public static extern int ScrollWindowEx(HandleRef hWnd, int dx, int dy, IntPtr prcScroll, ref RECT prcClip, IntPtr hrgnUpdate, ref RECT prcUpdate, uint flags);
+
+ [DllImport("user32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool GetScrollInfo(HandleRef hwnd, int fnBar, SCROLLINFO lpsi);
+
+ [DllImport("user32.dll")]
+ public static extern int SetScrollInfo(HandleRef hwnd, int fnBar, [In] SCROLLINFO lpsi, bool fRedraw);
+
+ [DllImport("user32.dll", CharSet = CharSet.Auto)]
+ public static extern UIntPtr SendMessage(IntPtr handle, int message, IntPtr wParam, IntPtr lParam);
+
+ [DllImport("user32.dll")]
+ public static extern IntPtr WindowFromPoint(Point pt);
+
+ public static class Util
+ {
+ private static int LOWORD(int n)
+ {
+ return n & 0xffff;
+ }
+
+ public static int LOWORD(IntPtr n)
+ {
+ return LOWORD(unchecked((int)(long)n));
+ }
+ }
+
+ [DllImport("gdi32.dll")]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ public static extern bool DeleteObject([In] IntPtr hObject);
+
+ public const int LOGPIXELSX = 88;
+ public const int LOGPIXELSY = 89;
+
+ [DllImport("gdi32.dll")]
+ public static extern int GetDeviceCaps(IntPtr hdc, int nIndex);
+
+ [DllImport("gdi32.dll")]
+ public static extern bool Rectangle(IntPtr hdc, int nLeftRect, int nTopRect, int nRightRect, int nBottomRect);
+
+ [DllImport("gdi32.dll", SetLastError = true)]
+ public static extern IntPtr CreateCompatibleDC([In] IntPtr hdc);
+
+ [DllImport("user32.dll")]
+ public static extern IntPtr GetDC(IntPtr hWnd);
+
+ [DllImport("gdi32.dll")]
+ public static extern IntPtr CreateCompatibleBitmap([In] IntPtr hdc, int nWidth, int nHeight);
+
+ [DllImport("gdi32.dll")]
+ public static extern IntPtr SelectObject([In] IntPtr hdc, [In] IntPtr hgdiobj);
+
+ [DllImport("gdi32.dll")]
+ public static extern IntPtr CreateSolidBrush(int crColor);
+
+ public enum HitTestValues
+ {
+ HTERROR = -2,
+ HTTRANSPARENT = -1,
+ HTNOWHERE = 0,
+ HTCLIENT = 1,
+ HTCAPTION = 2,
+ HTSYSMENU = 3,
+ HTGROWBOX = 4,
+ HTMENU = 5,
+ HTHSCROLL = 6,
+ HTVSCROLL = 7,
+ HTMINBUTTON = 8,
+ HTMAXBUTTON = 9,
+ HTLEFT = 10,
+ HTRIGHT = 11,
+ HTTOP = 12,
+ HTTOPLEFT = 13,
+ HTTOPRIGHT = 14,
+ HTBOTTOM = 15,
+ HTBOTTOMLEFT = 16,
+ HTBOTTOMRIGHT = 17,
+ HTBORDER = 18,
+ HTOBJECT = 19,
+ HTCLOSE = 20,
+ HTHELP = 21
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/NativeTreeView.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/NativeTreeView.cs
new file mode 100644
index 0000000000000000000000000000000000000000..337857b1e3ee2fded70b46fa4a3f888fb6fd9d3c
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/NativeTreeView.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer
+{
+ internal class NativeTreeView : TreeView
+ {
+ [DllImport("uxtheme.dll", CharSet = CharSet.Unicode)]
+ private extern static int SetWindowTheme(IntPtr hWnd, string pszSubAppName,
+ string pszSubIdList);
+
+ protected override void CreateHandle()
+ {
+ base.CreateHandle();
+ SetWindowTheme(this.Handle, "explorer", null);
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PanningZoomingScrollControl.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PanningZoomingScrollControl.cs
new file mode 100644
index 0000000000000000000000000000000000000000..ce205d5d50f07c695e8a8e6870c31f46bb2270fc
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PanningZoomingScrollControl.cs
@@ -0,0 +1,295 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public abstract class PanningZoomingScrollControl : CustomScrollControl
+ {
+ public const double DefaultZoomMin = 0.1;
+ public const double DefaultZoomMax = 5;
+ public const double DefaultZoomFactor = 1.2;
+
+ private static readonly Cursor PanCursor;
+
+ static PanningZoomingScrollControl()
+ {
+ Application.AddMessageFilter(new WheelFilter());
+
+ using (var stream = typeof(PanningZoomingScrollControl).Assembly.GetManifestResourceStream(typeof(PanningZoomingScrollControl).Namespace + ".pan.cur"))
+ {
+ PanCursor = new Cursor(stream);
+ }
+ }
+
+ private double _zoom = 1;
+ private bool _canPan;
+ private Point _dragStart;
+ private Point _startOffset;
+ private double _zoomMax;
+ private double _zoomMin;
+
+ public event EventHandler ZoomChanged;
+
+ protected virtual void OnZoomChanged(EventArgs e)
+ {
+ var ev = ZoomChanged;
+
+ if (ev != null)
+ ev(this, e);
+ }
+
+ ///
+ /// Gets or sets the current zoom level.
+ ///
+ [Browsable(false)]
+ [DefaultValue(1.0)]
+ public double Zoom
+ {
+ get { return _zoom; }
+ set
+ {
+ value = Math.Min(Math.Max(value, ZoomMin), ZoomMax);
+
+ SetZoom(value, null);
+ }
+ }
+
+ protected virtual void SetZoom(double value, Point? focus)
+ {
+ _zoom = value;
+
+ OnZoomChanged(EventArgs.Empty);
+
+ Invalidate();
+ }
+
+ [DefaultValue(DefaultZoomFactor)]
+ public double ZoomFactor { get; set; }
+
+ protected PanningZoomingScrollControl()
+ {
+ ZoomFactor = DefaultZoomFactor;
+ _zoomMin = DefaultZoomMin;
+ _zoomMax = DefaultZoomMax;
+ }
+
+ [DefaultValue(DefaultZoomMin)]
+ public double ZoomMin
+ {
+ get { return _zoomMin; }
+ set
+ {
+ _zoomMin = value;
+ Zoom = Zoom;
+ }
+ }
+
+ [DefaultValue(DefaultZoomMax)]
+ public double ZoomMax
+ {
+ get { return _zoomMax; }
+ set
+ {
+ _zoomMax = value;
+ Zoom = Zoom;
+ }
+ }
+
+ ///
+ /// Zooms the PDF document in one step.
+ ///
+ public void ZoomIn()
+ {
+ Zoom *= ZoomFactor;
+ }
+
+ ///
+ /// Zooms the PDF document out one step.
+ ///
+ public void ZoomOut()
+ {
+ Zoom /= ZoomFactor;
+ }
+
+ [DefaultValue(MouseWheelMode.PanAndZoom)]
+ public MouseWheelMode MouseWheelMode { get; set; }
+
+ ///
+ /// Raises the event.
+ ///
+ /// A that contains the event data.
+ protected override void OnMouseWheel(MouseEventArgs e)
+ {
+ base.OnMouseWheel(e);
+
+ bool doZoom;
+
+ switch (MouseWheelMode)
+ {
+ case MouseWheelMode.PanAndZoom:
+ doZoom = (ModifierKeys & Keys.Control) != 0;
+ break;
+ case MouseWheelMode.Zoom:
+ doZoom = true;
+ break;
+ default:
+ doZoom = false;
+ break;
+ }
+
+ if (doZoom)
+ {
+ double zoom = _zoom;
+
+ if (e.Delta > 0)
+ zoom *= ZoomFactor;
+ else
+ zoom /= ZoomFactor;
+
+ zoom = Math.Min(Math.Max(zoom, ZoomMin), ZoomMax);
+
+ SetZoom(zoom, e.Location);
+ }
+ else
+ {
+ base.OnMouseWheel(e);
+ }
+ }
+
+ protected abstract Rectangle GetDocumentBounds();
+
+ ///
+ /// Determines whether the specified key is a regular input key or a special key that requires preprocessing.
+ ///
+ ///
+ /// true if the specified key is a regular input key; otherwise, false.
+ ///
+ /// One of the values.
+ protected override bool IsInputKey(Keys keyData)
+ {
+ switch ((keyData) & Keys.KeyCode)
+ {
+ case Keys.Up:
+ PerformScroll(ScrollAction.LineUp, Orientation.Vertical);
+ return true;
+
+ case Keys.Down:
+ PerformScroll(ScrollAction.LineDown, Orientation.Vertical);
+ return true;
+
+ case Keys.Left:
+ PerformScroll(ScrollAction.LineUp, Orientation.Horizontal);
+ return true;
+
+ case Keys.Right:
+ PerformScroll(ScrollAction.LineDown, Orientation.Horizontal);
+ return true;
+
+ case Keys.PageUp:
+ PerformScroll(ScrollAction.PageUp, Orientation.Vertical);
+ return true;
+
+ case Keys.PageDown:
+ PerformScroll(ScrollAction.PageDown, Orientation.Vertical);
+ return true;
+
+ case Keys.Add:
+ case Keys.Oemplus:
+ if ((keyData & Keys.Modifiers) == Keys.Control)
+ ZoomIn();
+ return true;
+
+ case Keys.Subtract:
+ case Keys.OemMinus:
+ if ((keyData & Keys.Modifiers) == Keys.Control)
+ ZoomOut();
+ return true;
+
+ case Keys.Home:
+ PerformScroll(ScrollAction.Home, Orientation.Vertical);
+ return true;
+
+ case Keys.End:
+ PerformScroll(ScrollAction.End, Orientation.Vertical);
+ return true;
+
+ default:
+ return base.IsInputKey(keyData);
+ }
+ }
+
+ protected override void OnSetCursor(SetCursorEventArgs e)
+ {
+ if (_canPan && e.HitTest == HitTest.Client)
+ e.Cursor = PanCursor;
+
+ base.OnSetCursor(e);
+ }
+
+ protected override void OnLayout(LayoutEventArgs levent)
+ {
+ _canPan = DisplayRectangle.Width > ClientSize.Width || DisplayRectangle.Height > ClientSize.Height;
+
+ base.OnLayout(levent);
+ }
+
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ base.OnMouseDown(e);
+
+ if (e.Button != MouseButtons.Left || !_canPan)
+ return;
+
+ Capture = true;
+ _dragStart = e.Location;
+ _startOffset = DisplayRectangle.Location;
+ }
+
+ protected override void OnMouseMove(MouseEventArgs e)
+ {
+ base.OnMouseMove(e);
+
+ if (!Capture)
+ return;
+
+ var offset = new Point(e.Location.X - _dragStart.X, e.Location.Y - _dragStart.Y);
+
+ SetDisplayRectLocation(new Point(_startOffset.X + offset.X, _startOffset.Y + offset.Y));
+ }
+
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ base.OnMouseUp(e);
+
+ Capture = false;
+ }
+
+ private class WheelFilter : IMessageFilter
+ {
+ public bool PreFilterMessage(ref Message m)
+ {
+ if (m.Msg != NativeMethods.WM_MOUSEWHEEL)
+ return false;
+
+ var control = Control.FromHandle(NativeMethods.WindowFromPoint(Cursor.Position));
+
+ while (control != null && !(control is PanningZoomingScrollControl))
+ {
+ control = control.Parent;
+ }
+
+ if (control == null)
+ return false;
+
+ NativeMethods.SendMessage(control.Handle, m.Msg, m.WParam, m.LParam);
+ return true;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PasswordForm.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PasswordForm.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..a7e1b989f00716f139d499826c33c2e43b6a46a2
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PasswordForm.Designer.cs
@@ -0,0 +1,167 @@
+namespace PdfiumViewer
+{
+ partial class PasswordForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
+ this._acceptButton = new System.Windows.Forms.Button();
+ this._cancelButton = new System.Windows.Forms.Button();
+ this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
+ this._helpLabel = new System.Windows.Forms.Label();
+ this.label2 = new System.Windows.Forms.Label();
+ this._password = new System.Windows.Forms.TextBox();
+ this.tableLayoutPanel1.SuspendLayout();
+ this.tableLayoutPanel2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // tableLayoutPanel1
+ //
+ this.tableLayoutPanel1.ColumnCount = 3;
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel1.Controls.Add(this._acceptButton, 1, 1);
+ this.tableLayoutPanel1.Controls.Add(this._cancelButton, 2, 1);
+ this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 0);
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel1.Location = new System.Drawing.Point(9, 9);
+ this.tableLayoutPanel1.Name = "tableLayoutPanel1";
+ this.tableLayoutPanel1.RowCount = 2;
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(319, 87);
+ this.tableLayoutPanel1.TabIndex = 0;
+ //
+ // _acceptButton
+ //
+ this._acceptButton.Location = new System.Drawing.Point(160, 61);
+ this._acceptButton.Name = "_acceptButton";
+ this._acceptButton.Size = new System.Drawing.Size(75, 23);
+ this._acceptButton.TabIndex = 1;
+ this._acceptButton.Text = "OK";
+ this._acceptButton.UseVisualStyleBackColor = true;
+ this._acceptButton.Click += new System.EventHandler(this._acceptButton_Click);
+ //
+ // _cancelButton
+ //
+ this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this._cancelButton.Location = new System.Drawing.Point(241, 61);
+ this._cancelButton.Name = "_cancelButton";
+ this._cancelButton.Size = new System.Drawing.Size(75, 23);
+ this._cancelButton.TabIndex = 2;
+ this._cancelButton.Text = "Cancel";
+ this._cancelButton.UseVisualStyleBackColor = true;
+ //
+ // tableLayoutPanel2
+ //
+ this.tableLayoutPanel2.ColumnCount = 2;
+ this.tableLayoutPanel1.SetColumnSpan(this.tableLayoutPanel2, 3);
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
+ this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
+ this.tableLayoutPanel2.Controls.Add(this._helpLabel, 0, 0);
+ this.tableLayoutPanel2.Controls.Add(this.label2, 0, 1);
+ this.tableLayoutPanel2.Controls.Add(this._password, 1, 1);
+ this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tableLayoutPanel2.Location = new System.Drawing.Point(0, 0);
+ this.tableLayoutPanel2.Margin = new System.Windows.Forms.Padding(0);
+ this.tableLayoutPanel2.Name = "tableLayoutPanel2";
+ this.tableLayoutPanel2.RowCount = 2;
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle());
+ this.tableLayoutPanel2.Size = new System.Drawing.Size(319, 58);
+ this.tableLayoutPanel2.TabIndex = 0;
+ //
+ // _helpLabel
+ //
+ this._helpLabel.AutoSize = true;
+ this.tableLayoutPanel2.SetColumnSpan(this._helpLabel, 2);
+ this._helpLabel.Location = new System.Drawing.Point(3, 3);
+ this._helpLabel.Margin = new System.Windows.Forms.Padding(3);
+ this._helpLabel.Name = "_helpLabel";
+ this._helpLabel.Size = new System.Drawing.Size(283, 26);
+ this._helpLabel.TabIndex = 0;
+ this._helpLabel.Text = "The PDF document is password protected. Please enter a password to open this file" +
+ ".";
+ //
+ // label2
+ //
+ this.label2.AutoSize = true;
+ this.label2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.label2.Location = new System.Drawing.Point(3, 35);
+ this.label2.Margin = new System.Windows.Forms.Padding(3);
+ this.label2.Name = "label2";
+ this.label2.Size = new System.Drawing.Size(56, 20);
+ this.label2.TabIndex = 1;
+ this.label2.Text = "Password:";
+ this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
+ //
+ // _password
+ //
+ this._password.Dock = System.Windows.Forms.DockStyle.Fill;
+ this._password.Location = new System.Drawing.Point(65, 35);
+ this._password.Name = "_password";
+ this._password.Size = new System.Drawing.Size(251, 20);
+ this._password.TabIndex = 2;
+ this._password.UseSystemPasswordChar = true;
+ this._password.TextChanged += new System.EventHandler(this._password_TextChanged);
+ //
+ // PasswordForm
+ //
+ this.AcceptButton = this._acceptButton;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this._cancelButton;
+ this.ClientSize = new System.Drawing.Size(337, 105);
+ this.Controls.Add(this.tableLayoutPanel1);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "PasswordForm";
+ this.Padding = new System.Windows.Forms.Padding(9);
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Password";
+ this.tableLayoutPanel1.ResumeLayout(false);
+ this.tableLayoutPanel2.ResumeLayout(false);
+ this.tableLayoutPanel2.PerformLayout();
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1;
+ private System.Windows.Forms.Button _acceptButton;
+ private System.Windows.Forms.Button _cancelButton;
+ private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2;
+ private System.Windows.Forms.Label _helpLabel;
+ private System.Windows.Forms.Label label2;
+ private System.Windows.Forms.TextBox _password;
+ }
+}
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PasswordForm.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PasswordForm.cs
new file mode 100644
index 0000000000000000000000000000000000000000..592a26e212c7bd5bd7418bca6dd74e1effb9b479
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PasswordForm.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer
+{
+ internal partial class PasswordForm : Form
+ {
+ public string Password
+ {
+ get { return _password.Text; }
+ }
+
+ public PasswordForm()
+ {
+ InitializeComponent();
+
+ UpdateEnabled();
+ }
+
+ private void _password_TextChanged(object sender, EventArgs e)
+ {
+ UpdateEnabled();
+ }
+
+ private void UpdateEnabled()
+ {
+ _acceptButton.Enabled = _password.Text.Length > 0;
+ }
+
+ private void _acceptButton_Click(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.OK;
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PasswordForm.resx b/root/cli/PdfiumViewer-master/PdfiumViewer/PasswordForm.resx
new file mode 100644
index 0000000000000000000000000000000000000000..5ea0895e324fa7a86681adc56938bad2f2367ba0
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PasswordForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfBookmarkCollection.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfBookmarkCollection.cs
new file mode 100644
index 0000000000000000000000000000000000000000..9850143275b0fd82837694ea7da3bf32f45c1d7c
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfBookmarkCollection.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public class PdfBookmark
+ {
+ public string Title { get; set; }
+ public int PageIndex { get; set; }
+
+ public PdfBookmarkCollection Children { get; }
+
+ public PdfBookmark()
+ {
+ Children = new PdfBookmarkCollection();
+ }
+
+ public override string ToString()
+ {
+ return Title;
+ }
+ }
+
+ public class PdfBookmarkCollection : Collection
+ {
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfDocument.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfDocument.cs
new file mode 100644
index 0000000000000000000000000000000000000000..3a0e188df44eb5f2299b5dc5746c505a4b21825c
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfDocument.cs
@@ -0,0 +1,605 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Drawing.Printing;
+using System.IO;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Provides functionality to render a PDF document.
+ ///
+ public class PdfDocument : IPdfDocument
+ {
+ private bool _disposed;
+ private PdfFile _file;
+ private readonly List _pageSizes;
+
+ ///
+ /// Initializes a new instance of the PdfDocument class with the provided path.
+ ///
+ /// Path to the PDF document.
+ public static PdfDocument Load(string path)
+ {
+ return Load(path, null);
+ }
+
+ ///
+ /// Initializes a new instance of the PdfDocument class with the provided path.
+ ///
+ /// Path to the PDF document.
+ /// Password for the PDF document.
+ public static PdfDocument Load(string path, string password)
+ {
+ if (path == null)
+ throw new ArgumentNullException(nameof(path));
+
+ return Load(File.OpenRead(path), password);
+ }
+
+ ///
+ /// Initializes a new instance of the PdfDocument class with the provided path.
+ ///
+ /// Window to show any UI for.
+ /// Path to the PDF document.
+ public static PdfDocument Load(IWin32Window owner, string path)
+ {
+ if (owner == null)
+ throw new ArgumentNullException(nameof(owner));
+ if (path == null)
+ throw new ArgumentNullException(nameof(path));
+
+ return Load(owner, File.OpenRead(path), null);
+ }
+
+ ///
+ /// Initializes a new instance of the PdfDocument class with the provided path.
+ ///
+ /// Window to show any UI for.
+ /// Stream for the PDF document.
+ public static PdfDocument Load(IWin32Window owner, Stream stream)
+ {
+ if (owner == null)
+ throw new ArgumentNullException(nameof(owner));
+ if (stream == null)
+ throw new ArgumentNullException(nameof(stream));
+
+ return Load(owner, stream, null);
+ }
+
+ private static PdfDocument Load(IWin32Window owner, Stream stream, string password)
+ {
+ try
+ {
+ while (true)
+ {
+ try
+ {
+ return new PdfDocument(stream, password);
+ }
+ catch (PdfException ex)
+ {
+ if (owner != null && ex.Error == PdfError.PasswordProtected)
+ {
+ using (var form = new PasswordForm())
+ {
+ if (form.ShowDialog(owner) == DialogResult.OK)
+ {
+ password = form.Password;
+ continue;
+ }
+ }
+ }
+
+ throw;
+ }
+ }
+ }
+ catch
+ {
+ stream.Dispose();
+ throw;
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the PdfDocument class with the provided stream.
+ ///
+ /// Stream for the PDF document.
+ public static PdfDocument Load(Stream stream)
+ {
+ return Load(stream, null);
+ }
+
+ ///
+ /// Initializes a new instance of the PdfDocument class with the provided stream.
+ ///
+ /// Stream for the PDF document.
+ /// Password for the PDF document.
+ public static PdfDocument Load(Stream stream, string password)
+ {
+ if (stream == null)
+ throw new ArgumentNullException(nameof(stream));
+
+ return new PdfDocument(stream, password);
+ }
+
+ ///
+ /// Number of pages in the PDF document.
+ ///
+ public int PageCount
+ {
+ get { return PageSizes.Count; }
+ }
+
+ ///
+ /// Bookmarks stored in this PdfFile
+ ///
+ public PdfBookmarkCollection Bookmarks
+ {
+ get { return _file.Bookmarks; }
+ }
+
+ ///
+ /// Size of each page in the PDF document.
+ ///
+ public IList PageSizes { get; private set; }
+
+ private PdfDocument(Stream stream, string password)
+ {
+ _file = new PdfFile(stream, password);
+
+ _pageSizes = _file.GetPDFDocInfo();
+ if (_pageSizes == null)
+ throw new Win32Exception();
+
+ PageSizes = new ReadOnlyCollection(_pageSizes);
+ }
+
+ ///
+ /// Renders a page of the PDF document to the provided graphics instance.
+ ///
+ /// Number of the page to render.
+ /// Graphics instance to render the page on.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Bounds to render the page in.
+ /// Render the page for printing.
+ public void Render(int page, Graphics graphics, float dpiX, float dpiY, Rectangle bounds, bool forPrinting)
+ {
+ Render(page, graphics, dpiX, dpiY, bounds, forPrinting ? PdfRenderFlags.ForPrinting : PdfRenderFlags.None);
+ }
+
+ ///
+ /// Renders a page of the PDF document to the provided graphics instance.
+ ///
+ /// Number of the page to render.
+ /// Graphics instance to render the page on.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Bounds to render the page in.
+ /// Flags used to influence the rendering.
+ public void Render(int page, Graphics graphics, float dpiX, float dpiY, Rectangle bounds, PdfRenderFlags flags)
+ {
+ if (graphics == null)
+ throw new ArgumentNullException("graphics");
+ if (_disposed)
+ throw new ObjectDisposedException(GetType().Name);
+
+ float graphicsDpiX = graphics.DpiX;
+ float graphicsDpiY = graphics.DpiY;
+
+ var dc = graphics.GetHdc();
+
+ try
+ {
+ if ((int)graphicsDpiX != (int)dpiX || (int)graphicsDpiY != (int)dpiY)
+ {
+ var transform = new NativeMethods.XFORM
+ {
+ eM11 = graphicsDpiX / dpiX,
+ eM22 = graphicsDpiY / dpiY
+ };
+
+ NativeMethods.SetGraphicsMode(dc, NativeMethods.GM_ADVANCED);
+ NativeMethods.ModifyWorldTransform(dc, ref transform, NativeMethods.MWT_LEFTMULTIPLY);
+ }
+
+ var point = new NativeMethods.POINT();
+ NativeMethods.SetViewportOrgEx(dc, bounds.X, bounds.Y, out point);
+
+ bool success = _file.RenderPDFPageToDC(
+ page,
+ dc,
+ (int)dpiX, (int)dpiY,
+ 0, 0, bounds.Width, bounds.Height,
+ FlagsToFPDFFlags(flags)
+ );
+
+ NativeMethods.SetViewportOrgEx(dc, point.X, point.Y, out point);
+
+ if (!success)
+ throw new Win32Exception();
+ }
+ finally
+ {
+ graphics.ReleaseHdc(dc);
+ }
+ }
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Render the page for printing.
+ /// The rendered image.
+ public Image Render(int page, float dpiX, float dpiY, bool forPrinting)
+ {
+ var size = PageSizes[page];
+
+ return Render(page, (int)size.Width, (int)size.Height, dpiX, dpiY, forPrinting);
+ }
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Flags used to influence the rendering.
+ /// The rendered image.
+ public Image Render(int page, float dpiX, float dpiY, PdfRenderFlags flags)
+ {
+ // for Hishi-->
+ _pageSizes[page] = _file.GetPDFDocInfo(page);
+ // <--
+
+ var size = PageSizes[page];
+
+ return Render(page, (int)size.Width, (int)size.Height, dpiX, dpiY, flags);
+ }
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Width of the rendered image.
+ /// Height of the rendered image.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Render the page for printing.
+ /// The rendered image.
+ public Image Render(int page, int width, int height, float dpiX, float dpiY, bool forPrinting)
+ {
+ return Render(page, width, height, dpiX, dpiY, forPrinting ? PdfRenderFlags.ForPrinting : PdfRenderFlags.None);
+ }
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Width of the rendered image.
+ /// Height of the rendered image.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Flags used to influence the rendering.
+ /// The rendered image.
+ public Image Render(int page, int width, int height, float dpiX, float dpiY, PdfRenderFlags flags)
+ {
+ return Render(page, width, height, dpiX, dpiY, 0, flags);
+ }
+
+ ///
+ /// Renders a page of the PDF document to an image.
+ ///
+ /// Number of the page to render.
+ /// Width of the rendered image.
+ /// Height of the rendered image.
+ /// Horizontal DPI.
+ /// Vertical DPI.
+ /// Rotation.
+ /// Flags used to influence the rendering.
+ /// The rendered image.
+ public Image Render(int page, int width, int height, float dpiX, float dpiY, PdfRotation rotate, PdfRenderFlags flags)
+ {
+ if (_disposed)
+ throw new ObjectDisposedException(GetType().Name);
+
+ if ((flags & PdfRenderFlags.CorrectFromDpi) != 0)
+ {
+ width = width * (int)dpiX / 72;
+ height = height * (int)dpiY / 72;
+ }
+
+ var bitmap = new Bitmap(width, height, PixelFormat.Format32bppArgb);
+ bitmap.SetResolution(dpiX, dpiY);
+
+ var data = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadWrite, bitmap.PixelFormat);
+ try
+ {
+ var handle = NativeMethods.FPDFBitmap_CreateEx(width, height, 4, data.Scan0, width * 4);
+
+ try
+ {
+ uint background = (flags & PdfRenderFlags.Transparent) == 0 ? 0xFFFFFFFF : 0x00FFFFFF;
+
+ NativeMethods.FPDFBitmap_FillRect(handle, 0, 0, width, height, background);
+
+ bool success = _file.RenderPDFPageToBitmap(
+ page,
+ handle,
+ (int)dpiX, (int)dpiY,
+ 0, 0, width, height,
+ (int)rotate,
+ FlagsToFPDFFlags(flags),
+ (flags & PdfRenderFlags.Annotations) != 0
+ );
+
+ if (!success)
+ throw new Win32Exception();
+ }
+ finally
+ {
+ NativeMethods.FPDFBitmap_Destroy(handle);
+ }
+ }
+ finally
+ {
+ bitmap.UnlockBits(data);
+ }
+
+ return bitmap;
+ }
+
+ private NativeMethods.FPDF FlagsToFPDFFlags(PdfRenderFlags flags)
+ {
+ return (NativeMethods.FPDF)(flags & ~(PdfRenderFlags.Transparent | PdfRenderFlags.CorrectFromDpi));
+ }
+
+ ///
+ /// Save the PDF document to the specified location.
+ ///
+ /// Path to save the PDF document to.
+ public void Save(string path)
+ {
+ if (path == null)
+ throw new ArgumentNullException("path");
+
+ using (var stream = File.Create(path))
+ {
+ Save(stream);
+ }
+ }
+
+ ///
+ /// Save the PDF document to the specified location.
+ ///
+ /// Stream to save the PDF document to.
+ public void Save(Stream stream)
+ {
+ if (stream == null)
+ throw new ArgumentNullException("stream");
+
+ _file.Save(stream);
+ }
+
+ ///
+ /// Finds all occurences of text.
+ ///
+ /// The text to search for.
+ /// Whether to match case.
+ /// Whether to match whole words only.
+ /// All matches.
+ public PdfMatches Search(string text, bool matchCase, bool wholeWord)
+ {
+ return Search(text, matchCase, wholeWord, 0, PageCount - 1);
+ }
+
+ ///
+ /// Finds all occurences of text.
+ ///
+ /// The text to search for.
+ /// Whether to match case.
+ /// Whether to match whole words only.
+ /// The page to search on.
+ /// All matches.
+ public PdfMatches Search(string text, bool matchCase, bool wholeWord, int page)
+ {
+ return Search(text, matchCase, wholeWord, page, page);
+ }
+
+ ///
+ /// Finds all occurences of text.
+ ///
+ /// The text to search for.
+ /// Whether to match case.
+ /// Whether to match whole words only.
+ /// The page to start searching.
+ /// The page to end searching.
+ /// All matches.
+ public PdfMatches Search(string text, bool matchCase, bool wholeWord, int startPage, int endPage)
+ {
+ return _file.Search(text, matchCase, wholeWord, startPage, endPage);
+ }
+
+ ///
+ /// Get all text on the page.
+ ///
+ /// The page to get the text for.
+ /// The text on the page.
+ public string GetPdfText(int page)
+ {
+ return _file.GetPdfText(page);
+ }
+
+ ///
+ /// Get all text matching the text span.
+ ///
+ /// The span to get the text for.
+ /// The text matching the span.
+ public string GetPdfText(PdfTextSpan textSpan)
+ {
+ return _file.GetPdfText(textSpan);
+ }
+
+ ///
+ /// Get all bounding rectangles for the text span.
+ ///
+ ///
+ /// The algorithm used to get the bounding rectangles tries to join
+ /// adjacent character bounds into larger rectangles.
+ ///
+ /// The span to get the bounding rectangles for.
+ /// The bounding rectangles.
+ public IList GetTextBounds(PdfTextSpan textSpan)
+ {
+ return _file.GetTextBounds(textSpan);
+ }
+
+ ///
+ /// Convert a point from device coordinates to page coordinates.
+ ///
+ /// The page number where the point is from.
+ /// The point to convert.
+ /// The converted point.
+ public PointF PointToPdf(int page, Point point)
+ {
+ return _file.PointToPdf(page, point);
+ }
+
+ ///
+ /// Convert a point from page coordinates to device coordinates.
+ ///
+ /// The page number where the point is from.
+ /// The point to convert.
+ /// The converted point.
+ public Point PointFromPdf(int page, PointF point)
+ {
+ return _file.PointFromPdf(page, point);
+ }
+
+ ///
+ /// Convert a rectangle from device coordinates to page coordinates.
+ ///
+ /// The page where the rectangle is from.
+ /// The rectangle to convert.
+ /// The converted rectangle.
+ public RectangleF RectangleToPdf(int page, Rectangle rect)
+ {
+ return _file.RectangleToPdf(page, rect);
+ }
+
+ ///
+ /// Convert a rectangle from page coordinates to device coordinates.
+ ///
+ /// The page where the rectangle is from.
+ /// The rectangle to convert.
+ /// The converted rectangle.
+ public Rectangle RectangleFromPdf(int page, RectangleF rect)
+ {
+ return _file.RectangleFromPdf(page, rect);
+ }
+
+ ///
+ /// Creates a for the PDF document.
+ ///
+ ///
+ public PrintDocument CreatePrintDocument()
+ {
+ return CreatePrintDocument(PdfPrintMode.CutMargin);
+ }
+
+ ///
+ /// Creates a for the PDF document.
+ ///
+ /// Specifies the mode for printing. The default
+ /// value for this parameter is CutMargin.
+ ///
+ public PrintDocument CreatePrintDocument(PdfPrintMode printMode)
+ {
+ return CreatePrintDocument(new PdfPrintSettings(printMode, null));
+ }
+
+ ///
+ /// Creates a for the PDF document.
+ ///
+ /// The settings used to configure the print document.
+ ///
+ public PrintDocument CreatePrintDocument(PdfPrintSettings settings)
+ {
+ return new PdfPrintDocument(this, settings);
+ }
+
+ ///
+ /// Returns all links on the PDF page.
+ ///
+ /// The page to get the links for.
+ /// The size of the page.
+ /// A collection with the links on the page.
+ public PdfPageLinks GetPageLinks(int page, Size size)
+ {
+ return _file.GetPageLinks(page, size);
+ }
+
+ ///
+ /// Delete the page from the PDF document.
+ ///
+ /// The page to delete.
+ public void DeletePage(int page)
+ {
+ _file.DeletePage(page);
+ _pageSizes.RemoveAt(page);
+ }
+
+ ///
+ /// Rotate the page.
+ ///
+ /// The page to rotate.
+ /// How to rotate the page.
+ public void RotatePage(int page, PdfRotation rotation)
+ {
+ _file.RotatePage(page, rotation);
+ _pageSizes[page] = _file.GetPDFDocInfo(page);
+ }
+
+ ///
+ /// Get metadata information from the PDF document.
+ ///
+ /// The PDF metadata.
+ public PdfInformation GetInformation()
+ {
+ return _file.GetInformation();
+ }
+
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// 2
+ public void Dispose()
+ {
+ Dispose(true);
+ GC.SuppressFinalize(this);
+ }
+
+ /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
+ /// Whether this method is called from Dispose.
+ protected void Dispose(bool disposing)
+ {
+ if (!_disposed && disposing)
+ {
+ if (_file != null)
+ {
+ _file.Dispose();
+ _file = null;
+ }
+
+ _disposed = true;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfError.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfError.cs
new file mode 100644
index 0000000000000000000000000000000000000000..94601a2f83cd2f8712b6aba32c75c8f95bb086b2
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfError.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public enum PdfError
+ {
+ Success = (int)NativeMethods.FPDF_ERR.FPDF_ERR_SUCCESS,
+ Unknown = (int)NativeMethods.FPDF_ERR.FPDF_ERR_UNKNOWN,
+ CannotOpenFile = (int)NativeMethods.FPDF_ERR.FPDF_ERR_FILE,
+ InvalidFormat = (int)NativeMethods.FPDF_ERR.FPDF_ERR_FORMAT,
+ PasswordProtected = (int)NativeMethods.FPDF_ERR.FPDF_ERR_PASSWORD,
+ UnsupportedSecurityScheme = (int)NativeMethods.FPDF_ERR.FPDF_ERR_SECURITY,
+ PageNotFound = (int)NativeMethods.FPDF_ERR.FPDF_ERR_PAGE
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfException.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfException.cs
new file mode 100644
index 0000000000000000000000000000000000000000..49244236c83326d4b584f302327b07e7e70dc598
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfException.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.Serialization;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public class PdfException : Exception
+ {
+ public PdfError Error { get; private set; }
+
+ public PdfException()
+ {
+ }
+
+ public PdfException(PdfError error)
+ : this(GetMessage(error))
+ {
+ Error = error;
+ }
+
+ private static string GetMessage(PdfError error)
+ {
+ switch (error)
+ {
+ case PdfError.Success:
+ return "No error";
+ case PdfError.CannotOpenFile:
+ return "File not found or could not be opened";
+ case PdfError.InvalidFormat:
+ return "File not in PDF format or corrupted";
+ case PdfError.PasswordProtected:
+ return "Password required or incorrect password";
+ case PdfError.UnsupportedSecurityScheme:
+ return "Unsupported security scheme";
+ case PdfError.PageNotFound:
+ return "Page not found or content error";
+ default:
+ return "Unknown error";
+ }
+ }
+
+ public PdfException(string message)
+ : base(message)
+ {
+ }
+
+ public PdfException(string message, Exception innerException)
+ : base(message, innerException)
+ {
+ }
+
+ protected PdfException(SerializationInfo info, StreamingContext context)
+ : base(info, context)
+ {
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfFile.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfFile.cs
new file mode 100644
index 0000000000000000000000000000000000000000..115c8e4094dcfbe8b352e675707bd1f4dd81fbe0
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfFile.cs
@@ -0,0 +1,688 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace PdfiumViewer
+{
+ internal class PdfFile : IDisposable
+ {
+ private static readonly Encoding FPDFEncoding = new UnicodeEncoding(false, false, false);
+
+ private IntPtr _document;
+ private IntPtr _form;
+ private bool _disposed;
+ private NativeMethods.FPDF_FORMFILLINFO _formCallbacks;
+ private GCHandle _formCallbacksHandle;
+ private readonly int _id;
+ private Stream _stream;
+
+ public PdfFile(Stream stream, string password)
+ {
+ if (stream == null)
+ throw new ArgumentNullException(nameof(stream));
+
+ PdfLibrary.EnsureLoaded();
+
+ _stream = stream;
+ _id = StreamManager.Register(stream);
+
+ var document = NativeMethods.FPDF_LoadCustomDocument(stream, password, _id);
+ if (document == IntPtr.Zero)
+ throw new PdfException((PdfError)NativeMethods.FPDF_GetLastError());
+
+ LoadDocument(document);
+ }
+
+ public PdfBookmarkCollection Bookmarks { get; private set; }
+
+ public bool RenderPDFPageToDC(int pageNumber, IntPtr dc, int dpiX, int dpiY, int boundsOriginX, int boundsOriginY, int boundsWidth, int boundsHeight, NativeMethods.FPDF flags)
+ {
+ if (_disposed)
+ throw new ObjectDisposedException(GetType().Name);
+
+ using (var pageData = new PageData(_document, _form, pageNumber))
+ {
+ NativeMethods.FPDF_RenderPage(dc, pageData.Page, boundsOriginX, boundsOriginY, boundsWidth, boundsHeight, 0, flags);
+ }
+
+ return true;
+ }
+
+ public bool RenderPDFPageToBitmap(int pageNumber, IntPtr bitmapHandle, int dpiX, int dpiY, int boundsOriginX, int boundsOriginY, int boundsWidth, int boundsHeight, int rotate, NativeMethods.FPDF flags, bool renderFormFill)
+ {
+ if (_disposed)
+ throw new ObjectDisposedException(GetType().Name);
+
+ using (var pageData = new PageData(_document, _form, pageNumber))
+ {
+ if (renderFormFill)
+ flags &= ~NativeMethods.FPDF.ANNOT;
+
+ NativeMethods.FPDF_RenderPageBitmap(bitmapHandle, pageData.Page, boundsOriginX, boundsOriginY, boundsWidth, boundsHeight, rotate, flags);
+
+ if (renderFormFill)
+ NativeMethods.FPDF_FFLDraw(_form, bitmapHandle, pageData.Page, boundsOriginX, boundsOriginY, boundsWidth, boundsHeight, rotate, flags);
+ }
+
+ return true;
+ }
+
+ public PdfPageLinks GetPageLinks(int pageNumber, Size pageSize)
+ {
+ if (_disposed)
+ throw new ObjectDisposedException(GetType().Name);
+
+ var links = new List();
+
+ using (var pageData = new PageData(_document, _form, pageNumber))
+ {
+ int link = 0;
+ IntPtr annotation;
+
+ while (NativeMethods.FPDFLink_Enumerate(pageData.Page, ref link, out annotation))
+ {
+ var destination = NativeMethods.FPDFLink_GetDest(_document, annotation);
+ int? target = null;
+ string uri = null;
+
+ if (destination != IntPtr.Zero)
+ target = (int)NativeMethods.FPDFDest_GetPageIndex(_document, destination);
+
+ var action = NativeMethods.FPDFLink_GetAction(annotation);
+ if (action != IntPtr.Zero)
+ {
+ const uint length = 1024;
+ var sb = new StringBuilder(1024);
+ NativeMethods.FPDFAction_GetURIPath(_document, action, sb, length);
+
+ uri = sb.ToString();
+ }
+
+ var rect = new NativeMethods.FS_RECTF();
+
+ if (NativeMethods.FPDFLink_GetAnnotRect(annotation, rect) && (target.HasValue || uri != null))
+ {
+ links.Add(new PdfPageLink(
+ new RectangleF(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top),
+ target,
+ uri
+ ));
+ }
+ }
+ }
+
+ return new PdfPageLinks(links);
+ }
+
+ public List GetPDFDocInfo()
+ {
+ if (_disposed)
+ throw new ObjectDisposedException(GetType().Name);
+
+ int pageCount = NativeMethods.FPDF_GetPageCount(_document);
+ var result = new List(pageCount);
+
+
+ // For Hishi
+ SizeF size = GetPDFDocInfo(0);
+ for (int i = 0; i < pageCount; i++)
+ {
+ result.Add(size);
+ }
+
+ /*
+ for (int i = 0; i < pageCount; i++)
+ {
+ result.Add(GetPDFDocInfo(i));
+ }
+ */
+ // <--
+
+ return result;
+ }
+
+ public SizeF GetPDFDocInfo(int pageNumber)
+ {
+ double height;
+ double width;
+ NativeMethods.FPDF_GetPageSizeByIndex(_document, pageNumber, out width, out height);
+
+ return new SizeF((float)width, (float)height);
+ }
+
+ public void Save(Stream stream)
+ {
+ NativeMethods.FPDF_SaveAsCopy(_document, stream, NativeMethods.FPDF_SAVE_FLAGS.FPDF_NO_INCREMENTAL);
+ }
+
+ protected void LoadDocument(IntPtr document)
+ {
+ _document = document;
+
+ NativeMethods.FPDF_GetDocPermissions(_document);
+
+ _formCallbacks = new NativeMethods.FPDF_FORMFILLINFO();
+ _formCallbacksHandle = GCHandle.Alloc(_formCallbacks, GCHandleType.Pinned);
+
+ // Depending on whether XFA support is built into the PDFium library, the version
+ // needs to be 1 or 2. We don't really care, so we just try one or the other.
+
+ for (int i = 1; i <= 2; i++)
+ {
+ _formCallbacks.version = i;
+
+ _form = NativeMethods.FPDFDOC_InitFormFillEnvironment(_document, _formCallbacks);
+ if (_form != IntPtr.Zero)
+ break;
+ }
+
+ NativeMethods.FPDF_SetFormFieldHighlightColor(_form, 0, 0xFFE4DD);
+ NativeMethods.FPDF_SetFormFieldHighlightAlpha(_form, 100);
+
+ NativeMethods.FORM_DoDocumentJSAction(_form);
+ NativeMethods.FORM_DoDocumentOpenAction(_form);
+
+ Bookmarks = new PdfBookmarkCollection();
+
+ LoadBookmarks(Bookmarks, NativeMethods.FPDF_BookmarkGetFirstChild(document, IntPtr.Zero));
+ }
+
+ private void LoadBookmarks(PdfBookmarkCollection bookmarks, IntPtr bookmark)
+ {
+ if (bookmark == IntPtr.Zero)
+ return;
+
+ bookmarks.Add(LoadBookmark(bookmark));
+ while ((bookmark = NativeMethods.FPDF_BookmarkGetNextSibling(_document, bookmark)) != IntPtr.Zero)
+ bookmarks.Add(LoadBookmark(bookmark));
+ }
+
+ private PdfBookmark LoadBookmark(IntPtr bookmark)
+ {
+ var result = new PdfBookmark
+ {
+ Title = GetBookmarkTitle(bookmark),
+ PageIndex = (int)GetBookmarkPageIndex(bookmark)
+ };
+
+ //Action = NativeMethods.FPDF_BookmarkGetAction(_bookmark);
+ //if (Action != IntPtr.Zero)
+ // ActionType = NativeMethods.FPDF_ActionGetType(Action);
+
+ var child = NativeMethods.FPDF_BookmarkGetFirstChild(_document, bookmark);
+ if (child != IntPtr.Zero)
+ LoadBookmarks(result.Children, child);
+
+ return result;
+ }
+
+ private string GetBookmarkTitle(IntPtr bookmark)
+ {
+ uint length = NativeMethods.FPDF_BookmarkGetTitle(bookmark, null, 0);
+ byte[] buffer = new byte[length];
+ NativeMethods.FPDF_BookmarkGetTitle(bookmark, buffer, length);
+
+ string result = Encoding.Unicode.GetString(buffer);
+ if (result.Length > 0 && result[result.Length - 1] == 0)
+ result = result.Substring(0, result.Length - 1);
+
+ return result;
+ }
+
+ private uint GetBookmarkPageIndex(IntPtr bookmark)
+ {
+ IntPtr dest = NativeMethods.FPDF_BookmarkGetDest(_document, bookmark);
+ if (dest != IntPtr.Zero)
+ return NativeMethods.FPDFDest_GetPageIndex(_document, dest);
+
+ return 0;
+ }
+
+ public PdfMatches Search(string text, bool matchCase, bool wholeWord, int startPage, int endPage)
+ {
+ var matches = new List();
+
+ if (String.IsNullOrEmpty(text))
+ return new PdfMatches(startPage, endPage, matches);
+
+ for (int page = startPage; page <= endPage; page++)
+ {
+ using (var pageData = new PageData(_document, _form, page))
+ {
+ NativeMethods.FPDF_SEARCH_FLAGS flags = 0;
+ if (matchCase)
+ flags |= NativeMethods.FPDF_SEARCH_FLAGS.FPDF_MATCHCASE;
+ if (wholeWord)
+ flags |= NativeMethods.FPDF_SEARCH_FLAGS.FPDF_MATCHWHOLEWORD;
+
+ var handle = NativeMethods.FPDFText_FindStart(pageData.TextPage, FPDFEncoding.GetBytes(text), flags, 0);
+
+ try
+ {
+ while (NativeMethods.FPDFText_FindNext(handle))
+ {
+ int index = NativeMethods.FPDFText_GetSchResultIndex(handle);
+
+ int matchLength = NativeMethods.FPDFText_GetSchCount(handle);
+
+ var result = new byte[(matchLength + 1) * 2];
+ NativeMethods.FPDFText_GetText(pageData.TextPage, index, matchLength, result);
+ string match = FPDFEncoding.GetString(result, 0, matchLength * 2);
+
+ matches.Add(new PdfMatch(
+ match,
+ new PdfTextSpan(page, index, matchLength),
+ page
+ ));
+ }
+ }
+ finally
+ {
+ NativeMethods.FPDFText_FindClose(handle);
+ }
+ }
+ }
+
+ return new PdfMatches(startPage, endPage, matches);
+ }
+
+ public IList GetTextBounds(PdfTextSpan textSpan)
+ {
+ using (var pageData = new PageData(_document, _form, textSpan.Page))
+ {
+ return GetTextBounds(pageData.TextPage, textSpan.Page, textSpan.Offset, textSpan.Length);
+ }
+ }
+
+ public Point PointFromPdf(int page, PointF point)
+ {
+ using (var pageData = new PageData(_document, _form, page))
+ {
+ NativeMethods.FPDF_PageToDevice(
+ pageData.Page,
+ 0,
+ 0,
+ (int)pageData.Width,
+ (int)pageData.Height,
+ 0,
+ point.X,
+ point.Y,
+ out var deviceX,
+ out var deviceY
+ );
+
+ return new Point(deviceX, deviceY);
+ }
+ }
+
+ public Rectangle RectangleFromPdf(int page, RectangleF rect)
+ {
+ using (var pageData = new PageData(_document, _form, page))
+ {
+ NativeMethods.FPDF_PageToDevice(
+ pageData.Page,
+ 0,
+ 0,
+ (int)pageData.Width,
+ (int)pageData.Height,
+ 0,
+ rect.Left,
+ rect.Top,
+ out var deviceX1,
+ out var deviceY1
+ );
+
+ NativeMethods.FPDF_PageToDevice(
+ pageData.Page,
+ 0,
+ 0,
+ (int)pageData.Width,
+ (int)pageData.Height,
+ 0,
+ rect.Right,
+ rect.Bottom,
+ out var deviceX2,
+ out var deviceY2
+ );
+
+ return new Rectangle(
+ deviceX1,
+ deviceY1,
+ deviceX2 - deviceX1,
+ deviceY2 - deviceY1
+ );
+ }
+ }
+
+ public PointF PointToPdf(int page, Point point)
+ {
+ using (var pageData = new PageData(_document, _form, page))
+ {
+ NativeMethods.FPDF_DeviceToPage(
+ pageData.Page,
+ 0,
+ 0,
+ (int)pageData.Width,
+ (int)pageData.Height,
+ 0,
+ point.X,
+ point.Y,
+ out var deviceX,
+ out var deviceY
+ );
+
+ return new PointF((float)deviceX, (float)deviceY);
+ }
+ }
+
+ public RectangleF RectangleToPdf(int page, Rectangle rect)
+ {
+ using (var pageData = new PageData(_document, _form, page))
+ {
+ NativeMethods.FPDF_DeviceToPage(
+ pageData.Page,
+ 0,
+ 0,
+ (int)pageData.Width,
+ (int)pageData.Height,
+ 0,
+ rect.Left,
+ rect.Top,
+ out var deviceX1,
+ out var deviceY1
+ );
+
+ NativeMethods.FPDF_DeviceToPage(
+ pageData.Page,
+ 0,
+ 0,
+ (int)pageData.Width,
+ (int)pageData.Height,
+ 0,
+ rect.Right,
+ rect.Bottom,
+ out var deviceX2,
+ out var deviceY2
+ );
+
+ return new RectangleF(
+ (float)deviceX1,
+ (float)deviceY1,
+ (float)(deviceX2 - deviceX1),
+ (float)(deviceY2 - deviceY1)
+ );
+ }
+ }
+
+ private IList GetTextBounds(IntPtr textPage, int page, int index, int matchLength)
+ {
+ var result = new List();
+ RectangleF? lastBounds = null;
+
+ for (int i = 0; i < matchLength; i++)
+ {
+ var bounds = GetBounds(textPage, index + i);
+
+ if (bounds.Width == 0 || bounds.Height == 0)
+ continue;
+
+ if (
+ lastBounds.HasValue &&
+ AreClose(lastBounds.Value.Right, bounds.Left) &&
+ AreClose(lastBounds.Value.Top, bounds.Top) &&
+ AreClose(lastBounds.Value.Bottom, bounds.Bottom)
+ )
+ {
+ float top = Math.Max(lastBounds.Value.Top, bounds.Top);
+ float bottom = Math.Min(lastBounds.Value.Bottom, bounds.Bottom);
+
+ lastBounds = new RectangleF(
+ lastBounds.Value.Left,
+ top,
+ bounds.Right - lastBounds.Value.Left,
+ bottom - top
+ );
+
+ result[result.Count - 1] = new PdfRectangle(page, lastBounds.Value);
+ }
+ else
+ {
+ lastBounds = bounds;
+ result.Add(new PdfRectangle(page, bounds));
+ }
+ }
+
+ return result;
+ }
+
+ private bool AreClose(float p1, float p2)
+ {
+ return Math.Abs(p1 - p2) < 4f;
+ }
+
+ private RectangleF GetBounds(IntPtr textPage, int index)
+ {
+ NativeMethods.FPDFText_GetCharBox(
+ textPage,
+ index,
+ out var left,
+ out var right,
+ out var bottom,
+ out var top
+ );
+
+ return new RectangleF(
+ (float)left,
+ (float)top,
+ (float)(right - left),
+ (float)(bottom - top)
+ );
+ }
+
+ public string GetPdfText(int page)
+ {
+ using (var pageData = new PageData(_document, _form, page))
+ {
+ int length = NativeMethods.FPDFText_CountChars(pageData.TextPage);
+ return GetPdfText(pageData, new PdfTextSpan(page, 0, length));
+ }
+ }
+
+ public string GetPdfText(PdfTextSpan textSpan)
+ {
+ using (var pageData = new PageData(_document, _form, textSpan.Page))
+ {
+ return GetPdfText(pageData, textSpan);
+ }
+ }
+
+ private string GetPdfText(PageData pageData, PdfTextSpan textSpan)
+ {
+ var result = new byte[(textSpan.Length + 1) * 2];
+ NativeMethods.FPDFText_GetText(pageData.TextPage, textSpan.Offset, textSpan.Length, result);
+ return FPDFEncoding.GetString(result, 0, textSpan.Length * 2);
+ }
+
+ public void DeletePage (int pageNumber)
+ {
+ NativeMethods.FPDFPage_Delete(_document, pageNumber);
+ }
+
+ public void RotatePage (int pageNumber, PdfRotation rotation)
+ {
+ using (var pageData = new PageData(_document, _form, pageNumber))
+ {
+ NativeMethods.FPDFPage_SetRotation(pageData.Page, rotation);
+ }
+ }
+
+ public PdfInformation GetInformation()
+ {
+ var pdfInfo = new PdfInformation();
+
+ pdfInfo.Creator = GetMetaText("Creator");
+ pdfInfo.Title = GetMetaText("Title");
+ pdfInfo.Author = GetMetaText("Author");
+ pdfInfo.Subject = GetMetaText("Subject");
+ pdfInfo.Keywords = GetMetaText("Keywords");
+ pdfInfo.Producer = GetMetaText("Producer");
+ pdfInfo.CreationDate = GetMetaTextAsDate("CreationDate");
+ pdfInfo.ModificationDate = GetMetaTextAsDate("ModDate");
+
+ return pdfInfo;
+ }
+
+ private string GetMetaText(string tag)
+ {
+ // Length includes a trailing \0.
+
+ uint length = NativeMethods.FPDF_GetMetaText(_document, tag, null, 0);
+ if (length <= 2)
+ return string.Empty;
+
+ byte[] buffer = new byte[length];
+ NativeMethods.FPDF_GetMetaText(_document, tag, buffer, length);
+
+ return Encoding.Unicode.GetString(buffer, 0, (int)(length - 2));
+ }
+
+ public DateTime? GetMetaTextAsDate(string tag)
+ {
+ string dt = GetMetaText(tag);
+
+ if (string.IsNullOrEmpty(dt))
+ return null;
+
+ Regex dtRegex =
+ new Regex(
+ @"(?:D:)(?\d\d\d\d)(?\d\d)(?\d\d)(?\d\d)(?\d\d)(?\d\d)(?[+-zZ])?(?\d\d)?'?(?\d\d)?'?");
+
+ Match match = dtRegex.Match(dt);
+
+ if (match.Success)
+ {
+ var year = match.Groups["year"].Value;
+ var month = match.Groups["month"].Value;
+ var day = match.Groups["day"].Value;
+ var hour = match.Groups["hour"].Value;
+ var minute = match.Groups["minute"].Value;
+ var second = match.Groups["second"].Value;
+ var tzOffset = match.Groups["tz_offset"]?.Value;
+ var tzHour = match.Groups["tz_hour"]?.Value;
+ var tzMinute = match.Groups["tz_minute"]?.Value;
+
+ string formattedDate = $"{year}-{month}-{day}T{hour}:{minute}:{second}.0000000";
+
+ if (!string.IsNullOrEmpty(tzOffset))
+ {
+ switch (tzOffset)
+ {
+ case "Z":
+ case "z":
+ formattedDate += "+0";
+ break;
+ case "+":
+ case "-":
+ formattedDate += $"{tzOffset}{tzHour}:{tzMinute}";
+ break;
+ }
+ }
+
+ try
+ {
+ return DateTime.Parse(formattedDate);
+ }
+ catch (FormatException)
+ {
+ return null;
+ }
+ }
+
+ return null;
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+
+ GC.SuppressFinalize(this);
+ }
+
+ protected virtual void Dispose(bool disposing)
+ {
+ if (!_disposed)
+ {
+ StreamManager.Unregister(_id);
+
+ if (_form != IntPtr.Zero)
+ {
+ NativeMethods.FORM_DoDocumentAAction(_form, NativeMethods.FPDFDOC_AACTION.WC);
+ NativeMethods.FPDFDOC_ExitFormFillEnvironment(_form);
+ _form = IntPtr.Zero;
+ }
+
+ if (_document != IntPtr.Zero)
+ {
+ NativeMethods.FPDF_CloseDocument(_document);
+ _document = IntPtr.Zero;
+ }
+
+ if (_formCallbacksHandle.IsAllocated)
+ _formCallbacksHandle.Free();
+
+ if (_stream != null)
+ {
+ _stream.Dispose();
+ _stream = null;
+ }
+
+ _disposed = true;
+ }
+ }
+
+ private class PageData : IDisposable
+ {
+ private readonly IntPtr _form;
+ private bool _disposed;
+
+ public IntPtr Page { get; private set; }
+
+ public IntPtr TextPage { get; private set; }
+
+ public double Width { get; private set; }
+
+ public double Height { get; private set; }
+
+ public PageData(IntPtr document, IntPtr form, int pageNumber)
+ {
+ _form = form;
+
+ Page = NativeMethods.FPDF_LoadPage(document, pageNumber);
+ TextPage = NativeMethods.FPDFText_LoadPage(Page);
+ NativeMethods.FORM_OnAfterLoadPage(Page, form);
+ NativeMethods.FORM_DoPageAAction(Page, form, NativeMethods.FPDFPAGE_AACTION.OPEN);
+
+ Width = NativeMethods.FPDF_GetPageWidth(Page);
+ Height = NativeMethods.FPDF_GetPageHeight(Page);
+ }
+
+ public void Dispose()
+ {
+ if (!_disposed)
+ {
+ NativeMethods.FORM_DoPageAAction(Page, _form, NativeMethods.FPDFPAGE_AACTION.CLOSE);
+ NativeMethods.FORM_OnBeforeClosePage(Page, _form);
+ NativeMethods.FPDFText_ClosePage(TextPage);
+ NativeMethods.FPDF_ClosePage(Page);
+
+ _disposed = true;
+ }
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfInformation.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfInformation.cs
new file mode 100644
index 0000000000000000000000000000000000000000..efdff494d1399d8e5346e5e520e3b61295be5ef7
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfInformation.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ ///
+ /// Contains text from metadata of the document.
+ ///
+ public class PdfInformation
+ {
+ public string Author { get; set; }
+ public string Creator { get; set; }
+ public DateTime? CreationDate { get; set; }
+ public string Keywords { get; set; }
+ public DateTime? ModificationDate { get; set; }
+ public string Producer { get; set; }
+ public string Subject { get; set; }
+ public string Title { get; set; }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfLibrary.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfLibrary.cs
new file mode 100644
index 0000000000000000000000000000000000000000..4dc6679d387de6635bd86d012490a317337b05eb
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfLibrary.cs
@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+using System.Runtime.InteropServices;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ internal class PdfLibrary : IDisposable
+ {
+ private static readonly object _syncRoot = new object();
+ private static PdfLibrary _library;
+
+ public static void EnsureLoaded()
+ {
+ lock (_syncRoot)
+ {
+ if (_library == null)
+ _library = new PdfLibrary();
+ }
+ }
+
+ private bool _disposed;
+
+ private PdfLibrary()
+ {
+ NativeMethods.FPDF_AddRef();
+ }
+
+ ~PdfLibrary()
+ {
+ Dispose(false);
+ }
+
+ public void Dispose()
+ {
+ Dispose(true);
+
+ GC.SuppressFinalize(this);
+ }
+
+ private void Dispose(bool disposing)
+ {
+ if (!_disposed)
+ {
+ NativeMethods.FPDF_Release();
+
+ _disposed = true;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMarker.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMarker.cs
new file mode 100644
index 0000000000000000000000000000000000000000..e483e56d16109c410e426d699758d1ed730f7583
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMarker.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public class PdfMarker : IPdfMarker
+ {
+ public int Page { get; }
+ public RectangleF Bounds { get; }
+ public Color Color { get; }
+ public Color BorderColor { get; }
+ public float BorderWidth { get; }
+
+ public PdfMarker(int page, RectangleF bounds, Color color)
+ : this(page, bounds, color, Color.Transparent, 0)
+ {
+ }
+
+ public PdfMarker(int page, RectangleF bounds, Color color, Color borderColor, float borderWidth)
+ {
+ Page = page;
+ Bounds = bounds;
+ Color = color;
+ BorderColor = borderColor;
+ BorderWidth = borderWidth;
+ }
+
+ public void Draw(PdfRenderer renderer, Graphics graphics)
+ {
+ if (renderer == null)
+ throw new ArgumentNullException(nameof(renderer));
+ if (graphics == null)
+ throw new ArgumentNullException(nameof(graphics));
+
+ var bounds = renderer.BoundsFromPdf(new PdfRectangle(Page, Bounds));
+
+ using (var brush = new SolidBrush(Color))
+ {
+ graphics.FillRectangle(brush, bounds);
+ }
+
+ if (BorderWidth > 0)
+ {
+ using (var pen = new Pen(BorderColor, BorderWidth))
+ {
+ graphics.DrawRectangle(pen, bounds.X, bounds.Y, bounds.Width, bounds.Height);
+ }
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMarkerCollection.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMarkerCollection.cs
new file mode 100644
index 0000000000000000000000000000000000000000..59460dc40a56e383adb1bd746cc2d5a07e038526
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMarkerCollection.cs
@@ -0,0 +1,47 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public class PdfMarkerCollection : Collection
+ {
+ public event EventHandler CollectionChanged;
+
+ protected override void ClearItems()
+ {
+ base.ClearItems();
+
+ OnCollectionChanged(EventArgs.Empty);
+ }
+
+ protected override void InsertItem(int index, IPdfMarker item)
+ {
+ base.InsertItem(index, item);
+
+ OnCollectionChanged(EventArgs.Empty);
+ }
+
+ protected override void RemoveItem(int index)
+ {
+ base.RemoveItem(index);
+
+ OnCollectionChanged(EventArgs.Empty);
+ }
+
+ protected override void SetItem(int index, IPdfMarker item)
+ {
+ base.SetItem(index, item);
+
+ OnCollectionChanged(EventArgs.Empty);
+ }
+
+ protected virtual void OnCollectionChanged(EventArgs e)
+ {
+ CollectionChanged?.Invoke(this, e);
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMatch.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMatch.cs
new file mode 100644
index 0000000000000000000000000000000000000000..2d4ff821a2ca853383e8d814534ce6066b033d8f
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMatch.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public class PdfMatch
+ {
+ public string Text { get; }
+ public PdfTextSpan TextSpan { get; }
+ public int Page { get; }
+
+ public PdfMatch(string text, PdfTextSpan textSpan, int page)
+ {
+ Text = text;
+ TextSpan = textSpan;
+ Page = page;
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMatches.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMatches.cs
new file mode 100644
index 0000000000000000000000000000000000000000..084733cae5c0986f17dd143ca0cafdecf7e4548d
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfMatches.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public class PdfMatches
+ {
+ public int StartPage { get; private set; }
+
+ public int EndPage { get; private set; }
+
+ public IList Items { get; private set; }
+
+ public PdfMatches(int startPage, int endPage, IList matches)
+ {
+ if (matches == null)
+ throw new ArgumentNullException("matches");
+
+ StartPage = startPage;
+ EndPage = endPage;
+ Items = new ReadOnlyCollection(matches);
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPageLink.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPageLink.cs
new file mode 100644
index 0000000000000000000000000000000000000000..6d38faf7edc306a793b2e72c7ed140bc6ef894af
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPageLink.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Describes a link on a page.
+ ///
+ public class PdfPageLink
+ {
+ ///
+ /// The location of the link.
+ ///
+ public RectangleF Bounds { get; private set; }
+
+ ///
+ /// The target of the link.
+ ///
+ public int? TargetPage { get; private set; }
+
+ ///
+ /// The target URI of the link.
+ ///
+ public string Uri { get; private set; }
+
+ ///
+ /// Creates a new instance of the PdfPageLink class.
+ ///
+ /// The location of the link
+ /// The target page of the link
+ /// The target URI of the link
+ public PdfPageLink(RectangleF bounds, int? targetPage, string uri)
+ {
+ Bounds = bounds;
+ TargetPage = targetPage;
+ Uri = uri;
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPageLinks.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPageLinks.cs
new file mode 100644
index 0000000000000000000000000000000000000000..6cdbeccb25df544148493ecd374fa45756497285
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPageLinks.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Describes all links on a page.
+ ///
+ public class PdfPageLinks
+ {
+ ///
+ /// All links of the page.
+ ///
+ public IList Links { get; private set; }
+
+ ///
+ /// Creates a new instance of the PdfPageLinks class.
+ ///
+ /// The links on the PDF page.
+ public PdfPageLinks(IList links)
+ {
+ if (links == null)
+ throw new ArgumentNullException("links");
+
+ Links = new ReadOnlyCollection(links);
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPoint.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPoint.cs
new file mode 100644
index 0000000000000000000000000000000000000000..71ac05081aadde3379608f7302628b4237b20bfe
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPoint.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public struct PdfPoint : IEquatable
+ {
+ public static readonly PdfPoint Empty = new PdfPoint();
+
+ // _page is offset by 1 so that Empty returns an invalid point.
+ private readonly int _page;
+
+ public int Page
+ {
+ get { return _page - 1; }
+ }
+
+ public PointF Location { get; }
+
+ public bool IsValid
+ {
+ get { return _page != 0; }
+ }
+
+ public PdfPoint(int page, PointF location)
+ {
+ _page = page + 1;
+ Location = location;
+ }
+
+ public bool Equals(PdfPoint other)
+ {
+ return
+ Page == other.Page &&
+ Location == other.Location;
+ }
+
+ public override bool Equals(object obj)
+ {
+ return
+ obj is PdfPoint &&
+ Equals((PdfPoint)obj);
+ }
+
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ return (Page * 397) ^ Location.GetHashCode();
+ }
+ }
+
+ public static bool operator ==(PdfPoint left, PdfPoint right)
+ {
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(PdfPoint left, PdfPoint right)
+ {
+ return !left.Equals(right);
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintDocument.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintDocument.cs
new file mode 100644
index 0000000000000000000000000000000000000000..9e3bcd2fbdba6e1174a5a5041c7ec2764a065413
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintDocument.cs
@@ -0,0 +1,230 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Printing;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ internal class PdfPrintDocument : PrintDocument
+ {
+ private readonly IPdfDocument _document;
+ private readonly PdfPrintSettings _settings;
+ private int _currentPage;
+
+ public event QueryPageSettingsEventHandler BeforeQueryPageSettings;
+
+ protected virtual void OnBeforeQueryPageSettings(QueryPageSettingsEventArgs e)
+ {
+ var ev = BeforeQueryPageSettings;
+ if (ev != null)
+ ev(this, e);
+ }
+
+ public event PrintPageEventHandler BeforePrintPage;
+
+ protected virtual void OnBeforePrintPage(PrintPageEventArgs e)
+ {
+ var ev = BeforePrintPage;
+ if (ev != null)
+ ev(this, e);
+ }
+
+ public PdfPrintDocument(IPdfDocument document, PdfPrintSettings settings)
+ {
+ if (document == null)
+ throw new ArgumentNullException("document");
+
+ _document = document;
+ _settings = settings;
+ }
+
+ protected override void OnBeginPrint(PrintEventArgs e)
+ {
+ _currentPage = PrinterSettings.FromPage == 0 ? 0 : PrinterSettings.FromPage - 1;
+
+ base.OnBeginPrint(e);
+ }
+
+ protected override void OnQueryPageSettings(QueryPageSettingsEventArgs e)
+ {
+ OnBeforeQueryPageSettings(e);
+
+ // Some printers misreport landscape. The below check verifies
+ // whether the page rotation matches the landscape setting.
+ bool inverseLandscape = e.PageSettings.Bounds.Width > e.PageSettings.Bounds.Height != e.PageSettings.Landscape;
+
+ if (_settings.MultiplePages == null && _currentPage < _document.PageCount)
+ {
+ bool landscape = GetOrientation(_document.PageSizes[_currentPage]) == Orientation.Landscape;
+
+ if (inverseLandscape)
+ landscape = !landscape;
+
+ e.PageSettings.Landscape = landscape;
+ }
+
+ base.OnQueryPageSettings(e);
+ }
+
+ protected override void OnPrintPage(PrintPageEventArgs e)
+ {
+ OnBeforePrintPage(e);
+
+ if (_settings.MultiplePages != null)
+ PrintMultiplePages(e);
+ else
+ PrintSinglePage(e);
+
+ base.OnPrintPage(e);
+ }
+
+ private void PrintMultiplePages(PrintPageEventArgs e)
+ {
+ var settings = _settings.MultiplePages;
+
+ int pagesPerPage = settings.Horizontal * settings.Vertical;
+ int pageCount = (_document.PageCount - 1) / pagesPerPage + 1;
+
+ if (_currentPage < pageCount)
+ {
+ double width = e.PageBounds.Width - e.PageSettings.HardMarginX * 2;
+ double height = e.PageBounds.Height - e.PageSettings.HardMarginY * 2;
+
+ double widthPerPage = (width - (settings.Horizontal - 1) * settings.Margin) / settings.Horizontal;
+ double heightPerPage = (height - (settings.Vertical - 1) * settings.Margin) / settings.Vertical;
+
+ for (int horizontal = 0; horizontal < settings.Horizontal; horizontal++)
+ {
+ for (int vertical = 0; vertical < settings.Vertical; vertical++)
+ {
+ int page = _currentPage * pagesPerPage;
+ if (settings.Orientation == System.Windows.Forms.Orientation.Horizontal)
+ page += vertical * settings.Vertical + horizontal;
+ else
+ page += horizontal * settings.Horizontal + vertical;
+
+ if (page >= _document.PageCount)
+ continue;
+
+ double pageLeft = (widthPerPage + settings.Margin) * horizontal;
+ double pageTop = (heightPerPage + settings.Margin) * vertical;
+
+ RenderPage(e, page, pageLeft, pageTop, widthPerPage, heightPerPage);
+ }
+ }
+
+ _currentPage++;
+ }
+
+ if (PrinterSettings.ToPage > 0)
+ pageCount = Math.Min(PrinterSettings.ToPage, pageCount);
+
+ e.HasMorePages = _currentPage < pageCount;
+ }
+
+ private void PrintSinglePage(PrintPageEventArgs e)
+ {
+ if (_currentPage < _document.PageCount)
+ {
+ var pageOrientation = GetOrientation(_document.PageSizes[_currentPage]);
+ var printOrientation = GetOrientation(e.PageBounds.Size);
+
+ e.PageSettings.Landscape = pageOrientation == Orientation.Landscape;
+
+ double left;
+ double top;
+ double width;
+ double height;
+
+ if (_settings.Mode == PdfPrintMode.ShrinkToMargin)
+ {
+ left = 0;
+ top = 0;
+ width = e.PageBounds.Width - e.PageSettings.HardMarginX * 2;
+ height = e.PageBounds.Height - e.PageSettings.HardMarginY * 2;
+ }
+ else
+ {
+ left = -e.PageSettings.HardMarginX;
+ top = -e.PageSettings.HardMarginY;
+ width = e.PageBounds.Width;
+ height = e.PageBounds.Height;
+ }
+
+ if (pageOrientation != printOrientation)
+ {
+ Swap(ref height, ref width);
+ Swap(ref left, ref top);
+ }
+
+ RenderPage(e, _currentPage, left, top, width, height);
+ _currentPage++;
+ }
+
+ int pageCount = PrinterSettings.ToPage == 0
+ ? _document.PageCount
+ : Math.Min(PrinterSettings.ToPage, _document.PageCount);
+
+ e.HasMorePages = _currentPage < pageCount;
+ }
+
+ private void RenderPage(PrintPageEventArgs e, int page, double left, double top, double width, double height)
+ {
+ var size = _document.PageSizes[page];
+
+ double pageScale = size.Height / size.Width;
+ double printScale = height / width;
+
+ double scaledWidth = width;
+ double scaledHeight = height;
+
+ if (pageScale > printScale)
+ scaledWidth = width * (printScale / pageScale);
+ else
+ scaledHeight = height * (pageScale / printScale);
+
+ left += (width - scaledWidth) / 2;
+ top += (height - scaledHeight) / 2;
+
+ _document.Render(
+ page,
+ e.Graphics,
+ e.Graphics.DpiX,
+ e.Graphics.DpiY,
+ new Rectangle(
+ AdjustDpi(e.Graphics.DpiX, left),
+ AdjustDpi(e.Graphics.DpiY, top),
+ AdjustDpi(e.Graphics.DpiX, scaledWidth),
+ AdjustDpi(e.Graphics.DpiY, scaledHeight)
+ ),
+ PdfRenderFlags.ForPrinting | PdfRenderFlags.Annotations
+ );
+ }
+
+ private static void Swap(ref double a, ref double b)
+ {
+ var tmp = a;
+ a = b;
+ b = tmp;
+ }
+
+ private static int AdjustDpi(double value, double dpi)
+ {
+ return (int)((value / 100.0) * dpi);
+ }
+
+ private Orientation GetOrientation(SizeF pageSize)
+ {
+ if (pageSize.Height > pageSize.Width)
+ return Orientation.Portrait;
+ return Orientation.Landscape;
+ }
+
+ private enum Orientation
+ {
+ Portrait,
+ Landscape
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintMode.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintMode.cs
new file mode 100644
index 0000000000000000000000000000000000000000..5c6edab6bcc8401e9ae3e9c6ab0fd8716f71d695
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintMode.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Specifies the mode in which the document should be printed.
+ ///
+ ///
+ /// Printers have a hard margin. This is a (small) margin on which it is not
+ /// possible to print. PdfPrintMode specifies whether the page should be
+ /// scaled to fit into this margin, or that the margin should be cut off of
+ /// the page.
+ ///
+ public enum PdfPrintMode
+ {
+ ///
+ /// Shrink the print area to fall within the hard printer margin.
+ ///
+ ShrinkToMargin,
+ ///
+ /// Cut the hard printer margin from the output.
+ ///
+ CutMargin
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintMultiplePages.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintMultiplePages.cs
new file mode 100644
index 0000000000000000000000000000000000000000..ecebc0172c386e64000b427834dad1407ebedb70
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintMultiplePages.cs
@@ -0,0 +1,57 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Configuration for printing multiple PDF pages on a single page.
+ ///
+ public class PdfPrintMultiplePages
+ {
+ ///
+ /// Gets the number of pages to print horizontally.
+ ///
+ public int Horizontal { get; }
+
+ ///
+ /// Gets the number of pages to print vertically.
+ ///
+ public int Vertical { get; }
+
+ ///
+ /// Gets the orientation in which PDF pages are layed out on the
+ /// physical page.
+ ///
+ public Orientation Orientation { get; }
+
+ ///
+ /// Gets the margin between PDF pages in device units.
+ ///
+ public float Margin { get; }
+
+ ///
+ /// Creates a new instance of the PdfPrintMultiplePages class.
+ ///
+ /// The number of pages to print horizontally.
+ /// The number of pages to print vertically.
+ /// The orientation in which PDF pages are layed out on
+ /// the physical page.
+ /// The margin between PDF pages in device units.
+ public PdfPrintMultiplePages(int horizontal, int vertical, Orientation orientation, float margin)
+ {
+ if (horizontal < 1)
+ throw new ArgumentOutOfRangeException("horizontal cannot be less than one");
+ if (vertical < 1)
+ throw new ArgumentOutOfRangeException("vertical cannot be less than one");
+ if (margin < 0)
+ throw new ArgumentOutOfRangeException("margin cannot be less than zero");
+
+ Horizontal = horizontal;
+ Vertical = vertical;
+ Orientation = orientation;
+ Margin = margin;
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintSettings.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintSettings.cs
new file mode 100644
index 0000000000000000000000000000000000000000..4578613da787f50beb719e68c78dd5ffd7b84c1d
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfPrintSettings.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Configures the print document.
+ ///
+ public class PdfPrintSettings
+ {
+ ///
+ /// Gets the mode used to print margins.
+ ///
+ public PdfPrintMode Mode { get; }
+
+
+ ///
+ /// Gets configuration for printing multiple PDF pages on a single page.
+ ///
+ public PdfPrintMultiplePages MultiplePages { get; }
+
+ ///
+ /// Creates a new instance of the PdfPrintSettings class.
+ ///
+ /// The mode used to print margins.
+ /// Configuration for printing multiple PDF
+ /// pages on a single page.
+ public PdfPrintSettings(PdfPrintMode mode, PdfPrintMultiplePages multiplePages)
+ {
+ Mode = mode;
+ MultiplePages = multiplePages;
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRectangle.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRectangle.cs
new file mode 100644
index 0000000000000000000000000000000000000000..ee4ee119f22a1d277624a246c5decc91cdfa850d
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRectangle.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public struct PdfRectangle : IEquatable
+ {
+ public static readonly PdfRectangle Empty = new PdfRectangle();
+
+ // _page is offset by 1 so that Empty returns an invalid rectangle.
+ private readonly int _page;
+
+ public int Page
+ {
+ get { return _page - 1; }
+ }
+
+ public RectangleF Bounds { get; }
+
+ public bool IsValid
+ {
+ get { return _page != 0; }
+ }
+
+ public PdfRectangle(int page, RectangleF bounds)
+ {
+ _page = page + 1;
+ Bounds = bounds;
+ }
+
+ public bool Equals(PdfRectangle other)
+ {
+ return
+ Page == other.Page &&
+ Bounds == other.Bounds;
+ }
+
+ public override bool Equals(object obj)
+ {
+ return
+ obj is PdfRectangle &&
+ Equals((PdfRectangle)obj);
+ }
+
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ return (Page * 397) ^ Bounds.GetHashCode();
+ }
+ }
+
+ public static bool operator ==(PdfRectangle left, PdfRectangle right)
+ {
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(PdfRectangle left, PdfRectangle right)
+ {
+ return !left.Equals(right);
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRenderFlags.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRenderFlags.cs
new file mode 100644
index 0000000000000000000000000000000000000000..778a53cd555ad786bb03e3762b7de97e1df3852a
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRenderFlags.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Flags that influence the page rendering process.
+ ///
+ [Flags]
+ public enum PdfRenderFlags
+ {
+ ///
+ /// No flags.
+ ///
+ None = 0,
+ ///
+ /// Render for printing.
+ ///
+ ForPrinting = NativeMethods.FPDF.PRINTING,
+ ///
+ /// Set if annotations are to be rendered.
+ ///
+ Annotations = NativeMethods.FPDF.ANNOT,
+ ///
+ /// Set if using text rendering optimized for LCD display.
+ ///
+ LcdText = NativeMethods.FPDF.LCD_TEXT,
+ ///
+ /// Don't use the native text output available on some platforms.
+ ///
+ NoNativeText = NativeMethods.FPDF.NO_NATIVETEXT,
+ ///
+ /// Grayscale output.
+ ///
+ Grayscale = NativeMethods.FPDF.GRAYSCALE,
+ ///
+ /// Limit image cache size.
+ ///
+ LimitImageCacheSize = NativeMethods.FPDF.RENDER_LIMITEDIMAGECACHE,
+ ///
+ /// Always use halftone for image stretching.
+ ///
+ ForceHalftone = NativeMethods.FPDF.RENDER_FORCEHALFTONE,
+ ///
+ /// Render with a transparent background.
+ ///
+ Transparent = 0x1000,
+ ///
+ /// Correct height/width for DPI.
+ ///
+ CorrectFromDpi = 0x2000
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRenderer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRenderer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..47b4ff98f27d82f05f791927525652577dbad921
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRenderer.cs
@@ -0,0 +1,1045 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Diagnostics;
+using System.Drawing;
+using System.Windows.Forms;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Control to render PDF documents.
+ ///
+ public class PdfRenderer : PanningZoomingScrollControl
+ {
+ private static readonly Padding PageMargin = new Padding(4);
+
+ private int _height;
+ private int _maxWidth;
+ private int _maxHeight;
+ private double _documentScaleFactor;
+ private bool _disposed;
+ private double _scaleFactor;
+ private ShadeBorder _shadeBorder = new ShadeBorder();
+ private int _suspendPaintCount;
+ private ToolTip _toolTip;
+ private PdfViewerZoomMode _zoomMode;
+ private bool _pageCacheValid;
+ private readonly List _pageCache = new List();
+ private int _visiblePageStart;
+ private int _visiblePageEnd;
+ private PageLink _cachedLink;
+ private DragState _dragState;
+ private PdfRotation _rotation;
+ private List[] _markers;
+
+ ///
+ /// The associated PDF document.
+ ///
+ public IPdfDocument Document { get; private set; }
+
+ ///
+ /// Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.
+ ///
+ ///
+ ///
+ /// true if the user can give the focus to the control using the TAB key; otherwise, false. The default is true.Note:This property will always return true for an instance of the class.
+ ///
+ /// 1
+ [DefaultValue(true)]
+ public new bool TabStop
+ {
+ get { return base.TabStop; }
+ set { base.TabStop = value; }
+ }
+
+ ///
+ /// Gets or sets the currently focused page.
+ ///
+ public int Page
+ {
+ get
+ {
+ if (Document == null || !_pageCacheValid)
+ return 0;
+
+ int top = -DisplayRectangle.Top;
+ int bottom = top + GetScrollClientArea().Height;
+
+ for (int page = 0; page < Document.PageSizes.Count; page++)
+ {
+ var pageCache = _pageCache[page].OuterBounds;
+ if (top - 10 < pageCache.Top)
+ {
+ // If more than 50% of the page is hidden, return the previous page.
+
+ int hidden = pageCache.Bottom - bottom;
+ if (hidden > 0 && (double)hidden / pageCache.Height > 0.5 && page > 0)
+ return page - 1;
+
+ return page;
+ }
+ }
+
+ return Document.PageCount - 1;
+ }
+ set
+ {
+ if (Document == null)
+ {
+ SetDisplayRectLocation(new Point(0, 0));
+ }
+ else
+ {
+ int page = Math.Min(Math.Max(value, 0), Document.PageCount - 1);
+
+ SetDisplayRectLocation(new Point(0, -_pageCache[page].OuterBounds.Top));
+ }
+ }
+ }
+
+ ///
+ /// Get the outer bounds of the page.
+ ///
+ /// The page to get the bounds for.
+ /// The bounds of the page.
+ public Rectangle GetOuterBounds(int page)
+ {
+ if (Document == null || !_pageCacheValid)
+ return Rectangle.Empty;
+
+ page = Math.Min(Math.Max(page, 0), Document.PageCount - 1);
+ return _pageCache[page].OuterBounds;
+ }
+
+ ///
+ /// Gets or sets the way the document should be zoomed initially.
+ ///
+ public PdfViewerZoomMode ZoomMode
+ {
+ get { return _zoomMode; }
+ set
+ {
+ _zoomMode = value;
+ PerformLayout();
+ }
+ }
+
+ ///
+ /// Gets or sets the current rotation of the PDF document.
+ ///
+ public PdfRotation Rotation
+ {
+ get { return _rotation; }
+ set
+ {
+ if (_rotation != value)
+ {
+ _rotation = value;
+ ResetFromRotation();
+ }
+ }
+ }
+
+ ///
+ /// Gets a collection with all markers.
+ ///
+ public PdfMarkerCollection Markers { get; }
+
+ ///
+ /// Initializes a new instance of the PdfRenderer class.
+ ///
+ public PdfRenderer()
+ {
+ SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.AllPaintingInWmPaint, true);
+
+ TabStop = true;
+
+ _toolTip = new ToolTip();
+
+ Markers = new PdfMarkerCollection();
+ Markers.CollectionChanged += Markers_CollectionChanged;
+ }
+
+ private void Markers_CollectionChanged(object sender, EventArgs e)
+ {
+ RedrawMarkers();
+ }
+
+ ///
+ /// Converts client coordinates to PDF coordinates.
+ ///
+ /// Client coordinates to get the PDF location for.
+ /// The location in a PDF page or a PdfPoint with IsValid false when the coordinates do not match a PDF page.
+ public PdfPoint PointToPdf(Point location)
+ {
+ if (Document == null)
+ return PdfPoint.Empty;
+
+ var offset = GetScrollOffset();
+ location.Offset(-offset.Width, -offset.Height);
+
+ for (int page = 0; page < Document.PageSizes.Count; page++)
+ {
+ var pageCache = _pageCache[page];
+ if (pageCache.OuterBounds.Contains(location))
+ {
+ if (pageCache.Bounds.Contains(location))
+ {
+ location = new Point(
+ location.X - pageCache.Bounds.X,
+ location.Y - pageCache.Bounds.Y
+ );
+ var translated = TranslatePointToPdf(pageCache.Bounds.Size, Document.PageSizes[page], location);
+ translated = Document.PointToPdf(page, new Point((int)translated.X, (int)translated.Y));
+
+ return new PdfPoint(page, translated);
+ }
+
+ break;
+ }
+ }
+
+ return PdfPoint.Empty;
+ }
+
+ ///
+ /// Converts a PDF point to a client point.
+ ///
+ /// The PDF point to convert.
+ /// The location of the point in client coordinates.
+ public Point PointFromPdf(PdfPoint point)
+ {
+ var offset = GetScrollOffset();
+ var pageBounds = _pageCache[point.Page].Bounds;
+
+ var translated = Document.PointFromPdf(point.Page, point.Location);
+ var location = TranslatePointFromPdf(pageBounds.Size, Document.PageSizes[point.Page], translated);
+
+ return new Point(
+ pageBounds.Left + offset.Width + location.X,
+ pageBounds.Top + offset.Height + location.Y
+ );
+ }
+
+ ///
+ /// Converts client coordinates to PDF bounds.
+ ///
+ /// The client coordinates to convert.
+ /// The PDF bounds.
+ public PdfRectangle BoundsToPdf(Rectangle bounds)
+ {
+ if (Document == null)
+ return PdfRectangle.Empty;
+
+ var offset = GetScrollOffset();
+ bounds.Offset(-offset.Width, -offset.Height);
+
+ for (int page = 0; page < Document.PageSizes.Count; page++)
+ {
+ var pageCache = _pageCache[page];
+ if (pageCache.OuterBounds.Contains(bounds.Location))
+ {
+ if (pageCache.Bounds.Contains(bounds.Location))
+ {
+ var topLeft = new Point(
+ bounds.Left - pageCache.Bounds.Left,
+ bounds.Top - pageCache.Bounds.Top
+ );
+ var bottomRight = new Point(
+ bounds.Right - pageCache.Bounds.Left,
+ bounds.Bottom - pageCache.Bounds.Top
+ );
+
+ var translatedTopLeft = TranslatePointToPdf(pageCache.Bounds.Size, Document.PageSizes[page], topLeft);
+ var translatedBottomRight = TranslatePointToPdf(pageCache.Bounds.Size, Document.PageSizes[page], bottomRight);
+
+ var translated = Document.RectangleToPdf(
+ page,
+ new Rectangle(
+ (int)translatedTopLeft.X,
+ (int)translatedTopLeft.Y,
+ (int)(translatedBottomRight.X - translatedTopLeft.X),
+ (int)(translatedBottomRight.Y - translatedTopLeft.Y)
+ )
+ );
+
+ return new PdfRectangle(page, translated);
+ }
+
+ break;
+ }
+ }
+
+ return PdfRectangle.Empty;
+ }
+
+ ///
+ /// Converts PDF bounds to client bounds.
+ ///
+ /// The PDF bounds to convert.
+ /// The bounds of the PDF bounds in client coordinates.
+ public Rectangle BoundsFromPdf(PdfRectangle bounds)
+ {
+ return BoundsFromPdf(bounds, true);
+ }
+
+ private Rectangle BoundsFromPdf(PdfRectangle bounds, bool translateOffset)
+ {
+ var offset = translateOffset ? GetScrollOffset() : Size.Empty;
+ var pageBounds = _pageCache[bounds.Page].Bounds;
+ var pageSize = Document.PageSizes[bounds.Page];
+
+ var translated = Document.RectangleFromPdf(
+ bounds.Page,
+ bounds.Bounds
+ );
+
+ var topLeft = TranslatePointFromPdf(pageBounds.Size, pageSize, new PointF(translated.Left, translated.Top));
+ var bottomRight = TranslatePointFromPdf(pageBounds.Size, pageSize, new PointF(translated.Right, translated.Bottom));
+
+ return new Rectangle(
+ pageBounds.Left + offset.Width + Math.Min(topLeft.X, bottomRight.X),
+ pageBounds.Top + offset.Height + Math.Min(topLeft.Y, bottomRight.Y),
+ Math.Abs(bottomRight.X - topLeft.X),
+ Math.Abs(bottomRight.Y - topLeft.Y)
+ );
+ }
+
+ private PointF TranslatePointToPdf(Size size, SizeF pageSize, Point point)
+ {
+ switch (Rotation)
+ {
+ case PdfRotation.Rotate90:
+ point = new Point(size.Height - point.Y, point.X);
+ size = new Size(size.Height, size.Width);
+ break;
+ case PdfRotation.Rotate180:
+ point = new Point(size.Width - point.X, size.Height - point.Y);
+ break;
+ case PdfRotation.Rotate270:
+ point = new Point(point.Y, size.Width - point.X);
+ size = new Size(size.Height, size.Width);
+ break;
+ }
+
+ return new PointF(
+ ((float)point.X / size.Width) * pageSize.Width,
+ ((float)point.Y / size.Height) * pageSize.Height
+ );
+ }
+
+ private Point TranslatePointFromPdf(Size size, SizeF pageSize, PointF point)
+ {
+ switch (Rotation)
+ {
+ case PdfRotation.Rotate90:
+ point = new PointF(pageSize.Height - point.Y, point.X);
+ pageSize = new SizeF(pageSize.Height, pageSize.Width);
+ break;
+ case PdfRotation.Rotate180:
+ point = new PointF(pageSize.Width - point.X, pageSize.Height - point.Y);
+ break;
+ case PdfRotation.Rotate270:
+ point = new PointF(point.Y, pageSize.Width - point.X);
+ pageSize = new SizeF(pageSize.Height, pageSize.Width);
+ break;
+ }
+
+ return new Point(
+ (int)((point.X / pageSize.Width) * size.Width),
+ (int)((point.Y / pageSize.Height) * size.Height)
+ );
+ }
+
+ private Size GetScrollOffset()
+ {
+ var bounds = GetScrollClientArea();
+ int maxWidth = (int)(_maxWidth * _scaleFactor) + ShadeBorder.Size.Horizontal + PageMargin.Horizontal;
+ int leftOffset = (HScroll ? DisplayRectangle.X : (bounds.Width - maxWidth) / 2) + maxWidth / 2;
+ int topOffset = VScroll ? DisplayRectangle.Y : 0;
+
+ return new Size(leftOffset, topOffset);
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// A that contains the event data.
+ protected override void OnLayout(LayoutEventArgs levent)
+ {
+ base.OnLayout(levent);
+
+ UpdateScrollbars();
+ }
+
+ ///
+ /// Called when the zoom level changes.
+ ///
+ /// The event args.
+ protected override void OnZoomChanged(EventArgs e)
+ {
+ base.OnZoomChanged(e);
+
+ UpdateScrollbars();
+ }
+
+ ///
+ /// Load a into the control.
+ ///
+ /// Document to load.
+ public void Load(IPdfDocument document)
+ {
+ if (document == null)
+ throw new ArgumentNullException("document");
+ if (document.PageCount == 0)
+ throw new ArgumentException("Document does not contain any pages", "document");
+
+ Document = document;
+
+ SetDisplayRectLocation(new Point(0, 0));
+
+ ReloadDocument();
+ }
+
+ private void ReloadDocument()
+ {
+ _height = 0;
+ _maxWidth = 0;
+ _maxHeight = 0;
+
+ foreach (var size in Document.PageSizes)
+ {
+ var translated = TranslateSize(size);
+ _height += (int)translated.Height;
+ _maxWidth = Math.Max((int)translated.Width, _maxWidth);
+ _maxHeight = Math.Max((int)translated.Height, _maxHeight);
+ }
+
+ _documentScaleFactor = _maxHeight != 0 ? (double)_maxWidth / _maxHeight : 0D;
+
+ _markers = null;
+
+ UpdateScrollbars();
+
+ Invalidate();
+ }
+
+ private void UpdateScrollbars()
+ {
+ if (Document == null)
+ return;
+
+ UpdateScaleFactor(ScrollBars.Both);
+
+ var bounds = GetScrollClientArea(ScrollBars.Both);
+
+ var documentSize = GetDocumentBounds().Size;
+
+ bool horizontalVisible = documentSize.Width > bounds.Width;
+
+ if (!horizontalVisible)
+ {
+ UpdateScaleFactor(ScrollBars.Vertical);
+
+ documentSize = GetDocumentBounds().Size;
+ }
+
+ _suspendPaintCount++;
+
+ try
+ {
+ SetDisplaySize(documentSize);
+ }
+ finally
+ {
+ _suspendPaintCount--;
+ }
+
+ RebuildPageCache();
+ }
+
+ private void RebuildPageCache()
+ {
+ if (Document == null || _suspendPaintCount > 0)
+ return;
+
+ _pageCacheValid = true;
+
+ int maxWidth = (int)(_maxWidth * _scaleFactor) + ShadeBorder.Size.Horizontal + PageMargin.Horizontal;
+ int leftOffset = -maxWidth / 2;
+
+ int offset = 0;
+
+ for (int page = 0; page < Document.PageSizes.Count; page++)
+ {
+ var size = TranslateSize(Document.PageSizes[page]);
+ int height = (int)(size.Height * _scaleFactor);
+ int fullHeight = height + ShadeBorder.Size.Vertical + PageMargin.Vertical;
+ int width = (int)(size.Width * _scaleFactor);
+ int maxFullWidth = (int)(_maxWidth * _scaleFactor) + ShadeBorder.Size.Horizontal + PageMargin.Horizontal;
+ int fullWidth = width + ShadeBorder.Size.Horizontal + PageMargin.Horizontal;
+ int thisLeftOffset = leftOffset + (maxFullWidth - fullWidth) / 2;
+
+ while (_pageCache.Count <= page)
+ {
+ _pageCache.Add(new PageCache());
+ }
+
+ var pageCache = _pageCache[page];
+
+ if (pageCache.Image != null)
+ {
+ pageCache.Image.Dispose();
+ pageCache.Image = null;
+ }
+
+ pageCache.Links = null;
+ pageCache.Bounds = new Rectangle(
+ thisLeftOffset + ShadeBorder.Size.Left + PageMargin.Left,
+ offset + ShadeBorder.Size.Top + PageMargin.Top,
+ width,
+ height
+ );
+ pageCache.OuterBounds = new Rectangle(
+ thisLeftOffset,
+ offset,
+ width + ShadeBorder.Size.Horizontal + PageMargin.Horizontal,
+ height + ShadeBorder.Size.Vertical + PageMargin.Vertical
+ );
+
+ offset += fullHeight;
+ }
+ }
+
+ private List GetPageLinks(int page)
+ {
+ var pageCache = _pageCache[page];
+ if (pageCache.Links == null)
+ {
+ pageCache.Links = new List();
+ foreach (var link in Document.GetPageLinks(page, pageCache.Bounds.Size).Links)
+ {
+ pageCache.Links.Add(new PageLink(link, BoundsFromPdf(new PdfRectangle(page, link.Bounds), false)));
+ }
+ }
+
+ return pageCache.Links;
+ }
+
+ private Rectangle GetScrollClientArea()
+ {
+ ScrollBars scrollBarsVisible;
+
+ if (HScroll && VScroll)
+ scrollBarsVisible = ScrollBars.Both;
+ else if (HScroll)
+ scrollBarsVisible = ScrollBars.Horizontal;
+ else if (VScroll)
+ scrollBarsVisible = ScrollBars.Vertical;
+ else
+ scrollBarsVisible = ScrollBars.None;
+
+ return GetScrollClientArea(scrollBarsVisible);
+ }
+
+ private Rectangle GetScrollClientArea(ScrollBars scrollbars)
+ {
+ return new Rectangle(
+ 0,
+ 0,
+ scrollbars == ScrollBars.Vertical || scrollbars == ScrollBars.Both ? Width - SystemInformation.VerticalScrollBarWidth : Width,
+ scrollbars == ScrollBars.Horizontal || scrollbars == ScrollBars.Both ? Height - SystemInformation.HorizontalScrollBarHeight : Height
+ );
+ }
+
+ private void UpdateScaleFactor(ScrollBars scrollBars)
+ {
+ var bounds = GetScrollClientArea(scrollBars);
+
+ // Scale factor determines what we need to multiply the dimensions
+ // of the metafile with to get the size in the control.
+
+ var zoomMode = CalculateZoomModeForFitBest(bounds);
+
+ if (zoomMode == PdfViewerZoomMode.FitHeight)
+ {
+ int height = bounds.Height - ShadeBorder.Size.Vertical - PageMargin.Vertical;
+
+ _scaleFactor = ((double)height / _maxHeight) * Zoom;
+ }
+ else
+ {
+ int width = bounds.Width - ShadeBorder.Size.Horizontal - PageMargin.Horizontal;
+
+ _scaleFactor = ((double)width / _maxWidth) * Zoom;
+ }
+ }
+
+ private PdfViewerZoomMode CalculateZoomModeForFitBest(Rectangle bounds)
+ {
+ if (ZoomMode != PdfViewerZoomMode.FitBest)
+ {
+ return ZoomMode;
+ }
+
+ var controlScaleFactor = (double)bounds.Width / bounds.Height;
+
+ return controlScaleFactor >= _documentScaleFactor ? PdfViewerZoomMode.FitHeight : PdfViewerZoomMode.FitWidth;
+ }
+
+ ///
+ /// Raises the event.
+ ///
+ /// A that contains the event data.
+ protected override void OnPaint(PaintEventArgs e)
+ {
+ if (Document == null || _suspendPaintCount > 0 || !_pageCacheValid)
+ return;
+
+ EnsureMarkers();
+
+ var offset = GetScrollOffset();
+ var bounds = GetScrollClientArea();
+
+ using (var brush = new SolidBrush(BackColor))
+ {
+ e.Graphics.FillRectangle(brush, e.ClipRectangle);
+ }
+
+ _visiblePageStart = -1;
+ _visiblePageEnd = -1;
+
+ for (int page = 0; page < Document.PageSizes.Count; page++)
+ {
+ var pageCache = _pageCache[page];
+ var rectangle = pageCache.OuterBounds;
+ rectangle.Offset(offset.Width, offset.Height);
+
+ if (_visiblePageStart == -1)
+ {
+ if (rectangle.Bottom >= 0)
+ {
+ _visiblePageStart = page;
+ }
+ else if (pageCache.Image != null)
+ {
+ pageCache.Image.Dispose();
+ pageCache.Image = null;
+ }
+ }
+
+ if (rectangle.Top > bounds.Height)
+ {
+ if (_visiblePageEnd == -1)
+ _visiblePageEnd = page - 1;
+
+ if (pageCache.Image != null)
+ {
+ pageCache.Image.Dispose();
+ pageCache.Image = null;
+ }
+ }
+
+ if (e.ClipRectangle.IntersectsWith(rectangle))
+ {
+ var pageBounds = pageCache.Bounds;
+ pageBounds.Offset(offset.Width, offset.Height);
+
+ e.Graphics.FillRectangle(Brushes.White, pageBounds);
+
+ DrawPageImage(e.Graphics, page, pageBounds);
+
+ _shadeBorder.Draw(e.Graphics, pageBounds);
+
+ DrawMarkers(e.Graphics, page);
+ }
+ }
+
+ if (_visiblePageStart == -1)
+ _visiblePageStart = 0;
+ if (_visiblePageEnd == -1)
+ _visiblePageEnd = Document.PageCount - 1;
+ }
+
+ private void DrawPageImage(Graphics graphics, int page, Rectangle pageBounds)
+ {
+ var pageCache = _pageCache[page];
+
+ if (pageCache.Image == null)
+ pageCache.Image = Document.Render(page, pageBounds.Width, pageBounds.Height, graphics.DpiX, graphics.DpiY, Rotation, PdfRenderFlags.Annotations);
+
+ graphics.DrawImageUnscaled(pageCache.Image, pageBounds.Location);
+ }
+
+ ///
+ /// Gets the document bounds.
+ ///
+ /// The document bounds.
+ protected override Rectangle GetDocumentBounds()
+ {
+ int height = (int)(_height * _scaleFactor + (ShadeBorder.Size.Vertical + PageMargin.Vertical) * Document.PageCount);
+ int width = (int)(_maxWidth * _scaleFactor + ShadeBorder.Size.Horizontal + PageMargin.Horizontal);
+
+ var center = new Point(
+ DisplayRectangle.Width / 2,
+ DisplayRectangle.Height / 2
+ );
+
+ if (
+ DisplayRectangle.Width > ClientSize.Width ||
+ DisplayRectangle.Height > ClientSize.Height
+ ) {
+ center.X += DisplayRectangle.Left;
+ center.Y += DisplayRectangle.Top;
+ }
+
+ return new Rectangle(
+ center.X - width / 2,
+ center.Y - height / 2,
+ width,
+ height
+ );
+ }
+
+ ///
+ /// Called whent he cursor changes.
+ ///
+ /// The event args.
+ protected override void OnSetCursor(SetCursorEventArgs e)
+ {
+ _cachedLink = null;
+
+ if (_pageCacheValid)
+ {
+ var offset = GetScrollOffset();
+
+ var location = new Point(
+ e.Location.X - offset.Width,
+ e.Location.Y - offset.Height
+ );
+
+ for (int page = _visiblePageStart; page <= _visiblePageEnd; page++)
+ {
+ foreach (var link in GetPageLinks(page))
+ {
+ if (link.Bounds.Contains(location))
+ {
+ _cachedLink = link;
+ e.Cursor = Cursors.Hand;
+ return;
+ }
+ }
+ }
+ }
+
+ base.OnSetCursor(e);
+ }
+
+ /// Raises the event.
+ /// A that contains the event data.
+ protected override void OnMouseDown(MouseEventArgs e)
+ {
+ base.OnMouseDown(e);
+
+ _dragState = null;
+
+ if (_cachedLink != null)
+ {
+ _dragState = new DragState
+ {
+ Link = _cachedLink.Link,
+ Location = e.Location
+ };
+ }
+ }
+
+ /// Raises the event.
+ /// A that contains the event data.
+ protected override void OnMouseUp(MouseEventArgs e)
+ {
+ base.OnMouseUp(e);
+
+ if (_dragState == null)
+ return;
+
+ int dx = Math.Abs(e.Location.X - _dragState.Location.X);
+ int dy = Math.Abs(e.Location.Y - _dragState.Location.Y);
+
+ var link = _dragState.Link;
+ _dragState = null;
+
+ if (link == null)
+ return;
+
+ if (dx <= SystemInformation.DragSize.Width && dy <= SystemInformation.DragSize.Height)
+ {
+ var linkClickEventArgs = new LinkClickEventArgs(link);
+ HandleLinkClick(linkClickEventArgs);
+ }
+ }
+
+ private void HandleLinkClick(LinkClickEventArgs e)
+ {
+ OnLinkClick(e);
+
+ if (e.Handled)
+ return;
+
+ if (e.Link.TargetPage.HasValue)
+ Page = e.Link.TargetPage.Value;
+
+ if (e.Link.Uri != null)
+ {
+ try
+ {
+ Process.Start(e.Link.Uri);
+ }
+ catch
+ {
+ // Some browsers (Firefox) will cause an exception to
+ // be thrown (when it auto-updates).
+ }
+ }
+ }
+
+ ///
+ /// Occurs when a link in the pdf document is clicked.
+ ///
+ [Category("Action")]
+ [Description("Occurs when a link in the pdf document is clicked.")]
+ public event LinkClickEventHandler LinkClick;
+
+ ///
+ /// Called when a link is clicked.
+ ///
+ /// The event args.
+ protected virtual void OnLinkClick(LinkClickEventArgs e)
+ {
+ var handler = LinkClick;
+ if (handler != null)
+ handler(this, e);
+ }
+
+ ///
+ /// Rotate the PDF document left.
+ ///
+ public void RotateLeft()
+ {
+ Rotation = (PdfRotation)(((int)Rotation + 3) % 4);
+ }
+
+ ///
+ /// Rotate the PDF document right.
+ ///
+ public void RotateRight()
+ {
+ Rotation = (PdfRotation)(((int)Rotation + 1) % 4);
+ }
+
+ private void ResetFromRotation()
+ {
+ var offsetX = (double)DisplayRectangle.Left / DisplayRectangle.Width;
+ var offsetY = (double)DisplayRectangle.Top / DisplayRectangle.Height;
+
+ ReloadDocument();
+
+ SetDisplayRectLocation(new Point(
+ (int)(DisplayRectangle.Width * offsetX),
+ (int)(DisplayRectangle.Height * offsetY)
+ ));
+ }
+
+ private SizeF TranslateSize(SizeF size)
+ {
+ switch (Rotation)
+ {
+ case PdfRotation.Rotate90:
+ case PdfRotation.Rotate270:
+ return new SizeF(size.Height, size.Width);
+
+ default:
+ return size;
+ }
+ }
+
+ ///
+ /// Called when the zoom level changes.
+ ///
+ /// The new zoom level.
+ /// The location to focus on.
+ protected override void SetZoom(double zoom, Point? focus)
+ {
+ Point location;
+
+ if (focus.HasValue)
+ {
+ var bounds = GetDocumentBounds();
+
+ location = new Point(
+ focus.Value.X - bounds.X,
+ focus.Value.Y - bounds.Y
+ );
+ }
+ else
+ {
+ var bounds = _pageCacheValid
+ ? _pageCache[Page].Bounds
+ : GetDocumentBounds();
+
+ location = new Point(
+ bounds.X,
+ bounds.Y
+ );
+ }
+
+ double oldScale = Zoom;
+
+ base.SetZoom(zoom, null);
+
+ var newLocation = new Point(
+ (int)(location.X * (zoom / oldScale)),
+ (int)(location.Y * (zoom / oldScale))
+ );
+
+ SetDisplayRectLocation(
+ new Point(
+ DisplayRectangle.Left - (newLocation.X - location.X),
+ DisplayRectangle.Top - (newLocation.Y - location.Y)
+ ),
+ false
+ );
+ }
+
+ private void RedrawMarkers()
+ {
+ _markers = null;
+
+ Invalidate();
+ }
+
+ private void EnsureMarkers()
+ {
+ if (_markers != null)
+ return;
+
+ _markers = new List[_pageCache.Count];
+
+ foreach (var marker in Markers)
+ {
+ if (marker.Page < 0 || marker.Page >= _markers.Length)
+ continue;
+
+ if (_markers[marker.Page] == null)
+ _markers[marker.Page] = new List();
+
+ _markers[marker.Page].Add(marker);
+ }
+ }
+
+ private void DrawMarkers(Graphics graphics, int page)
+ {
+ var markers = _markers[page];
+ if (markers == null)
+ return;
+
+ foreach (var marker in markers)
+ {
+ marker.Draw(this, graphics);
+ }
+ }
+
+ ///
+ /// Scroll the PDF bounds into view.
+ ///
+ /// The PDF bounds to scroll into view.
+ public void ScrollIntoView(PdfRectangle bounds)
+ {
+ ScrollIntoView(BoundsFromPdf(bounds));
+ }
+
+ ///
+ /// Scroll the client rectangle into view.
+ ///
+ /// The client rectangle to scroll into view.
+ public void ScrollIntoView(Rectangle rectangle)
+ {
+ var clientArea = GetScrollClientArea();
+
+ if (rectangle.Top < 0 || rectangle.Bottom > clientArea.Height)
+ {
+ var displayRectangle = DisplayRectangle;
+ int center = rectangle.Top + rectangle.Height / 2;
+ int documentCenter = center - displayRectangle.Y;
+ int displayCenter = clientArea.Height / 2;
+ int offset = documentCenter - displayCenter;
+
+ SetDisplayRectLocation(new Point(
+ displayRectangle.X,
+ -offset
+ ));
+ }
+ }
+
+ ///
+ /// Releases the unmanaged resources used by the and its child controls and optionally releases the managed resources.
+ ///
+ /// true to release both managed and unmanaged resources; false to release only unmanaged resources.
+ protected override void Dispose(bool disposing)
+ {
+ if (!_disposed && disposing)
+ {
+ if (_shadeBorder != null)
+ {
+ _shadeBorder.Dispose();
+ _shadeBorder = null;
+ }
+
+ if (_toolTip != null)
+ {
+ _toolTip.Dispose();
+ _toolTip = null;
+ }
+
+ foreach (var pageCache in _pageCache)
+ {
+ if (pageCache.Image != null)
+ {
+ pageCache.Image.Dispose();
+ pageCache.Image = null;
+ }
+ }
+
+ _disposed = true;
+ }
+
+ base.Dispose(disposing);
+ }
+
+ private class PageCache
+ {
+ public List Links { get; set; }
+ public Rectangle Bounds { get; set; }
+ public Rectangle OuterBounds { get; set; }
+ public Image Image { get; set; }
+ }
+
+ private class PageLink
+ {
+ public PdfPageLink Link { get; }
+ public Rectangle Bounds { get; }
+
+ public PageLink(PdfPageLink link, Rectangle bounds)
+ {
+ Link = link;
+ Bounds = bounds;
+ }
+ }
+
+ private class DragState
+ {
+ public PdfPageLink Link { get; set; }
+ public Point Location { get; set; }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRotation.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRotation.cs
new file mode 100644
index 0000000000000000000000000000000000000000..567fce11bb03c0d96408d652650ecb53145f4c00
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfRotation.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Specifies the rotation of pages shown in the PDF renderer.
+ ///
+ public enum PdfRotation
+ {
+ ///
+ /// Rotates the output 0 degrees.
+ ///
+ Rotate0,
+ ///
+ /// Rotates the output 90 degrees.
+ ///
+ Rotate90,
+ ///
+ /// Rotates the output 180 degrees.
+ ///
+ Rotate180,
+ ///
+ /// Rotates the output 270 degrees.
+ ///
+ Rotate270
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfSearchManager.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfSearchManager.cs
new file mode 100644
index 0000000000000000000000000000000000000000..ba0333c85b5348c600e57d7d45fb3e61761bc880
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfSearchManager.cs
@@ -0,0 +1,250 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Helper class for searching through PDF documents.
+ ///
+ public class PdfSearchManager
+ {
+ private bool _highlightAllMatches;
+ private PdfMatches _matches;
+ private List> _bounds;
+ private int _firstMatch;
+ private int _offset;
+
+ ///
+ /// The renderer associated with the search manager.
+ ///
+ public PdfRenderer Renderer { get; }
+
+ ///
+ /// Gets or sets whether to match case.
+ ///
+ public bool MatchCase { get; set; }
+
+ ///
+ /// Gets or sets whether to match whole words.
+ ///
+ public bool MatchWholeWord { get; set; }
+
+ ///
+ /// Gets or sets the color of matched search terms.
+ ///
+ public Color MatchColor { get; }
+
+ ///
+ /// Gets or sets the border color of matched search terms.
+ ///
+ public Color MatchBorderColor { get; }
+
+ ///
+ /// Gets or sets the border width of matched search terms.
+ ///
+ public float MatchBorderWidth { get; }
+
+ ///
+ /// Gets or sets the color of the current match.
+ ///
+ public Color CurrentMatchColor { get; }
+
+ ///
+ /// Gets or sets the border color of the current match.
+ ///
+ public Color CurrentMatchBorderColor { get; }
+
+ ///
+ /// Gets or sets the border width of the current match.
+ ///
+ public float CurrentMatchBorderWidth { get; }
+
+ ///
+ /// Gets or sets whether all matches should be highlighted.
+ ///
+ public bool HighlightAllMatches
+ {
+ get { return _highlightAllMatches; }
+ set
+ {
+ if (_highlightAllMatches != value)
+ {
+ _highlightAllMatches = value;
+ UpdateHighlights();
+ }
+ }
+ }
+
+ ///
+ /// Creates a new instance of the search manager.
+ ///
+ /// The renderer to create the search manager for.
+ public PdfSearchManager(PdfRenderer renderer)
+ {
+ if (renderer == null)
+ throw new ArgumentNullException(nameof(renderer));
+
+ Renderer = renderer;
+
+ HighlightAllMatches = true;
+ MatchColor = Color.FromArgb(0x80, Color.Yellow);
+ CurrentMatchColor = Color.FromArgb(0x80, SystemColors.Highlight);
+ }
+
+ ///
+ /// Searches for the specified text.
+ ///
+ /// The text to search.
+ /// Whether any matches were found.
+ public bool Search(string text)
+ {
+ Renderer.Markers.Clear();
+
+ if (String.IsNullOrEmpty(text))
+ {
+ _matches = null;
+ _bounds = null;
+ }
+ else
+ {
+ _matches = Renderer.Document.Search(text, MatchCase, MatchWholeWord);
+ _bounds = GetAllBounds();
+ }
+
+ _offset = -1;
+
+ UpdateHighlights();
+
+ return _matches != null && _matches.Items.Count > 0;
+ }
+
+ private List> GetAllBounds()
+ {
+ var result = new List>();
+
+ foreach (var match in _matches.Items)
+ {
+ result.Add(Renderer.Document.GetTextBounds(match.TextSpan));
+ }
+
+ return result;
+ }
+
+ ///
+ /// Find the next matched term.
+ ///
+ /// Whether or not to search forward.
+ /// False when the first match was found again; otherwise true.
+ public bool FindNext(bool forward)
+ {
+ if (_matches == null || _matches.Items.Count == 0)
+ return false;
+
+ if (_offset == -1)
+ {
+ _offset = FindFirstFromCurrentPage();
+ _firstMatch = _offset;
+
+ UpdateHighlights();
+ ScrollCurrentIntoView();
+
+ return true;
+ }
+
+ if (forward)
+ {
+ _offset++;
+ if (_offset >= _matches.Items.Count)
+ _offset = 0;
+ }
+ else
+ {
+ _offset--;
+ if (_offset < 0)
+ _offset = _matches.Items.Count - 1;
+ }
+
+ UpdateHighlights();
+ ScrollCurrentIntoView();
+
+ return _offset != _firstMatch;
+ }
+
+ private void ScrollCurrentIntoView()
+ {
+ var current = _bounds[_offset];
+ if (current.Count > 0)
+ Renderer.ScrollIntoView(current[0]);
+ }
+
+ private int FindFirstFromCurrentPage()
+ {
+ for (int i = 0; i < Renderer.Document.PageCount; i++)
+ {
+ int page = (i + Renderer.Page) % Renderer.Document.PageCount;
+
+ for (int j = 0; j < _matches.Items.Count; j++)
+ {
+ var match = _matches.Items[j];
+ if (match.Page == page)
+ return j;
+ }
+ }
+
+ return 0;
+ }
+
+ ///
+ /// Resets the search manager.
+ ///
+ public void Reset()
+ {
+ Search(null);
+ }
+
+ private void UpdateHighlights()
+ {
+ Renderer.Markers.Clear();
+
+ if (_matches == null)
+ return;
+
+ if (_highlightAllMatches)
+ {
+ for (int i = 0; i < _matches.Items.Count; i++)
+ {
+ AddMatch(i, i == _offset);
+ }
+ }
+ else if (_offset != -1)
+ {
+ AddMatch(_offset, true);
+ }
+ }
+
+ private void AddMatch(int index, bool current)
+ {
+ foreach (var pdfBounds in _bounds[index])
+ {
+ var bounds = new RectangleF(
+ pdfBounds.Bounds.Left - 1,
+ pdfBounds.Bounds.Top + 1,
+ pdfBounds.Bounds.Width + 2,
+ pdfBounds.Bounds.Height - 2
+ );
+
+ var marker = new PdfMarker(
+ pdfBounds.Page,
+ bounds,
+ current ? CurrentMatchColor : MatchColor,
+ current ? CurrentMatchBorderColor : MatchBorderColor,
+ current ? CurrentMatchBorderWidth : MatchBorderWidth
+ );
+
+ Renderer.Markers.Add(marker);
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfTextSpan.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfTextSpan.cs
new file mode 100644
index 0000000000000000000000000000000000000000..363a2ed7183d90be286bd9b3d73f1e807d59e1c8
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfTextSpan.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public struct PdfTextSpan : IEquatable
+ {
+ public int Page { get; }
+ public int Offset { get; }
+ public int Length { get; }
+
+ public PdfTextSpan(int page, int offset, int length)
+ {
+ Page = page;
+ Offset = offset;
+ Length = length;
+ }
+
+ public bool Equals(PdfTextSpan other)
+ {
+ return
+ Page == other.Page &&
+ Offset == other.Offset &&
+ Length == other.Length;
+ }
+
+ public override bool Equals(object obj)
+ {
+ return
+ obj is PdfTextSpan &&
+ Equals((PdfTextSpan)obj);
+ }
+
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ int hashCode = Page;
+ hashCode = (hashCode * 397) ^ Offset;
+ hashCode = (hashCode * 397) ^ Length;
+ return hashCode;
+ }
+ }
+
+ public static bool operator ==(PdfTextSpan left, PdfTextSpan right)
+ {
+ return left.Equals(right);
+ }
+
+ public static bool operator !=(PdfTextSpan left, PdfTextSpan right)
+ {
+ return !left.Equals(right);
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..c8defc0f79aed8ea722e4fff3cfb8cd626190144
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.Designer.cs
@@ -0,0 +1,162 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ partial class PdfViewer
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PdfViewer));
+ this._toolStrip = new System.Windows.Forms.ToolStrip();
+ this._saveButton = new System.Windows.Forms.ToolStripButton();
+ this._printButton = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this._zoomInButton = new System.Windows.Forms.ToolStripButton();
+ this._zoomOutButton = new System.Windows.Forms.ToolStripButton();
+ this._container = new System.Windows.Forms.SplitContainer();
+ this._bookmarks = new PdfiumViewer.NativeTreeView();
+ this._renderer = new PdfiumViewer.PdfRenderer();
+ this._toolStrip.SuspendLayout();
+ this._container.Panel1.SuspendLayout();
+ this._container.Panel2.SuspendLayout();
+ this._container.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // _toolStrip
+ //
+ this._toolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden;
+ this._toolStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this._saveButton,
+ this._printButton,
+ this.toolStripSeparator1,
+ this._zoomInButton,
+ this._zoomOutButton});
+ resources.ApplyResources(this._toolStrip, "_toolStrip");
+ this._toolStrip.Name = "_toolStrip";
+ //
+ // _saveButton
+ //
+ this._saveButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this._saveButton.Image = global::PdfiumViewer.Properties.Resources.disk_blue;
+ resources.ApplyResources(this._saveButton, "_saveButton");
+ this._saveButton.Name = "_saveButton";
+ this._saveButton.Click += new System.EventHandler(this._saveButton_Click);
+ //
+ // _printButton
+ //
+ this._printButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this._printButton.Image = global::PdfiumViewer.Properties.Resources.printer;
+ resources.ApplyResources(this._printButton, "_printButton");
+ this._printButton.Name = "_printButton";
+ this._printButton.Click += new System.EventHandler(this._printButton_Click);
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
+ //
+ // _zoomInButton
+ //
+ this._zoomInButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this._zoomInButton.Image = global::PdfiumViewer.Properties.Resources.zoom_in;
+ resources.ApplyResources(this._zoomInButton, "_zoomInButton");
+ this._zoomInButton.Name = "_zoomInButton";
+ this._zoomInButton.Click += new System.EventHandler(this._zoomInButton_Click);
+ //
+ // _zoomOutButton
+ //
+ this._zoomOutButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this._zoomOutButton.Image = global::PdfiumViewer.Properties.Resources.zoom_out;
+ resources.ApplyResources(this._zoomOutButton, "_zoomOutButton");
+ this._zoomOutButton.Name = "_zoomOutButton";
+ this._zoomOutButton.Click += new System.EventHandler(this._zoomOutButton_Click);
+ //
+ // _container
+ //
+ resources.ApplyResources(this._container, "_container");
+ this._container.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
+ this._container.Name = "_container";
+ //
+ // _container.Panel1
+ //
+ this._container.Panel1.Controls.Add(this._bookmarks);
+ //
+ // _container.Panel2
+ //
+ this._container.Panel2.Controls.Add(this._renderer);
+ this._container.TabStop = false;
+ //
+ // _bookmarks
+ //
+ resources.ApplyResources(this._bookmarks, "_bookmarks");
+ this._bookmarks.FullRowSelect = true;
+ this._bookmarks.Name = "_bookmarks";
+ this._bookmarks.ShowLines = false;
+ this._bookmarks.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this._bookmarks_AfterSelect);
+ //
+ // _renderer
+ //
+ this._renderer.Cursor = System.Windows.Forms.Cursors.Default;
+ resources.ApplyResources(this._renderer, "_renderer");
+ this._renderer.Name = "_renderer";
+ this._renderer.Page = 0;
+ this._renderer.Rotation = PdfiumViewer.PdfRotation.Rotate0;
+ this._renderer.ZoomMode = PdfiumViewer.PdfViewerZoomMode.FitHeight;
+ this._renderer.LinkClick += new PdfiumViewer.LinkClickEventHandler(this._renderer_LinkClick);
+ //
+ // PdfViewer
+ //
+ resources.ApplyResources(this, "$this");
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this._container);
+ this.Controls.Add(this._toolStrip);
+ this.Name = "PdfViewer";
+ this._toolStrip.ResumeLayout(false);
+ this._toolStrip.PerformLayout();
+ this._container.Panel1.ResumeLayout(false);
+ this._container.Panel2.ResumeLayout(false);
+ this._container.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.ToolStrip _toolStrip;
+ private System.Windows.Forms.ToolStripButton _saveButton;
+ private System.Windows.Forms.ToolStripButton _printButton;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripButton _zoomInButton;
+ private System.Windows.Forms.ToolStripButton _zoomOutButton;
+ private System.Windows.Forms.SplitContainer _container;
+ private NativeTreeView _bookmarks;
+ private PdfRenderer _renderer;
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..4e7ec82bfa43d96ace6073ba6106a0e069cb44f9
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.cs
@@ -0,0 +1,246 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer
+{
+ ///
+ /// Control to host PDF documents with support for printing.
+ ///
+ public partial class PdfViewer : UserControl
+ {
+ private IPdfDocument _document;
+ private bool _showBookmarks;
+
+ ///
+ /// Gets or sets the PDF document.
+ ///
+ [DefaultValue(null)]
+ public IPdfDocument Document
+ {
+ get { return _document; }
+ set
+ {
+ if (_document != value)
+ {
+ _document = value;
+
+ if (_document != null)
+ {
+ _renderer.Load(_document);
+ UpdateBookmarks();
+ }
+
+ UpdateEnabled();
+ }
+ }
+ }
+
+ ///
+ /// Get the that renders the PDF document.
+ ///
+ public PdfRenderer Renderer
+ {
+ get { return _renderer; }
+ }
+
+ ///
+ /// Gets or sets the default document name used when saving the document.
+ ///
+ [DefaultValue(null)]
+ public string DefaultDocumentName { get; set; }
+
+ ///
+ /// Gets or sets the default print mode.
+ ///
+ [DefaultValue(PdfPrintMode.CutMargin)]
+ public PdfPrintMode DefaultPrintMode { get; set; }
+
+ ///
+ /// Gets or sets the way the document should be zoomed initially.
+ ///
+ [DefaultValue(PdfViewerZoomMode.FitHeight)]
+ public PdfViewerZoomMode ZoomMode
+ {
+ get { return _renderer.ZoomMode; }
+ set { _renderer.ZoomMode = value; }
+ }
+
+ ///
+ /// Gets or sets whether the toolbar should be shown.
+ ///
+ [DefaultValue(true)]
+ public bool ShowToolbar
+ {
+ get { return _toolStrip.Visible; }
+ set { _toolStrip.Visible = value; }
+ }
+
+ ///
+ /// Gets or sets whether the bookmarks panel should be shown.
+ ///
+ [DefaultValue(true)]
+ public bool ShowBookmarks
+ {
+ get { return _showBookmarks; }
+ set
+ {
+ _showBookmarks = value;
+ UpdateBookmarks();
+ }
+ }
+
+ ///
+ /// Gets or sets the pre-selected printer to be used when the print
+ /// dialog shows up.
+ ///
+ [DefaultValue(null)]
+ public string DefaultPrinter { get; set; }
+
+ ///
+ /// Occurs when a link in the pdf document is clicked.
+ ///
+ [Category("Action")]
+ [Description("Occurs when a link in the pdf document is clicked.")]
+ public event LinkClickEventHandler LinkClick;
+
+ ///
+ /// Called when a link is clicked.
+ ///
+ ///
+ protected virtual void OnLinkClick(LinkClickEventArgs e)
+ {
+ var handler = LinkClick;
+ if (handler != null)
+ handler(this, e);
+ }
+
+ private void UpdateBookmarks()
+ {
+ bool visible = _showBookmarks && _document != null && _document.Bookmarks.Count > 0;
+
+ _container.Panel1Collapsed = !visible;
+
+ if (visible)
+ {
+ _container.Panel1Collapsed = false;
+
+ _bookmarks.Nodes.Clear();
+ foreach (var bookmark in _document.Bookmarks)
+ _bookmarks.Nodes.Add(GetBookmarkNode(bookmark));
+ }
+ }
+
+ ///
+ /// Initializes a new instance of the PdfViewer class.
+ ///
+ public PdfViewer()
+ {
+ DefaultPrintMode = PdfPrintMode.CutMargin;
+
+ InitializeComponent();
+
+ ShowToolbar = true;
+ ShowBookmarks = true;
+
+ UpdateEnabled();
+ }
+
+ private void UpdateEnabled()
+ {
+ _toolStrip.Enabled = _document != null;
+ }
+
+ private void _zoomInButton_Click(object sender, EventArgs e)
+ {
+ _renderer.ZoomIn();
+ }
+
+ private void _zoomOutButton_Click(object sender, EventArgs e)
+ {
+ _renderer.ZoomOut();
+ }
+
+ private void _saveButton_Click(object sender, EventArgs e)
+ {
+ using (var form = new SaveFileDialog())
+ {
+ form.DefaultExt = ".pdf";
+ form.Filter = Properties.Resources.SaveAsFilter;
+ form.RestoreDirectory = true;
+ form.Title = Properties.Resources.SaveAsTitle;
+ form.FileName = DefaultDocumentName;
+
+ if (form.ShowDialog(FindForm()) == DialogResult.OK)
+ {
+ try
+ {
+ _document.Save(form.FileName);
+ }
+ catch
+ {
+ MessageBox.Show(
+ FindForm(),
+ Properties.Resources.SaveAsFailedText,
+ Properties.Resources.SaveAsFailedTitle,
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Error
+ );
+ }
+ }
+ }
+ }
+
+ private void _printButton_Click(object sender, EventArgs e)
+ {
+ using (var form = new PrintDialog())
+ using (var document = _document.CreatePrintDocument(DefaultPrintMode))
+ {
+ form.AllowSomePages = true;
+ form.Document = document;
+ form.UseEXDialog = true;
+ form.Document.PrinterSettings.FromPage = 1;
+ form.Document.PrinterSettings.ToPage = _document.PageCount;
+ if (DefaultPrinter != null)
+ form.Document.PrinterSettings.PrinterName = DefaultPrinter;
+
+ if (form.ShowDialog(FindForm()) == DialogResult.OK)
+ {
+ try
+ {
+ if (form.Document.PrinterSettings.FromPage <= _document.PageCount)
+ form.Document.Print();
+ }
+ catch
+ {
+ // Ignore exceptions; the printer dialog should take care of this.
+ }
+ }
+ }
+ }
+
+ private TreeNode GetBookmarkNode(PdfBookmark bookmark)
+ {
+ TreeNode node = new TreeNode(bookmark.Title);
+ node.Tag = bookmark;
+ if (bookmark.Children != null)
+ {
+ foreach (var child in bookmark.Children)
+ node.Nodes.Add(GetBookmarkNode(child));
+ }
+ return node;
+ }
+
+ private void _bookmarks_AfterSelect(object sender, TreeViewEventArgs e)
+ {
+ _renderer.Page = ((PdfBookmark)e.Node.Tag).PageIndex;
+ }
+
+ private void _renderer_LinkClick(object sender, LinkClickEventArgs e)
+ {
+ OnLinkClick(e);
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.nl.resx b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.nl.resx
new file mode 100644
index 0000000000000000000000000000000000000000..cffc18ae6ecf30cbbcfcdfe75a15ad5072a2def1
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.nl.resx
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Opslaan
+
+
+ Afdrukken
+
+
+ Inzoomen
+
+
+ Uitzoomen
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.resx b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.resx
new file mode 100644
index 0000000000000000000000000000000000000000..e2a7b6663820c750f2663be27810254d4c79d706
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewer.resx
@@ -0,0 +1,333 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+
+ Magenta
+
+
+ 23, 22
+
+
+ Save
+
+
+ Magenta
+
+
+ 23, 22
+
+
+ Print
+
+
+ 6, 25
+
+
+ Magenta
+
+
+ 23, 22
+
+
+ Zoom In
+
+
+ Magenta
+
+
+ 23, 22
+
+
+ Zoom Out
+
+
+ 0, 0
+
+
+ 588, 25
+
+
+
+ 0
+
+
+ _toolStrip
+
+
+ System.Windows.Forms.ToolStrip, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 1
+
+
+
+ Fill
+
+
+ 0, 25
+
+
+ Fill
+
+
+ 0, 0
+
+
+ 200, 413
+
+
+ 0
+
+
+ _bookmarks
+
+
+ PdfiumViewer.NativeTreeView, PdfiumViewer, Version=2.9.0.0, Culture=neutral, PublicKeyToken=91e4789cfb0609e0
+
+
+ _container.Panel1
+
+
+ 0
+
+
+ _container.Panel1
+
+
+ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ _container
+
+
+ 0
+
+
+ Fill
+
+
+ 0, 0
+
+
+ 384, 413
+
+
+ 2
+
+
+ pdfRenderer1
+
+
+ _renderer
+
+
+ PdfiumViewer.PdfRenderer, PdfiumViewer, Version=2.9.0.0, Culture=neutral, PublicKeyToken=91e4789cfb0609e0
+
+
+ _container.Panel2
+
+
+ 0
+
+
+ _container.Panel2
+
+
+ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ _container
+
+
+ 1
+
+
+ 588, 413
+
+
+ 200
+
+
+ 2
+
+
+ _container
+
+
+ System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 0
+
+
+ True
+
+
+ 6, 13
+
+
+ 588, 438
+
+
+ _saveButton
+
+
+ System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ _printButton
+
+
+ System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ toolStripSeparator1
+
+
+ System.Windows.Forms.ToolStripSeparator, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ _zoomInButton
+
+
+ System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ _zoomOutButton
+
+
+ System.Windows.Forms.ToolStripButton, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ PdfViewer
+
+
+ System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewerZoomMode.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewerZoomMode.cs
new file mode 100644
index 0000000000000000000000000000000000000000..3b07df21c5b0be6584a28573966406029a6e173d
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfViewerZoomMode.cs
@@ -0,0 +1,11 @@
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public enum PdfViewerZoomMode
+ {
+ FitHeight,
+ FitWidth,
+ FitBest
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumResolveEventHandler.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumResolveEventHandler.cs
new file mode 100644
index 0000000000000000000000000000000000000000..3329edca272ec1fd04a17e6c5c48fe28fd839f6a
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumResolveEventHandler.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ public class PdfiumResolveEventArgs : EventArgs
+ {
+ public string PdfiumFileName { get; set; }
+ }
+
+ public delegate void PdfiumResolveEventHandler(object sender, PdfiumResolveEventArgs e);
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumResolver.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumResolver.cs
new file mode 100644
index 0000000000000000000000000000000000000000..4a526c9c43c4669105ed87e1e661b2ddfbd9cb6b
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumResolver.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ public class PdfiumResolver
+ {
+ public static event PdfiumResolveEventHandler Resolve;
+
+ private static void OnResolve(PdfiumResolveEventArgs e)
+ {
+ Resolve?.Invoke(null, e);
+ }
+
+ internal static string GetPdfiumFileName()
+ {
+ var e = new PdfiumResolveEventArgs();
+ OnResolve(e);
+ return e.PdfiumFileName;
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumViewer.csproj b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumViewer.csproj
new file mode 100644
index 0000000000000000000000000000000000000000..462672890e6d70c9956d4ae36fd8362bfeadfc28
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumViewer.csproj
@@ -0,0 +1,166 @@
+
+
+
+ Release
+ x86
+ 8.0.30703
+ 2.0
+ {438914B6-5D1C-482C-B942-5C0E057EEF6F}
+ Library
+ Properties
+ PdfiumViewer
+ PdfiumViewer
+ v4.6.1
+ 512
+
+
+
+ true
+
+
+ Key.snk
+
+
+ true
+ ..\..\bin\Debug\
+ DEBUG;TRACE
+ full
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ false
+
+
+ ..\..\bin\Release\
+ TRACE
+ bin\Release\PdfiumViewer.xml
+ true
+ pdbonly
+ AnyCPU
+ prompt
+ MinimumRecommendedRules.ruleset
+ false
+
+
+
+
+
+
+
+
+
+
+ Component
+
+
+
+
+
+
+
+
+
+ Component
+
+
+ Component
+
+
+ Form
+
+
+ PasswordForm.cs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Component
+
+
+ Component
+
+
+
+
+ UserControl
+
+
+ PdfViewer.cs
+
+
+
+
+ True
+ True
+ Resources.resx
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ PasswordForm.cs
+
+
+ PdfViewer.cs
+
+
+ PdfViewer.cs
+ Designer
+
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumViewer.nuspec b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumViewer.nuspec
new file mode 100644
index 0000000000000000000000000000000000000000..f1983780b39526f9e499abd5533d096b8ea6cffd
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/PdfiumViewer.nuspec
@@ -0,0 +1,20 @@
+
+
+
+ PdfiumViewer
+ $version$
+ PdfiumViewer
+ Pieter van Ginkel
+ Pieter van Ginkel
+ https://www.apache.org/licenses/LICENSE-2.0
+ http://github.com/pvginkel/PdfiumViewer
+ false
+ PDF viewer based on the PDFium project.
+ Pieter van Ginkel © 2012-2015
+ pdf viewer pdfium
+
+
+
+
+
+
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/AssemblyInfo.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000000000000000000000000000000000..20e41af13a3b32b31dbd59440d3e437d691b6753
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/AssemblyInfo.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+[assembly: AssemblyTitle("PdfViewer")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Pieter van Ginkel")]
+[assembly: AssemblyProduct("PdfViewer")]
+[assembly: AssemblyCopyright("Pieter van Ginkel © 2012-2017")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+[assembly: ComVisible(false)]
+[assembly: CLSCompliant(true)]
+[assembly: Guid("ca63710b-8bc7-4fc5-8c39-210bacf591e8")]
+
+[assembly: AssemblyVersion("2.13.0.0")]
+[assembly: AssemblyFileVersion("2.13.0.0")]
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/Resources.Designer.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/Resources.Designer.cs
new file mode 100644
index 0000000000000000000000000000000000000000..20b6d278a63e11d01ff9120d18b07085c7ec805b
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/Resources.Designer.cs
@@ -0,0 +1,228 @@
+//------------------------------------------------------------------------------
+//
+// このコードはツールによって生成されました。
+// ランタイム バージョン:4.0.30319.42000
+//
+// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
+// コードが再生成されるときに損失したりします。
+//
+//------------------------------------------------------------------------------
+
+namespace PdfiumViewer.Properties {
+ using System;
+
+
+ ///
+ /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
+ ///
+ // このクラスは StronglyTypedResourceBuilder クラスが ResGen
+ // または Visual Studio のようなツールを使用して自動生成されました。
+ // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
+ // ResGen を実行し直すか、または VS プロジェクトをビルドし直します。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PdfiumViewer.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
+ /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap disk_blue {
+ get {
+ object obj = ResourceManager.GetObject("disk_blue", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Page {0} に類似しているローカライズされた文字列を検索します。
+ ///
+ internal static string PageNumber {
+ get {
+ return ResourceManager.GetString("PageNumber", resourceCulture);
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap printer {
+ get {
+ object obj = ResourceManager.GetObject("printer", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// Could not save the PDF file to the specified location. に類似しているローカライズされた文字列を検索します。
+ ///
+ internal static string SaveAsFailedText {
+ get {
+ return ResourceManager.GetString("SaveAsFailedText", resourceCulture);
+ }
+ }
+
+ ///
+ /// Could not save file に類似しているローカライズされた文字列を検索します。
+ ///
+ internal static string SaveAsFailedTitle {
+ get {
+ return ResourceManager.GetString("SaveAsFailedTitle", resourceCulture);
+ }
+ }
+
+ ///
+ /// PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.* に類似しているローカライズされた文字列を検索します。
+ ///
+ internal static string SaveAsFilter {
+ get {
+ return ResourceManager.GetString("SaveAsFilter", resourceCulture);
+ }
+ }
+
+ ///
+ /// Save As に類似しているローカライズされた文字列を検索します。
+ ///
+ internal static string SaveAsTitle {
+ get {
+ return ResourceManager.GetString("SaveAsTitle", resourceCulture);
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap ShadeBorder_E {
+ get {
+ object obj = ResourceManager.GetObject("ShadeBorder_E", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap ShadeBorder_N {
+ get {
+ object obj = ResourceManager.GetObject("ShadeBorder_N", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap ShadeBorder_NE {
+ get {
+ object obj = ResourceManager.GetObject("ShadeBorder_NE", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap ShadeBorder_NW {
+ get {
+ object obj = ResourceManager.GetObject("ShadeBorder_NW", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap ShadeBorder_S {
+ get {
+ object obj = ResourceManager.GetObject("ShadeBorder_S", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap ShadeBorder_SE {
+ get {
+ object obj = ResourceManager.GetObject("ShadeBorder_SE", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap ShadeBorder_SW {
+ get {
+ object obj = ResourceManager.GetObject("ShadeBorder_SW", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap ShadeBorder_W {
+ get {
+ object obj = ResourceManager.GetObject("ShadeBorder_W", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap zoom_in {
+ get {
+ object obj = ResourceManager.GetObject("zoom_in", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
+ ///
+ /// 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
+ ///
+ internal static System.Drawing.Bitmap zoom_out {
+ get {
+ object obj = ResourceManager.GetObject("zoom_out", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/Resources.nl.resx b/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/Resources.nl.resx
new file mode 100644
index 0000000000000000000000000000000000000000..3dcba084aa293e8d073ac4b5124bd35b3ebf8360
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/Resources.nl.resx
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Pagina {0}
+
+
+ PDF bestand kon niet op de opgegeven locatie opgeslagen worden.
+
+
+ PDF bestand niet opgeslagen
+
+
+ PDF Bestanden (*.pdf)|*.pdf|All Bestanden (*.*)|*.*
+
+
+ Opslaan Als
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/Resources.resx b/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/Resources.resx
new file mode 100644
index 0000000000000000000000000000000000000000..d4d4d61f38a92eb7d90d0ef64ee622d2e9e85d74
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/Properties/Resources.resx
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ ..\Resources\ShadeBorder-S.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\ShadeBorder-W.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\zoom_in.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\ShadeBorder-NW.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\ShadeBorder-NE.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\ShadeBorder-SE.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\printer.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\disk_blue.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\ShadeBorder-E.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\ShadeBorder-N.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\ShadeBorder-SW.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ ..\Resources\zoom_out.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+
+ Could not save the PDF file to the specified location.
+
+
+ Could not save file
+
+
+ PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.*
+
+
+ Save As
+
+
+ Page {0}
+
+
\ No newline at end of file
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-E.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-E.png
new file mode 100644
index 0000000000000000000000000000000000000000..d6d945214bc2e7b1e7ee729daac71456ee3a2386
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-E.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-N.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-N.png
new file mode 100644
index 0000000000000000000000000000000000000000..585e98945ae628761dc8d6e555ab2a500a1e2d3a
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-N.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-NE.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-NE.png
new file mode 100644
index 0000000000000000000000000000000000000000..663758a4049d9135148384d7654214f1205e1bcc
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-NE.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-NW.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-NW.png
new file mode 100644
index 0000000000000000000000000000000000000000..6191705ca23e217653a2f28c9a37cec8911b323d
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-NW.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-S.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-S.png
new file mode 100644
index 0000000000000000000000000000000000000000..5940390c1ad208dd1b137be36a63b893607e281d
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-S.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-SE.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-SE.png
new file mode 100644
index 0000000000000000000000000000000000000000..98acde22b318dbad3008c7d51bfe6df99a6e7616
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-SE.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-SW.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-SW.png
new file mode 100644
index 0000000000000000000000000000000000000000..e9d95f3bbc2bc86adcdd730fae63f3303da5a1b4
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-SW.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-W.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-W.png
new file mode 100644
index 0000000000000000000000000000000000000000..5639d7ec00d598b0b64a7d2aa95dce95850dc1e6
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/ShadeBorder-W.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/disk_blue.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/disk_blue.png
new file mode 100644
index 0000000000000000000000000000000000000000..27ea51116d0b4ca08d65078029bf5c11ad9b1888
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/disk_blue.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/printer.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/printer.png
new file mode 100644
index 0000000000000000000000000000000000000000..87775215f2127fd638d2131e63a327ad66cc53fb
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/printer.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/zoom_in.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/zoom_in.png
new file mode 100644
index 0000000000000000000000000000000000000000..844051eb63a59a1693e4cb0ab1c588303f49ae3a
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/zoom_in.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/zoom_out.png b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/zoom_out.png
new file mode 100644
index 0000000000000000000000000000000000000000..790055e36817da79a7a83f34b3c970ba81f97ba1
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/Resources/zoom_out.png differ
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/ScrollAction.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/ScrollAction.cs
new file mode 100644
index 0000000000000000000000000000000000000000..5ca8bb05536e7db4c4cd792f868b40546601bc44
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/ScrollAction.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public enum ScrollAction
+ {
+ LineUp,
+ LineDown,
+ PageUp,
+ PageDown,
+ Home,
+ End
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/SetCursorEventHandler.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/SetCursorEventHandler.cs
new file mode 100644
index 0000000000000000000000000000000000000000..6a60b92e418f3fae3aeb5131507bcd07eb51dcb0
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/SetCursorEventHandler.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+#pragma warning disable 1591
+
+namespace PdfiumViewer
+{
+ public class SetCursorEventArgs : EventArgs
+ {
+ public Point Location { get; private set; }
+
+ public HitTest HitTest { get; private set; }
+
+ public Cursor Cursor { get; set; }
+
+ public SetCursorEventArgs(Point location, HitTest hitTest)
+ {
+ Location = location;
+ HitTest = hitTest;
+ }
+ }
+
+ public delegate void SetCursorEventHandler(object sender, SetCursorEventArgs e);
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/ShadeBorder.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/ShadeBorder.cs
new file mode 100644
index 0000000000000000000000000000000000000000..c9951efb61cdea454357a42342f45da953b983ce
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/ShadeBorder.cs
@@ -0,0 +1,156 @@
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Drawing.Drawing2D;
+using System.Text;
+using System.Windows.Forms;
+
+namespace PdfiumViewer
+{
+ internal class ShadeBorder : IDisposable
+ {
+ public static readonly Padding Size = new Padding(4);
+
+ private bool _disposed;
+ private TextureBrush _n = new TextureBrush(Properties.Resources.ShadeBorder_N, WrapMode.Tile);
+ private Image _ne = Properties.Resources.ShadeBorder_NE;
+ private TextureBrush _e = new TextureBrush(Properties.Resources.ShadeBorder_E, WrapMode.Tile);
+ private Image _se = Properties.Resources.ShadeBorder_SE;
+ private TextureBrush _s = new TextureBrush(Properties.Resources.ShadeBorder_S, WrapMode.Tile);
+ private Image _sw = Properties.Resources.ShadeBorder_SW;
+ private TextureBrush _w = new TextureBrush(Properties.Resources.ShadeBorder_W, WrapMode.Tile);
+ private Image _nw = Properties.Resources.ShadeBorder_NW;
+
+ public void Draw(Graphics graphics, Rectangle bounds)
+ {
+ if (_disposed)
+ throw new ObjectDisposedException(GetType().Name);
+ if (graphics == null)
+ throw new ArgumentNullException("graphics");
+
+ _n.ResetTransform();
+ _n.TranslateTransform(0, bounds.Top - Size.Top);
+
+ graphics.FillRectangle(
+ _n,
+ bounds.Left + (_nw.Width - Size.Left),
+ bounds.Top - Size.Top,
+ bounds.Width - (_nw.Width - Size.Left) - (_nw.Width - Size.Right),
+ Size.Top
+ );
+
+ _e.ResetTransform();
+ _e.TranslateTransform(bounds.Right, 0);
+
+ graphics.FillRectangle(
+ _e,
+ bounds.Right,
+ bounds.Top + (_ne.Height - Size.Top),
+ Size.Right,
+ bounds.Height - (_ne.Height - Size.Top) - (_se.Height - Size.Bottom)
+ );
+
+ _s.ResetTransform();
+ _s.TranslateTransform(0, bounds.Bottom);
+
+ graphics.FillRectangle(
+ _s,
+ bounds.Left + (_sw.Width - Size.Left),
+ bounds.Bottom,
+ bounds.Width - (_sw.Width - Size.Left) - (_sw.Width - Size.Right),
+ Size.Bottom
+ );
+
+ _w.ResetTransform();
+ _w.TranslateTransform(bounds.Left - Size.Left, 0);
+
+ graphics.FillRectangle(
+ _w,
+ bounds.Left - Size.Left,
+ bounds.Top + (_nw.Height - Size.Top),
+ Size.Left,
+ bounds.Height - (_nw.Height - Size.Top) - (_sw.Height - Size.Bottom)
+ );
+
+ graphics.DrawImageUnscaled(
+ _ne,
+ (bounds.Right + Size.Right) - _ne.Width,
+ bounds.Top - Size.Top
+ );
+
+ graphics.DrawImageUnscaled(
+ _se,
+ (bounds.Right + Size.Right) - _se.Width,
+ (bounds.Bottom + Size.Bottom) - _se.Height
+ );
+
+ graphics.DrawImageUnscaled(
+ _sw,
+ bounds.Left - Size.Left,
+ (bounds.Bottom + Size.Bottom) - _sw.Height
+ );
+
+ graphics.DrawImageUnscaled(
+ _nw,
+ bounds.Left - Size.Left,
+ bounds.Top - Size.Top
+ );
+ }
+
+ public void Dispose()
+ {
+ if (!_disposed)
+ {
+ if (_n != null)
+ {
+ _n.Dispose();
+ _n = null;
+ }
+
+ if (_ne != null)
+ {
+ _ne.Dispose();
+ _ne = null;
+ }
+
+ if (_e != null)
+ {
+ _e.Dispose();
+ _e = null;
+ }
+
+ if (_se != null)
+ {
+ _se.Dispose();
+ _se = null;
+ }
+
+ if (_s != null)
+ {
+ _s.Dispose();
+ _s = null;
+ }
+
+ if (_sw != null)
+ {
+ _sw.Dispose();
+ _sw = null;
+ }
+
+ if (_w != null)
+ {
+ _w.Dispose();
+ _w = null;
+ }
+
+ if (_nw != null)
+ {
+ _nw.Dispose();
+ _nw = null;
+ }
+
+ _disposed = true;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/StreamExtensions.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/StreamExtensions.cs
new file mode 100644
index 0000000000000000000000000000000000000000..5af877a6844c1af3c6c925890818ddfab6a2c26c
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/StreamExtensions.cs
@@ -0,0 +1,77 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ internal static class StreamExtensions
+ {
+ public static byte[] ToByteArray(Stream stream)
+ {
+ if (stream == null)
+ throw new ArgumentNullException("stream");
+
+ var memoryStream = stream as MemoryStream;
+
+ if (memoryStream != null)
+ return memoryStream.ToArray();
+
+ if (stream.CanSeek)
+ return ReadBytesFast(stream);
+ else
+ return ReadBytesSlow(stream);
+ }
+
+ private static byte[] ReadBytesFast(Stream stream)
+ {
+ byte[] data = new byte[stream.Length];
+ int offset = 0;
+
+ while (offset < data.Length)
+ {
+ int read = stream.Read(data, offset, data.Length - offset);
+
+ if (read <= 0)
+ break;
+
+ offset += read;
+ }
+
+ if (offset < data.Length)
+ throw new InvalidOperationException("Incorrect length reported");
+
+ return data;
+ }
+
+ private static byte[] ReadBytesSlow(Stream stream)
+ {
+ using (var memoryStream = new MemoryStream())
+ {
+ CopyStream(stream, memoryStream);
+
+ return memoryStream.ToArray();
+ }
+ }
+
+ public static void CopyStream(Stream from, Stream to)
+ {
+ if (@from == null)
+ throw new ArgumentNullException("from");
+ if (to == null)
+ throw new ArgumentNullException("to");
+
+ var buffer = new byte[4096];
+
+ while (true)
+ {
+ int read = from.Read(buffer, 0, buffer.Length);
+
+ if (read == 0)
+ return;
+
+ to.Write(buffer, 0, read);
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/StreamManager.cs b/root/cli/PdfiumViewer-master/PdfiumViewer/StreamManager.cs
new file mode 100644
index 0000000000000000000000000000000000000000..f24c18a5b3723d0c5d9806d9b2a1c3998ef4611d
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/StreamManager.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+
+namespace PdfiumViewer
+{
+ internal static class StreamManager
+ {
+ private static readonly object _syncRoot = new object();
+ private static int _nextId = 1;
+ private static readonly Dictionary _files = new Dictionary();
+
+ public static int Register(Stream stream)
+ {
+ if (stream == null)
+ throw new ArgumentNullException(nameof(stream));
+
+ lock (_syncRoot)
+ {
+ int id = _nextId++;
+ _files.Add(id, stream);
+ return id;
+ }
+ }
+
+ public static void Unregister(int id)
+ {
+ lock (_syncRoot)
+ {
+ _files.Remove(id);
+ }
+ }
+
+ public static Stream Get(int id)
+ {
+ lock (_syncRoot)
+ {
+ Stream stream;
+ _files.TryGetValue(id, out stream);
+ return stream;
+ }
+ }
+ }
+}
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/Support/NuGet/Install.ps1 b/root/cli/PdfiumViewer-master/PdfiumViewer/Support/NuGet/Install.ps1
new file mode 100644
index 0000000000000000000000000000000000000000..0ca90d72dba095e3f19088a6df1bdca7d9b0eb18
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/PdfiumViewer/Support/NuGet/Install.ps1
@@ -0,0 +1,3 @@
+param($installPath, $toolsPath, $package, $project)
+
+$DTE.ItemOperations.Navigate("https://github.com/pvginkel/PdfiumViewer/wiki/Installation-instructions")
diff --git a/root/cli/PdfiumViewer-master/PdfiumViewer/pan.cur b/root/cli/PdfiumViewer-master/PdfiumViewer/pan.cur
new file mode 100644
index 0000000000000000000000000000000000000000..9342512bac50b73fd1248d7af10556beb0a8f487
Binary files /dev/null and b/root/cli/PdfiumViewer-master/PdfiumViewer/pan.cur differ
diff --git a/root/cli/PdfiumViewer-master/Push NuGet.bat b/root/cli/PdfiumViewer-master/Push NuGet.bat
new file mode 100644
index 0000000000000000000000000000000000000000..fc2dc69f299270161a51280c5ff666adaf69b1db
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/Push NuGet.bat
@@ -0,0 +1,24 @@
+@echo off
+
+setlocal enableextensions enabledelayedexpansion
+
+pushd "%~dp0"
+
+cd PdfiumViewer
+
+for %%f in (*.nupkg) do (
+ if "!PACKAGE!" == "" (
+ set PACKAGE=%%f
+ ) else (
+ echo Multiple NuGet packages found. Make sure only one exists.
+ goto eof
+ )
+)
+
+..\Libraries\NuGet\NuGet.exe push %PACKAGE%
+
+:eof
+
+pause
+
+popd
diff --git a/root/cli/PdfiumViewer-master/README.markdown b/root/cli/PdfiumViewer-master/README.markdown
new file mode 100644
index 0000000000000000000000000000000000000000..a89cf11044ce49a702da73b6f64695710b09160e
--- /dev/null
+++ b/root/cli/PdfiumViewer-master/README.markdown
@@ -0,0 +1,90 @@
+# PdfiumViewer
+
+Apache 2.0 License.
+
+[Download from NuGet](http://nuget.org/packages/PdfiumViewer).
+
+## Archived
+
+I regret to announce I'm archiving this project. I haven't been able to spend any real time on this for a long time now, and must face the fact I'm not in a position to properly support this project.
+
+I understand that even though I haven't been able to spend time, other developers have stepped in helping out answering issues, and archiving this project will make it more difficult finding help using PdfiumViewer. I'm sorry for this inconvenience.
+
+Together with archiving this project, I will also be archiving the [PdfiumBuild](https://github.com/pvginkel/PdfiumBuild) project. I'll make a number of successful builds available in the PdfiumBuild repository for anyone who needs them, but the build server will be shutdown as part of archiving these projects.
+
+I've had a great time developing this project and helping you out using this project, and I'm sad I have to now close this down. I hope PdfiumViewer has been of value to you. The source code and NuGet packages won't be going anywhere, so keep using them if they're of value to you.
+
+## Introduction
+
+PdfiumViewer is a PDF viewer based on the PDFium project.
+
+PdfiumViewer provides a number of components to work with PDF files:
+
+* PdfDocument is the base class used to render PDF documents;
+
+* PdfRenderer is a WinForms control that can render a PdfDocument;
+
+* PdfiumViewer is a WinForms control that hosts a PdfRenderer control and
+ adds a toolbar to save the PDF file or print it.
+
+## Compatibility
+
+The PdfiumViewer library has been tested with Windows XP and Windows 8, and
+is fully compatible with both. However, the native PDFium libraries with V8
+support do not support Windows XP. See below for instructions on how to
+reference the native libraries.
+
+## Using the library
+
+The PdfiumViewer control requires native PDFium libraries. These are not included
+in the PdfiumViewer NuGet package. See the [Installation instructions](https://github.com/pvginkel/PdfiumViewer/wiki/Installation-instructions)
+Wiki page for more information on how to add these.
+
+## Note on the `PdfViewer` control
+
+The PdfiumViewer library primarily consists out of three components:
+
+* The `PdfViewer` control. This control provides a host for the `PdfRenderer`
+ control and has a default toolbar with limited functionality;
+* The `PdfRenderer` control. This control implements the raw PDF renderer.
+ This control displays a PDF document, provides zooming and scrolling
+ functionality and exposes methods to perform more advanced actions;
+* The `PdfDocument` class provides access to the PDF document and wraps
+ the Pdfium library.
+
+The `PdfViewer` control should only be used when you have a very simple use
+case and where the buttons available on the toolbar provide enough functionality
+for you. This toolbar will not be extended with new buttons or with functionality
+to hide buttons. The reason for this is that the `PdfViewer` control is just
+meant to get you started. If you need more advanced functionality, you should
+create your own control with your own toolbar, e.g. by starting out with
+the `PdfViewer` control. Also, because people currently are already using the
+`PdfViewer` control, adding more functionality to this toolbar would be
+a breaking change. See [issue #41](https://github.com/pvginkel/PdfiumViewer/issues/41)
+for more information.
+
+## Building PDFium
+
+Instructions to build the PDFium library can be found on the [Building PDFium](https://github.com/pvginkel/PdfiumViewer/wiki/Building-PDFium)
+wiki page. However, if you are just looking to use the PdfiumViewer component
+or looking for a compiled version of PDFium, these steps are not required.
+NuGet packages with precompiled PDFium libraries are made available for
+usage with PdfiumViewer. See the chapter on **Using the library** for more
+information.
+
+Alternatively, the [PdfiumBuild](https://github.com/pvginkel/PdfiumBuild) project
+is provided to automate building PDFium. This project contains scripts to
+build PdfiumViewer specific versions of the PDFium library. This project
+is configured on a build server to compile PDFium daily. Please refer to
+the [PdfiumBuild](https://github.com/pvginkel/PdfiumBuild) project page
+for the location of the output of the build server. The PdfiumViewer specific
+libraries are located in the `PdfiumViewer-...` target directories.
+
+## Bugs
+
+Bugs should be reported through github at
+[http://github.com/pvginkel/PdfiumViewer/issues](http://github.com/pvginkel/PdfiumViewer/issues).
+
+## License
+
+PdfiumViewer is licensed under the Apache 2.0 license. See the license details for how PDFium is licensed.
diff --git a/root/cli/bin/Release/CSRender.exe b/root/cli/bin/Release/CSRender.exe
index b3bec8155201037a4c61ec208b6530b48477fc61..608bb1d783a35faad2c7e02f321885fad3383c4c 100644
Binary files a/root/cli/bin/Release/CSRender.exe and b/root/cli/bin/Release/CSRender.exe differ
diff --git a/root/cli/bin/Release/CSRender.exe.config b/root/cli/bin/Release/CSRender.exe.config
index 45437954e08a2d113d4b04d9d9f51e30f4676ab9..5ee0d86ba06651f5c62a3cbb75951202bc64a1bb 100644
--- a/root/cli/bin/Release/CSRender.exe.config
+++ b/root/cli/bin/Release/CSRender.exe.config
@@ -1,6 +1,326 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/root/cli/bin/Release/PdfiumViewer.dll b/root/cli/bin/Release/PdfiumViewer.dll
index 9fa37fd0c4f18c787d60b37d5a112b2e74981db6..e71405220bc2d0aade6534bc6bf8a80c0ff9a246 100644
Binary files a/root/cli/bin/Release/PdfiumViewer.dll and b/root/cli/bin/Release/PdfiumViewer.dll differ
diff --git a/root/cli/bin/Release/PdfiumViewer.pdb b/root/cli/bin/Release/PdfiumViewer.pdb
new file mode 100644
index 0000000000000000000000000000000000000000..e2bc5126900ff7b3673b9ace892307b58f20e60f
Binary files /dev/null and b/root/cli/bin/Release/PdfiumViewer.pdb differ
diff --git a/root/cli/bin/Release/PdfiumViewer.xml b/root/cli/bin/Release/PdfiumViewer.xml
index f73ce1246cc6952c62362b13e66609565af7b9ca..f7f5114fe201ef893b14a3c3b88cbaee7f66444a 100644
--- a/root/cli/bin/Release/PdfiumViewer.xml
+++ b/root/cli/bin/Release/PdfiumViewer.xml
@@ -1172,103 +1172,103 @@
- A strongly-typed resource class, for looking up localized strings, etc.
+ ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
- Returns the cached ResourceManager instance used by this class.
+ このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
- Overrides the current thread's CurrentUICulture property for all
- resource lookups using this strongly typed resource class.
+ すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
+ 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized string similar to Page {0}.
+ Page {0} に類似しているローカライズされた文字列を検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized string similar to Could not save the PDF file to the specified location..
+ Could not save the PDF file to the specified location. に類似しているローカライズされた文字列を検索します。
- Looks up a localized string similar to Could not save file.
+ Could not save file に類似しているローカライズされた文字列を検索します。
- Looks up a localized string similar to PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.*.
+ PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.* に類似しているローカライズされた文字列を検索します。
- Looks up a localized string similar to Save As.
+ Save As に類似しているローカライズされた文字列を検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
- Looks up a localized resource of type System.Drawing.Bitmap.
+ 型 System.Drawing.Bitmap のローカライズされたリソースを検索します。
diff --git a/root/cli/bin/Release/nl/PdfiumViewer.resources.dll b/root/cli/bin/Release/nl/PdfiumViewer.resources.dll
index 05581f745b104466e94acbd3eebf449dd067d367..b0467e6545d6c962b47a41e3338ac055a99158d6 100644
Binary files a/root/cli/bin/Release/nl/PdfiumViewer.resources.dll and b/root/cli/bin/Release/nl/PdfiumViewer.resources.dll differ
diff --git a/root/cli/bin/Release/x64/pdfium.dll b/root/cli/bin/Release/x64/pdfium.dll
index 15abb143ad3606dd406b697d1dce01763718ad8a..ac4f11c0898db6d928fd7d8c60048b04bec210b6 100644
Binary files a/root/cli/bin/Release/x64/pdfium.dll and b/root/cli/bin/Release/x64/pdfium.dll differ
diff --git a/root/cli/bin/Release/x64/pdfium.dll.lib b/root/cli/bin/Release/x64/pdfium.dll.lib
new file mode 100644
index 0000000000000000000000000000000000000000..2813713178ef30d54e918a00c20a6f2b62027481
Binary files /dev/null and b/root/cli/bin/Release/x64/pdfium.dll.lib differ
diff --git a/root/cli/bin/Release/x64/pdfium.dll.pdb b/root/cli/bin/Release/x64/pdfium.dll.pdb
new file mode 100644
index 0000000000000000000000000000000000000000..aefb6607fc38135c46ca0c71445c138781bc3b5e
Binary files /dev/null and b/root/cli/bin/Release/x64/pdfium.dll.pdb differ
diff --git a/root/cli/pdfium/Contrib/org_pdfiumviewer.cpp b/root/cli/pdfium/Contrib/org_pdfiumviewer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..c137607cf1b73eca1e988a3b0068137d4b4ecef1
--- /dev/null
+++ b/root/cli/pdfium/Contrib/org_pdfiumviewer.cpp
@@ -0,0 +1,102 @@
+// Copyright (c) 2015 Pieter van Ginkel. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "public/fpdfview.h"
+#if PDF_ENABLE_V8
+#include "v8/include/v8.h"
+#include "v8/include/libplatform/libplatform.h"
+#endif // PDF_ENABLE_V8
+
+extern "C"
+{
+ DLLEXPORT void STDCALL FPDF_AddRef();
+ DLLEXPORT void STDCALL FPDF_Release();
+}
+
+class RefCounter
+{
+private:
+ CRITICAL_SECTION cs;
+ int refCount;
+#if PDF_ENABLE_V8
+ v8::Platform* platform;
+#endif // PDF_ENABLE_V8
+
+public:
+ RefCounter()
+ {
+ ::InitializeCriticalSection(&cs);
+ refCount = 0;
+#if PDF_ENABLE_V8
+ platform = NULL;
+#endif // PDF_ENABLE_V8
+ }
+
+ ~RefCounter()
+ {
+ ::DeleteCriticalSection(&cs);
+ }
+
+ void Enter()
+ {
+ ::EnterCriticalSection(&cs);
+ }
+
+ void Leave()
+ {
+ ::LeaveCriticalSection(&cs);
+ }
+
+ void AddRef()
+ {
+ ::EnterCriticalSection(&cs);
+
+ if (refCount == 0)
+ {
+#if PDF_ENABLE_V8
+ v8::V8::InitializeICU();
+ platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(platform);
+ v8::V8::Initialize();
+#endif // PDF_ENABLE_V8
+
+ FPDF_InitLibrary();
+ }
+
+ refCount++;
+
+ ::LeaveCriticalSection(&cs);
+ }
+
+ void Release()
+ {
+ ::EnterCriticalSection(&cs);
+
+ refCount--;
+
+ if (refCount == 0)
+ {
+ FPDF_DestroyLibrary();
+#if PDF_ENABLE_V8
+ v8::V8::ShutdownPlatform();
+ delete platform;
+#endif // PDF_ENABLE_V8
+ }
+
+ ::LeaveCriticalSection(&cs);
+ }
+};
+
+static RefCounter refCounter;
+
+
+DLLEXPORT void STDCALL FPDF_AddRef()
+{
+ refCounter.AddRef();
+}
+
+DLLEXPORT void STDCALL FPDF_Release()
+{
+ refCounter.Release();
+}
diff --git a/root/cli/pdfium/Contrib/pdfiumviewer.cpp b/root/cli/pdfium/Contrib/pdfiumviewer.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f56dd640460c922cb49854f318a7fb84fd617975
--- /dev/null
+++ b/root/cli/pdfium/Contrib/pdfiumviewer.cpp
@@ -0,0 +1,126 @@
+// Copyright (c) 2015 Pieter van Ginkel. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+//#define PDF_ENABLE_V8 1
+
+#include "public/fpdfview.h"
+#if PDF_ENABLE_V8
+#include "v8/include/v8.h"
+#include "v8/include/libplatform/libplatform.h"
+#endif // PDF_ENABLE_V8
+
+//#define FPDF_EXPORT1 __declspec(dllexport)
+//#define FPDF_CALLCONV1 __stdcall
+
+extern "C"
+{
+ FPDF_EXPORT void FPDF_CALLCONV FPDF_AddRef();
+ FPDF_EXPORT void FPDF_CALLCONV FPDF_Release();
+}
+
+class RefCounter
+{
+private:
+ CRITICAL_SECTION cs;
+ int refCount;
+#if PDF_ENABLE_V8
+ v8::Platform* platform;
+#endif // PDF_ENABLE_V8
+ static RefCounter* _instance;
+
+public:
+ RefCounter()
+ {
+ ::InitializeCriticalSection(&cs);
+ refCount = 0;
+#if PDF_ENABLE_V8
+ platform = NULL;
+#endif // PDF_ENABLE_V8
+ }
+
+ ~RefCounter()
+ {
+ ::DeleteCriticalSection(&cs);
+ }
+
+ // SingletonIuWFNg̎擾
+ static RefCounter* sGetInstance( void )
+ {
+ if(!_instance) {
+ _instance = new RefCounter;
+ }
+ return _instance ;
+ }
+
+ void Enter()
+ {
+ ::EnterCriticalSection(&cs);
+ }
+
+ void Leave()
+ {
+ ::LeaveCriticalSection(&cs);
+ }
+
+ void AddRef()
+ {
+ ::EnterCriticalSection(&cs);
+
+ if (refCount == 0)
+ {
+#if PDF_ENABLE_V8
+#if V8_INTL_SUPPORT
+#error V8_INTL_SUPPORT cannot be enabled
+#endif
+ //platform = v8::platform::CreateDefaultPlatform();
+ v8::V8::InitializePlatform(platform);
+ v8::V8::Initialize();
+#endif // PDF_ENABLE_V8
+
+ FPDF_InitLibrary();
+ }
+
+ refCount++;
+
+ ::LeaveCriticalSection(&cs);
+ }
+
+ void Release()
+ {
+ ::EnterCriticalSection(&cs);
+
+ refCount--;
+
+ if (refCount == 0)
+ {
+ FPDF_DestroyLibrary();
+#if PDF_ENABLE_V8
+ //v8::V8::ShutdownPlatform();
+ delete platform;
+#endif // PDF_ENABLE_V8
+ }
+
+ ::LeaveCriticalSection(&cs);
+ }
+};
+
+
+//static RefCounter refCounter;
+// Singleton̎
+RefCounter* RefCounter::_instance = 0;
+
+
+FPDF_EXPORT void FPDF_CALLCONV FPDF_AddRef()
+{
+ RefCounter *ref = RefCounter::sGetInstance() ;
+ ref->AddRef();
+ //refCounter.AddRef();
+}
+
+FPDF_EXPORT void FPDF_CALLCONV FPDF_Release()
+{
+ RefCounter *ref = RefCounter::sGetInstance() ;
+ ref->Release();
+ //refCounter.Release();
+}
diff --git a/root/cli/pdfium/LICENSE b/root/cli/pdfium/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..161ca160d6fa51df6e3e594aeb2b1097b55e3866
--- /dev/null
+++ b/root/cli/pdfium/LICENSE
@@ -0,0 +1,230 @@
+// Copyright 2014 The PDFium Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+ Apache License
+ Version 2.0, January 2004
+ https://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ https://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git "a/root/cli/pdfium/PdfiumViewer\347\224\250Pdfium\343\203\223\343\203\253\343\203\211\346\211\213\351\240\206.xlsx" "b/root/cli/pdfium/PdfiumViewer\347\224\250Pdfium\343\203\223\343\203\253\343\203\211\346\211\213\351\240\206.xlsx"
new file mode 100644
index 0000000000000000000000000000000000000000..82ee70f05df21579b8855e0aad7c95abd00c7e1d
Binary files /dev/null and "b/root/cli/pdfium/PdfiumViewer\347\224\250Pdfium\343\203\223\343\203\253\343\203\211\346\211\213\351\240\206.xlsx" differ