Commit cfb9e26d authored by Hishiike's avatar Hishiike

[QCD / PFSVerify](https://vfsnewgui.vfsplaza.com/qcd/pfsverify)の手動マージ

※(SHA-1: 94b5d650abfd79ce0812843ca7a6c3bf3770140c)

カスタムpdfium.dll、Pdfiumviwer.dllの対応
上記dllのCSRender対応(VS2019)
parent 5437529d
......@@ -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);
......
......@@ -58,6 +58,10 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="PdfiumViewer, Version=2.13.0.0, Culture=neutral, PublicKeyToken=91e4789cfb0609e0, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\PdfiumViewer-master\PdfiumViewer\bin\Release\PdfiumViewer.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="System" />
<Reference Include="System.Core" />
......@@ -107,12 +111,6 @@
<PackageReference Include="Microsoft.Windows.SDK.Contracts">
<Version>10.0.19041.1</Version>
</PackageReference>
<PackageReference Include="PdfiumViewer">
<Version>2.13.0</Version>
</PackageReference>
<PackageReference Include="PdfiumViewer.Native.x86_64.v8-xfa">
<Version>2018.4.8.256</Version>
</PackageReference>
<PackageReference Include="System.Runtime.WindowsRuntime.UI.Xaml">
<Version>5.0.0-preview.5.20278.1</Version>
</PackageReference>
......

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
// 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();
}
This diff is collapsed.
See the PDFium License directory for the licenses associated with PDFium.
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
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.
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.
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.
----------------------------------------------------------------
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.
@echo off
pushd "%~dp0"
cd PdfiumViewer
..\Libraries\NuGet\NuGet.exe pack -Prop "configuration=release;platform=anycpu"
pause
popd
namespace PdfiumViewer.Demo
{
partial class ExportBitmapsForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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
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);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
namespace PdfiumViewer.Demo
{
partial class PageRangeForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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
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;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
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<SizeF> _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<SizeF> PageSizes
{
get
{
if (_sizes == null)
_sizes = TranslateSizes(_document.PageSizes);
return _sizes;
}
}
private IList<SizeF> TranslateSizes(IList<SizeF> pageSizes)
{
var result = new List<SizeF>();
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<PdfMatch>();
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<PdfPageLink>();
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<PdfRectangle> GetTextBounds(PdfTextSpan textSpan)
{
var result = new List<PdfRectangle>();
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();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\PdfiumViewer.Native.x86.v8-xfa.2017.11.2.204\build\PdfiumViewer.Native.x86.v8-xfa.props" Condition="Exists('..\packages\PdfiumViewer.Native.x86.v8-xfa.2017.11.2.204\build\PdfiumViewer.Native.x86.v8-xfa.props')" />
<Import Project="..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2017.11.2.204\build\PdfiumViewer.Native.x86_64.v8-xfa.props" Condition="Exists('..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2017.11.2.204\build\PdfiumViewer.Native.x86_64.v8-xfa.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{ADD131F6-17EB-4E42-932F-74CBE6DBEEB3}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PdfiumViewer.Demo</RootNamespace>
<AssemblyName>PdfiumViewer.Demo</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ExportBitmapsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ExportBitmapsForm.Designer.cs">
<DependentUpon>ExportBitmapsForm.cs</DependentUpon>
</Compile>
<Compile Include="MainForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="MainForm.Designer.cs">
<DependentUpon>MainForm.cs</DependentUpon>
</Compile>
<Compile Include="PageRangeForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PageRangeForm.Designer.cs">
<DependentUpon>PageRangeForm.cs</DependentUpon>
</Compile>
<Compile Include="PdfRangeDocument.cs" />
<Compile Include="PrintMultiplePagesForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="PrintMultiplePagesForm.Designer.cs">
<DependentUpon>PrintMultiplePagesForm.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SearchForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SearchForm.Designer.cs">
<DependentUpon>SearchForm.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="ExportBitmapsForm.resx">
<DependentUpon>ExportBitmapsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PageRangeForm.resx">
<DependentUpon>PageRangeForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="PrintMultiplePagesForm.resx">
<DependentUpon>PrintMultiplePagesForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="SearchForm.resx">
<DependentUpon>SearchForm.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PdfiumViewer\PdfiumViewer.csproj">
<Project>{438914b6-5d1c-482c-b942-5c0e057eef6f}</Project>
<Name>PdfiumViewer</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2017.11.2.204\build\PdfiumViewer.Native.x86_64.v8-xfa.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PdfiumViewer.Native.x86_64.v8-xfa.2017.11.2.204\build\PdfiumViewer.Native.x86_64.v8-xfa.props'))" />
<Error Condition="!Exists('..\packages\PdfiumViewer.Native.x86.v8-xfa.2017.11.2.204\build\PdfiumViewer.Native.x86.v8-xfa.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\PdfiumViewer.Native.x86.v8-xfa.2017.11.2.204\build\PdfiumViewer.Native.x86.v8-xfa.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
namespace PdfiumViewer.Demo
{
partial class PrintMultiplePagesForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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
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;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace PdfiumViewer.Demo
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
}
}
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")]
//------------------------------------------------------------------------------
// <auto-generated>
// このコードはツールによって生成されました。
// ランタイム バージョン:4.0.30319.42000
//
// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
// コードが再生成されるときに損失したりします。
// </auto-generated>
//------------------------------------------------------------------------------
namespace PdfiumViewer.Demo.Properties {
using System;
/// <summary>
/// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
/// </summary>
// このクラスは 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() {
}
/// <summary>
/// このクラスで使用されているキャッシュされた ResourceManager インスタンスを返します。
/// </summary>
[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;
}
}
/// <summary>
/// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
/// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// このコードはツールによって生成されました。
// ランタイム バージョン:4.0.30319.42000
//
// このファイルへの変更は、以下の状況下で不正な動作の原因になったり、
// コードが再生成されるときに損失したりします。
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
namespace PdfiumViewer.Demo
{
partial class SearchForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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
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.");
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup></configuration>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="PdfiumViewer.Native.x86.v8-xfa" version="2017.11.2.204" targetFramework="net20" />
<package id="PdfiumViewer.Native.x86_64.v8-xfa" version="2017.11.2.204" targetFramework="net20" />
</packages>
\ No newline at end of file
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<Thread>();
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;
}
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{61083268-3F14-47B7-8753-AF69BB3D0891}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PdfiumViewer.Test</RootNamespace>
<AssemblyName>PdfiumViewer.Test</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="MultiAppDomainFixture.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PdfiumViewer\PdfiumViewer.csproj">
<Project>{438914b6-5d1c-482c-b942-5c0e057eef6f}</Project>
<Name>PdfiumViewer</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Example1.pdf" />
<EmbeddedResource Include="Example2.pdf" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
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")]
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net40" />
</packages>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
\ No newline at end of file
<Application x:Class="PdfiumViewer.WPFDemo.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PdfiumViewer.WPFDemo"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
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
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
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);
}
/// <summary>
/// Convert an IImage to a WPF BitmapSource. The result can be used in the Set Property of Image.Source
/// </summary>
/// <param name="bitmap">The Source Bitmap</param>
/// <returns>The equivalent BitmapSource</returns>
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;
}
}
}
<Window x:Class="PdfiumViewer.WPFDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PdfiumViewer.WPFDemo"
mc:Ignorable="d" Loaded="Window_Loaded" Closed="Window_Closed"
Title="MainWindow" Height="600" Width="800">
<Grid >
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition Height="30"/>
<RowDefinition />
<RowDefinition Height="30" />
<RowDefinition Height="30" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label x:Name="labelMemDC" Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" />
<Button Click="LoadPDFButton_Click" Content="Load PDF" Grid.ColumnSpan="2"/>
<Button Click="RenderToMemDCButton_Click" Content="Start Rendering by MemDC" Grid.Row="1" Grid.ColumnSpan="2" />
<Label Content="RenderPage with Memory Device Context" Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" Background="LightGoldenrodYellow"/>
<Image x:Name="imageMemDC" Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2"/>
<StackPanel Grid.Row="5" Orientation="Horizontal">
<TextBox x:Name="searchValueTextBox" Text="Enter value to search" VerticalAlignment="Center" Width="150"/>
<CheckBox x:Name="matchCaseCheckBox" Content="Match CaSe" VerticalAlignment="Center" Margin="5,0"/>
<CheckBox x:Name="wholeWordOnlyCheckBox" Content="Whole Word Only" VerticalAlignment="Center" Margin="5,0"/>
</StackPanel>
<Button Content="Search" Grid.Row="6" Click="DoSearch_Click"/>
<TextBox x:Name="searchResultLabel" Grid.Row="5" Grid.RowSpan="2" Grid.Column="1" />
</Grid>
</Window>
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
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
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<BitmapSource>(
new Func<BitmapSource>(
() =>
{
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();
}
}
}
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);
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CBD6C52A-F0F4-48B8-957B-8CAD54ACD837}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PdfiumViewer.WPFDemo</RootNamespace>
<AssemblyName>PdfiumViewer.WPFDemo</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="BitmapHelper.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="NativeMethods.cs" />
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PdfiumViewer\PdfiumViewer.csproj">
<Project>{438914b6-5d1c-482c-b942-5c0e057eef6f}</Project>
<Name>PdfiumViewer</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
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
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> 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")]
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
namespace PdfiumViewer.WPFDemo.Properties
{
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// 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()
{
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[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;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
return resourceCulture;
}
set
{
resourceCulture = value;
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
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;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
\ No newline at end of file
This diff is collapsed.
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
}
}
This diff is collapsed.
This diff is collapsed.
using System;
using System.Collections.Generic;
using System.Text;
#pragma warning disable 1591
namespace PdfiumViewer
{
public enum MouseWheelMode
{
PanAndZoom,
Pan,
Zoom
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment