├── docs ├── styles │ ├── main.css │ ├── main.js │ └── search-worker.js ├── CNAME ├── favicon.ico ├── images │ ├── SumatraPDF.ico │ └── SumatraPDFControl.png ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── articles │ ├── toc.html │ └── intro.html ├── toc.html ├── logo.svg ├── search-stopwords.json ├── sitemap.xml ├── api │ ├── toc.html │ ├── index.html │ ├── SumatraPDF.SumatraPDFControl.ZoomVirtualEnum.html │ ├── SumatraPDF.SumatraPDFControl.RotationEnum.html │ ├── SumatraPDF.SumatraPDFControl.DisplayModeEnum.html │ ├── SumatraPDF.html │ ├── SumatraPDF.SumatraPDFControl.LinkClickedEventArgs.html │ ├── SumatraPDF.SumatraPDFControl.ScrollStateEventArgs.html │ ├── SumatraPDF.SumatraPDFControl.DisplayModeChangedEventArgs.html │ ├── SumatraPDF.SumatraPDFControl.SumatraMessageEventArgs.html │ ├── SumatraPDF.SumatraPDFControl.PageChangedEventArgs.html │ └── SumatraPDF.SumatraPDFControl.ContextMenuOpeningEventArgs.html ├── index.html └── manifest.json ├── Documentation ├── index.md ├── articles │ ├── toc.yml │ └── intro.md ├── filterConfig.yml ├── api │ ├── .gitignore │ └── index.md ├── toc.yml └── docfx.json ├── SumatraPDFControl ├── SumatraPDF.ico ├── Resources │ ├── SumatraPDFControl.png │ └── SumatraPDFControlMini.png ├── TODO.txt ├── SumatraPDFControl.Designer.cs ├── SumatraPDFControl.csproj └── Properties │ ├── Resources.Designer.cs │ └── Resources.resx ├── SumatraPDFControlTest ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── Program.cs ├── SumatraPDFControlTest.csproj ├── MDIParent1.cs └── Form1.cs ├── .github └── workflows │ └── msbuild.yml ├── nuget ├── nuget.pack&push-SumatraPDFControl.ps1 └── nuget.pack&push-SumatraPDFControl_old.ps1 ├── README.md ├── .gitattributes ├── SumatraPDFControl.sln ├── .editorconfig └── .gitignore /docs/styles/main.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | sumatrapdfcontrol.mcmonteiro.com -------------------------------------------------------------------------------- /Documentation/index.md: -------------------------------------------------------------------------------- 1 | [!include[INDEX](../README.md)] 2 | -------------------------------------------------------------------------------- /Documentation/articles/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Introduction 2 | href: intro.md 3 | -------------------------------------------------------------------------------- /Documentation/filterConfig.yml: -------------------------------------------------------------------------------- 1 | apiRules: 2 | - exclude: 3 | uidRegex: ^System 4 | type: Type -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/docs/favicon.ico -------------------------------------------------------------------------------- /Documentation/api/.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # temp file # 3 | ############### 4 | *.yml 5 | .manifest 6 | -------------------------------------------------------------------------------- /Documentation/articles/intro.md: -------------------------------------------------------------------------------- 1 | ## Comming soon: 2 | ### Articles to show how to getting start with SumatraPDFControl 3 | -------------------------------------------------------------------------------- /docs/images/SumatraPDF.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/docs/images/SumatraPDF.ico -------------------------------------------------------------------------------- /Documentation/api/index.md: -------------------------------------------------------------------------------- 1 | # Namespace SumatraPDF 2 | ## Classes 3 | ### [SumatraPDFControl](SumatraPDF.SumatraPDFControl.html) 4 | -------------------------------------------------------------------------------- /SumatraPDFControl/SumatraPDF.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/SumatraPDFControl/SumatraPDF.ico -------------------------------------------------------------------------------- /docs/images/SumatraPDFControl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/docs/images/SumatraPDFControl.png -------------------------------------------------------------------------------- /Documentation/toc.yml: -------------------------------------------------------------------------------- 1 | - name: Articles 2 | href: articles/ 3 | - name: Api Documentation 4 | href: api/ 5 | homepage: api/SumatraPDF.html 6 | -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/docs/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/docs/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/docs/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /docs/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/docs/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /SumatraPDFControl/Resources/SumatraPDFControl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/SumatraPDFControl/Resources/SumatraPDFControl.png -------------------------------------------------------------------------------- /docs/styles/main.js: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information. 2 | -------------------------------------------------------------------------------- /SumatraPDFControl/Resources/SumatraPDFControlMini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/HEAD/SumatraPDFControl/Resources/SumatraPDFControlMini.png -------------------------------------------------------------------------------- /SumatraPDFControlTest/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /SumatraPDFControlTest/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Windows.Forms; 4 | 5 | namespace SumatraPDFControlTest 6 | { 7 | static class Program 8 | { 9 | /// 10 | /// Ponto de entrada principal para o aplicativo. 11 | /// 12 | [STAThread] 13 | static void Main() 14 | { 15 | Application.EnableVisualStyles(); 16 | Application.SetCompatibleTextRenderingDefault(false); 17 | Application.Run(new MDIParent1()); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /docs/articles/toc.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 | 7 | 8 | 9 |
10 |
11 |
12 |
13 | 14 | 19 |
20 |
21 |
22 |
-------------------------------------------------------------------------------- /docs/toc.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 | 7 | 8 | 9 |
10 |
11 |
12 |
13 | 14 | 22 |
23 |
24 |
25 |
-------------------------------------------------------------------------------- /SumatraPDFControlTest/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SumatraPDFControlTest.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /SumatraPDFControl/TODO.txt: -------------------------------------------------------------------------------- 1 | TODO (Future versions): 2 | 3 | Throw exception on error loading document 4 | Review control inherited properties / events to hide those are not used and implement others 5 | Analyze and implement possible to send other messages from SumatraPDF Canvas WndProc to SumatraPDFControl 6 | 7 | Methods 8 | - Show Document properties 9 | - Hide/Show ScrollBars 10 | 11 | Documentation 12 | - Put TODO.TXT as MarkDown Article in Documentation 13 | - Create Version History Article in Documentation 14 | 15 | Print: 16 | - Events: onPrint, onPrintEnd 17 | - Methods: AbortPrint, MayCloseWindow 18 | - Direct Print method 19 | 20 | Toc: 21 | - ContextMenu SumatraPDFControl for toc - Create a property for tocContextMenu 22 | 23 | Others: 24 | - Create function to get Canvas, Toc and toolbar positions in Frame position to use by mouse click events 25 | - Page rotation event is more complicated to implement because current Window information (WindowInfo*) does not exists in DisplayModel sumatrapdf object. 26 | So its impossible to send PluginHostCallBack message without replicate this call in all points of source code calling method DisplayModel::RotateBy. 27 | - Implement FileOpened and StartupFinished events 28 | -------------------------------------------------------------------------------- /docs/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by Docfx 9 | 10 | 12 | 15 | 21 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /docs/search-stopwords.json: -------------------------------------------------------------------------------- 1 | [ 2 | "a", 3 | "able", 4 | "about", 5 | "across", 6 | "after", 7 | "all", 8 | "almost", 9 | "also", 10 | "am", 11 | "among", 12 | "an", 13 | "and", 14 | "any", 15 | "are", 16 | "as", 17 | "at", 18 | "be", 19 | "because", 20 | "been", 21 | "but", 22 | "by", 23 | "can", 24 | "cannot", 25 | "could", 26 | "dear", 27 | "did", 28 | "do", 29 | "does", 30 | "either", 31 | "else", 32 | "ever", 33 | "every", 34 | "for", 35 | "from", 36 | "get", 37 | "got", 38 | "had", 39 | "has", 40 | "have", 41 | "he", 42 | "her", 43 | "hers", 44 | "him", 45 | "his", 46 | "how", 47 | "however", 48 | "i", 49 | "if", 50 | "in", 51 | "into", 52 | "is", 53 | "it", 54 | "its", 55 | "just", 56 | "least", 57 | "let", 58 | "like", 59 | "likely", 60 | "may", 61 | "me", 62 | "might", 63 | "most", 64 | "must", 65 | "my", 66 | "neither", 67 | "no", 68 | "nor", 69 | "not", 70 | "of", 71 | "off", 72 | "often", 73 | "on", 74 | "only", 75 | "or", 76 | "other", 77 | "our", 78 | "own", 79 | "rather", 80 | "said", 81 | "say", 82 | "says", 83 | "she", 84 | "should", 85 | "since", 86 | "so", 87 | "some", 88 | "than", 89 | "that", 90 | "the", 91 | "their", 92 | "them", 93 | "then", 94 | "there", 95 | "these", 96 | "they", 97 | "this", 98 | "tis", 99 | "to", 100 | "too", 101 | "twas", 102 | "us", 103 | "wants", 104 | "was", 105 | "we", 106 | "were", 107 | "what", 108 | "when", 109 | "where", 110 | "which", 111 | "while", 112 | "who", 113 | "whom", 114 | "why", 115 | "will", 116 | "with", 117 | "would", 118 | "yet", 119 | "you", 120 | "your" 121 | ] 122 | -------------------------------------------------------------------------------- /Documentation/docfx.json: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": [ 3 | { 4 | "src": [ 5 | { 6 | "files": [ 7 | "**.csproj" 8 | ], 9 | "src": "../SumatraPDFControl" 10 | } 11 | ], 12 | "filter": "filterConfig.yml", 13 | "dest": "api", 14 | "disableGitFeatures": false, 15 | "disableDefaultFilter": false, 16 | "properties": { "TargetFramework": "net45" } 17 | } 18 | ], 19 | "build": { 20 | "content": [ 21 | { 22 | "files": [ 23 | "api/**.yml", 24 | "api/index.md" 25 | ] 26 | }, 27 | { 28 | "files": [ 29 | "articles/**.md", 30 | "articles/**/toc.yml", 31 | "toc.yml", 32 | "*.md" 33 | ] 34 | } 35 | ], 36 | "resource": [ 37 | { 38 | "files": [ 39 | "SumatraPDF.ico" 40 | ], "dest": "images", "src": "../SumatraPDFControl" 41 | }, 42 | { "files": [ 43 | "SumatraPDFControl.png", 44 | ], "dest": "images", "src": "../SumatraPDFControl/Resources" 45 | } 46 | ], 47 | "overwrite": [ 48 | { 49 | "files": [ 50 | "apidoc/**.md" 51 | ], 52 | "exclude": [ 53 | "obj/**", 54 | "_site/**", 55 | "docs/**" 56 | ] 57 | } 58 | ], 59 | "dest": "../docs", 60 | "globalMetadataFiles": [], 61 | "fileMetadataFiles": [], 62 | "template": [ 63 | "default" 64 | ], 65 | "postProcessors": [], 66 | "markdownEngineName": "markdig", 67 | "noLangKeyword": false, 68 | "keepFileLink": false, 69 | "cleanupCacheHistory": false, 70 | "disableGitFeatures": false, 71 | 72 | "globalMetadata": { 73 | "_appFaviconPath": "images/SumatraPDF.ico", 74 | "_appLogoPath": "images/SumatraPDFControl.png" 75 | } 76 | 77 | } 78 | } -------------------------------------------------------------------------------- /SumatraPDFControl/SumatraPDFControl.Designer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SumatraPDF 4 | { 5 | partial class SumatraPDFControl 6 | { 7 | /// 8 | /// Variável de designer necessária. 9 | /// 10 | private System.ComponentModel.IContainer components = null; 11 | 12 | /// 13 | /// Cleaning resources being used 14 | /// 15 | /// true if necessary to dispose managed resources. 16 | protected override void Dispose(bool disposing) 17 | { 18 | if (pSumatraWindowHandle != (IntPtr)0) 19 | { 20 | CloseDocument(); 21 | pSumatraWindowHandleList.Remove(pSumatraWindowHandle); 22 | } 23 | if (disposing && (components != null)) 24 | { 25 | components.Dispose(); 26 | } 27 | base.Dispose(disposing); 28 | } 29 | 30 | #region Código gerado pelo Designer de Componentes 31 | 32 | /// 33 | /// Método necessário para suporte ao Designer - não modifique 34 | /// o conteúdo deste método com o editor de código. 35 | /// 36 | private void InitializeComponent() 37 | { 38 | this.SuspendLayout(); 39 | // 40 | // SumatraPDFControl 41 | // 42 | this.BackColor = System.Drawing.SystemColors.ActiveBorder; 43 | this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; 44 | this.Cursor = System.Windows.Forms.Cursors.Default; 45 | this.Size = new System.Drawing.Size(460, 334); 46 | this.Resize += new System.EventHandler(this.SumatraPDFControl_Resize); 47 | this.ResumeLayout(false); 48 | 49 | } 50 | 51 | #endregion 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /SumatraPDFControlTest/SumatraPDFControlTest.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net20;net48;netcoreapp3.1;net5.0-windows 5 | true 6 | disable 7 | 1.0.0 8 | SumatraPDFControlTest 9 | SumatraPDFControlTest 10 | mcmonteiro 11 | ..\SumatraPDFControl\SumatraPDF.ico 12 | WinExe 13 | 14 | 15 | 16 | 17 | AnyCPU 18 | 19 | 20 | 21 | AnyCPU 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | True 44 | True 45 | Settings.settings 46 | 47 | 48 | 49 | 50 | 51 | 52 | SettingsSingleFileGenerator 53 | Settings.Designer.cs 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /.github/workflows/msbuild.yml: -------------------------------------------------------------------------------- 1 | name: MSBuild 2 | 3 | on: 4 | #push: 5 | # branches: 6 | # - master 7 | workflow_dispatch: 8 | 9 | env: 10 | # Path to the solution file relative to the root of the project. 11 | SOLUTION_FILE_PATH: .\SumatraPDFControl\SumatraPDFControl.csproj 12 | NUPKG_PATH: .\SumatraPDFControl\bin\Release 13 | NUGET_SOURCE: https://api.nuget.org/v3/index.json 14 | NUGET_API_KEY: ${{secrets.NUGET_API_KEY}} 15 | GITHUB_NUGET_SOURCE: https://nuget.pkg.github.com/marcoscmonteiro/index.json 16 | GITHUB_NUGET_API_KEY: ${{secrets.PKG_GITHUB}} 17 | 18 | # Configuration type to build. 19 | # You can convert this to a build matrix if you need coverage of multiple configuration types. 20 | # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix 21 | BUILD_CONFIGURATION: Release 22 | 23 | jobs: 24 | build: 25 | runs-on: windows-latest 26 | 27 | steps: 28 | - uses: actions/checkout@v2 29 | 30 | - name: Add MSBuild to PATH 31 | uses: microsoft/setup-msbuild@v1.0.2 32 | 33 | - name: Restore NuGet packages 34 | working-directory: ${{env.GITHUB_WORKSPACE}} 35 | run: nuget restore ${{env.SOLUTION_FILE_PATH}} 36 | 37 | - name: Build 38 | working-directory: ${{env.GITHUB_WORKSPACE}} 39 | # Add additional options to the MSBuild command line here (like platform or verbosity level). 40 | # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference 41 | run: msbuild ${{env.SOLUTION_FILE_PATH}} -t:pack -p:Configuration=${{env.BUILD_CONFIGURATION}} 42 | 43 | - name: Nuget Push 44 | shell: cmd 45 | working-directory: ${{env.GITHUB_WORKSPACE}} 46 | run: dotnet nuget push ${{env.NUPKG_PATH}}\*.nupkg --source ${{env.NUGET_SOURCE}} --api-key "%NUGET_API_KEY%" --skip-duplicate 47 | 48 | - name: GitHub Packages Push 49 | shell: cmd 50 | working-directory: ${{env.GITHUB_WORKSPACE}} 51 | run: dotnet nuget push ${{env.NUPKG_PATH}}\*.nupkg --source ${{env.GITHUB_NUGET_SOURCE}} --api-key "%GITHUB_NUGET_API_KEY%" --skip-duplicate 52 | -------------------------------------------------------------------------------- /nuget/nuget.pack&push-SumatraPDFControl.ps1: -------------------------------------------------------------------------------- 1 | # Script to compile and pack SumatraPDFControl (along with SumatraPDF.exe) into a nupkg to publish in nuget.org 2 | # Requires Visual Studio 2019 installed (can be cummunity version) and nuget.exe in same script dir or in a dir present in PATH enviroment variable 3 | 4 | # In order to function it's necessary to set current dir to same location of script 5 | Set-Location (Split-Path $MyInvocation.MyCommand.Path) 6 | Clear-Host 7 | 8 | Write-Output "SumatraPDFControl Nuget Pack and Push script running..." 9 | 10 | # Save current dir 11 | $CurrentDir = Get-Location 12 | 13 | # Start Developer Shell Powershell in order to compile SumatraPDF 14 | $vsPath = &(Join-Path ${env:ProgramFiles(x86)} "\Microsoft Visual Studio\Installer\vswhere.exe") -property installationpath 15 | . "$vsPath\Common7\Tools\Launch-VsDevShell.ps1" 16 | 17 | # Restore current dir 18 | Set-Location $CurrentDir 19 | 20 | # Get ApiKey from secret file (not versioned on GIT) 21 | $NugetOrgApiKey = Get-Content ~/Onedrive/Documentos/nuget/NUGET.ORG.APIKEY.TXT 22 | $GitHubPAT = Get-Content ~/Onedrive/Documentos/nuget/GITHUB.PAT.TXT 23 | 24 | # HashTable containing the repositories with URL and ApiKey for publishing the components 25 | $Repositories = @{ 26 | "Nuget.Org" = @( "https://api.nuget.org/v3/index.json", $NugetOrgApiKey ) 27 | "GitHub" = @( "https://nuget.pkg.github.com/marcoscmonteiro/index.json", $GitHubPAT ) 28 | } 29 | 30 | Remove-Item -Recurse -Force $CurrentDir\nupkg 31 | 32 | mkdir $CurrentDir\nupkg 33 | 34 | Remove-Item ..\SumatraPDFControl\bin\Release\*.nupkg 35 | 36 | # Build SumatraPDFControl component 37 | msbuild ..\SumatraPDFControl\SumatraPDFControl.csproj -t:pack -p:Configuration=Release 38 | 39 | Copy-Item ..\SumatraPDFControl\bin\Release\*.nupkg $CurrentDir\nupkg 40 | 41 | # Includes functions required to package and publish components 42 | # Read comments at the beginning of the file below witch contains important information 43 | . ".\nuget.pack&push.ps1" 44 | 45 | NugetPush -Repositories $Repositories -AutoPublish "" 46 | 47 | # To be able to read the information if it was run directly by Windows Explorer 48 | #pause -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SumatraPDFControl 2 | 3 | ## Windows Forms Control based on [SumatraPDFReader](https://www.sumatrapdfreader.org/) to view and read Portable Document Files (PDF) 4 | 5 | It allows you to construct Windows Forms application capable to view and read Portable Document Files (PDF) with all features present in great [SumatraPDFReader](https://www.sumatrapdfreader.org/) made by [Krzysztof Kowalczyk](https://blog.kowalczyk.info/). 6 | 7 | * Download compiled version from [NuGet.org](https://www.nuget.org/packages/SumatraPDFControl/) 8 | 9 | * Go to [SumatraPDFControl site](https://sumatrapdfcontrol.mcmonteiro.com) to view documentation 10 | and [SumatraPDFControl API](https://sumatrapdfcontrol.mcmonteiro.com/api/SumatraPDF.html) 11 | 12 | * [Source code in GitHub](https://github.com/marcoscmonteiro/sumatrapdfcontrol) licenced under [GPLv3](https://github.com/marcoscmonteiro/SumatraPDFControl/blob/master/LICENSE) 13 | 14 | * GIT Clone C# Project from [GitHub](https://github.com/marcoscmonteiro/sumatrapdfcontrol) and open SumatraPDFControl.sln with Visual Studio 2019 (works with community version). 15 | * SumatraPDFControlTest included in soluction shows SumatraPDFControl in action. 16 | * Bugs, issues or improvements? Report them in [GitHub Project Issues](https://github.com/marcoscmonteiro/SumatraPDFControl/issues) 17 | 18 | ## Supported .NET Framework / Core 19 | 20 | * Works with [.NET Framework](https://dotnet.microsoft.com/download/dotnet-framework) version 2.0 or greater 21 | 22 | * Works with [.NET Core](https://dotnet.microsoft.com/download/dotnet) version 3.1 or greater 23 | 24 | ## Dependent NuGet.org packages 25 | 26 | SumatraPDFControl uses a specific compiled [SumatraPDF forked code](https://github.com/marcoscmonteiro/sumatrapdf) 27 | which enables SumatraPDF working in an enhanced plugin mode. Compiled versions are distributed like NuGet packages: 28 | 29 | * [x86 - 32 bits](https://www.nuget.org/packages/SumatraPDF.PluginMode.x86) for Windows 32bit archicheture (works also with 64 bits Windows architecture) 30 | * [x64 - 64 bits](https://www.nuget.org/packages/SumatraPDF.PluginMode.x64) for Windows 64bit archicheture 31 | * At least 1 of these packages have to be referenced by Windows Forms project using SumatraPDFControl. 32 | -------------------------------------------------------------------------------- /docs/styles/search-worker.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | importScripts('lunr.min.js'); 3 | 4 | var lunrIndex; 5 | 6 | var stopWords = null; 7 | var searchData = {}; 8 | 9 | lunr.tokenizer.separator = /[\s\-\.\(\)]+/; 10 | 11 | var stopWordsRequest = new XMLHttpRequest(); 12 | stopWordsRequest.open('GET', '../search-stopwords.json'); 13 | stopWordsRequest.onload = function () { 14 | if (this.status != 200) { 15 | return; 16 | } 17 | stopWords = JSON.parse(this.responseText); 18 | buildIndex(); 19 | } 20 | stopWordsRequest.send(); 21 | 22 | var searchDataRequest = new XMLHttpRequest(); 23 | 24 | searchDataRequest.open('GET', '../index.json'); 25 | searchDataRequest.onload = function () { 26 | if (this.status != 200) { 27 | return; 28 | } 29 | searchData = JSON.parse(this.responseText); 30 | 31 | buildIndex(); 32 | 33 | postMessage({ e: 'index-ready' }); 34 | } 35 | searchDataRequest.send(); 36 | 37 | onmessage = function (oEvent) { 38 | var q = oEvent.data.q; 39 | var hits = lunrIndex.search(q); 40 | var results = []; 41 | hits.forEach(function (hit) { 42 | var item = searchData[hit.ref]; 43 | results.push({ 'href': item.href, 'title': item.title, 'keywords': item.keywords }); 44 | }); 45 | postMessage({ e: 'query-ready', q: q, d: results }); 46 | } 47 | 48 | function buildIndex() { 49 | if (stopWords !== null && !isEmpty(searchData)) { 50 | lunrIndex = lunr(function () { 51 | this.pipeline.remove(lunr.stopWordFilter); 52 | this.ref('href'); 53 | this.field('title', { boost: 50 }); 54 | this.field('keywords', { boost: 20 }); 55 | 56 | for (var prop in searchData) { 57 | if (searchData.hasOwnProperty(prop)) { 58 | this.add(searchData[prop]); 59 | } 60 | } 61 | 62 | var docfxStopWordFilter = lunr.generateStopWordFilter(stopWords); 63 | lunr.Pipeline.registerFunction(docfxStopWordFilter, 'docfxStopWordFilter'); 64 | this.pipeline.add(docfxStopWordFilter); 65 | this.searchPipeline.add(docfxStopWordFilter); 66 | }); 67 | } 68 | } 69 | 70 | function isEmpty(obj) { 71 | if(!obj) return true; 72 | 73 | for (var prop in obj) { 74 | if (obj.hasOwnProperty(prop)) 75 | return false; 76 | } 77 | 78 | return true; 79 | } 80 | })(); 81 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /SumatraPDFControlTest/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SumatraPDFControlTest.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SumatraPDFControlTest.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /nuget/nuget.pack&push-SumatraPDFControl_old.ps1: -------------------------------------------------------------------------------- 1 | # Script to compile and pack SumatraPDFControl (along with SumatraPDF.exe) into a nupkg to publish in nuget.org 2 | # Requires Visual Studio 2019 installed (can be cummunity version) and nuget.exe in same script dir or in a dir present in PATH enviroment variable 3 | 4 | # In order to function it's necessary to set current dir to same location of script 5 | Set-Location (Split-Path $MyInvocation.MyCommand.Path) 6 | Clear-Host 7 | 8 | Write-Output "SumatraPDFControl Nuget Pack and Push script running..." 9 | 10 | # Save current dir 11 | $CurrentDir = Get-Location 12 | 13 | # Start Developer Shell Powershell in order to compile SumatraPDF or SumatraPDFControl.net5 14 | foreach ($vsVersion in @("Enterprise", "Professional", "Community")) { 15 | $Vs2019Dir = "C:\Program Files (x86)\Microsoft Visual Studio\2019\$vsVersion\Common7\Tools\Launch-VsDevShell.ps1" 16 | Write-Output $Vs2019Dir 17 | if (Test-Path $Vs2019Dir) { 18 | . $Vs2019Dir 19 | break 20 | } 21 | } 22 | 23 | # Restore current dir 24 | Set-Location $CurrentDir 25 | 26 | $s = Read-Host -prompt "Do you want to recompile SumatraPDF.exe (x86/x64) (y/n)?" 27 | 28 | # SumatraPDF base dir (git cloned from https://github.com/marcoscmonteiro/sumatrapdf) 29 | $SumatraPDFBaseDir = "..\..\sumatrapdf" 30 | 31 | if ($s.ToLower() -eq "y") { 32 | 33 | # Compile SumatraPDF (x64 and Win32 plataform) 34 | msbuild "$SumatraPDFBaseDir\vs2019\SumatraPDF.vcxproj" /p:Configuration=Release /p:Platform=x64 35 | msbuild "$SumatraPDFBaseDir\vs2019\SumatraPDF.vcxproj" /p:Configuration=Release /p:Platform=Win32 36 | 37 | } 38 | 39 | # Copy x86/x64 executables to be packed bu nuget 40 | if (-not (Test-Path .\SumatraPDF.x86)) { mkdir .\SumatraPDF.x86 > $null } 41 | if (-not (Test-Path .\SumatraPDF.x64)) { mkdir .\SumatraPDF.x64 > $null } 42 | Copy-Item "$SumatraPDFBaseDir\out\Rel32\SumatraPDF.exe" .\SumatraPDF.x86 43 | Copy-Item "$SumatraPDFBaseDir\out\Rel64\SumatraPDF.exe" .\SumatraPDF.x64 44 | 45 | # Includes functions required to package and publish components 46 | # Read comments at the beginning of the file below witch contains important information 47 | . ".\nuget.pack&push.ps1" 48 | 49 | # Complete path to reach the solution from the location of the execution of this Script. 50 | $SolutionPath = "..\SumatraPDFControl.sln" 51 | 52 | # Get ApiKey from secret file (not versioned on GIT) 53 | $NugetOrgApiKey = Get-Content ~/Onedrive/Documentos/nuget/NUGET.ORG.APIKEY.TXT 54 | 55 | # HashTable containing the repositories with URL and ApiKey for publishing the components 56 | $Repositories = @{ 57 | "Nuget.Org" = @( "https://api.nuget.org/v3/index.json", $NugetOrgApiKey ) 58 | } 59 | 60 | # Build .net 5 SumatraPDFControl component 61 | msbuild ..\SumatraPDFCOntrol.net5 /t:ReBuild /p:Configuration=Release 62 | 63 | # Calls function with component packaging and publishing interface 64 | NugetPackAndPush -SolutionPath $SolutionPath -Repositories $Repositories -ProjectList "*" -AutoPublish "" -AutoGenPackageConfig "n" 65 | 66 | # To be able to read the information if it was run directly by Windows Explorer 67 | #pause -------------------------------------------------------------------------------- /SumatraPDFControl/SumatraPDFControl.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net20;net40;net45;net48;netcoreapp3.1;net5.0-windows 5 | true 6 | disable 7 | 1.4.5 8 | SumatraPDFControl 9 | SumatraPDF 10 | mcmonteiro 11 | SumatraPDF.ico 12 | 13 | 14 | 15 | SumatraPDFControl 16 | SumatraPDF Control for Windows Forms 17 | Marcos C. Monteiro 18 | true 19 | GPL-3.0-only 20 | https://sumatrapdfcontrol.mcmonteiro.net/ 21 | Windows Forms Control which embeds modifed version of SumatraPDF to read and view Portable Document Files (PDF) 22 | Validate SumatraPDF.exe version for use by SumatraPDFControl version 23 | Copyright Marcos C. Monteiro© 2021 24 | SumatraPDF PDF viewer windows forms windowsforms winforms GPL 25 | Master 26 | https://github.com/marcoscmonteiro/SumatraPDFControl 27 | Master 28 | https://raw.githubusercontent.com/marcoscmonteiro/SumatraPDFControl/master/SumatraPDFControl/Resources/SumatraPDFControl.png 29 | images\SumatraPDFControl.png 30 | docs\readme.md 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | AnyCPU 40 | SumatraPDFControl.xml 41 | 42 | 43 | 44 | SumatraPDFControl.xml 45 | 46 | 47 | 48 | 49 | True 50 | True 51 | Resources.resx 52 | 53 | 54 | 55 | 56 | 57 | ResXFileCodeGenerator 58 | Resources.Designer.cs 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /docs/sitemap.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | https://sumatrapdfcontrol.mcmonteiro.net/ 12 | 2021-07-26T01:10:32+00:00 13 | 1.00 14 | 15 | 16 | https://sumatrapdfcontrol.mcmonteiro.net/index.html 17 | 2021-07-26T01:10:32+00:00 18 | 0.80 19 | 20 | 21 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.html 22 | 2021-07-26T01:10:32+00:00 23 | 0.80 24 | 25 | 26 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.html 27 | 2021-07-26T01:10:32+00:00 28 | 0.64 29 | 30 | 31 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.ContextMenuOpeningEventArgs.html 32 | 2021-07-26T01:10:32+00:00 33 | 0.64 34 | 35 | 36 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.DisplayModeChangedEventArgs.html 37 | 2021-07-26T01:10:32+00:00 38 | 0.64 39 | 40 | 41 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.LinkClickedEventArgs.html 42 | 2021-07-26T01:10:32+00:00 43 | 0.64 44 | 45 | 46 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.PageChangedEventArgs.html 47 | 2021-07-26T01:10:32+00:00 48 | 0.64 49 | 50 | 51 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.ScrollStateEventArgs.html 52 | 2021-07-26T01:10:32+00:00 53 | 0.64 54 | 55 | 56 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.SumatraMessageEventArgs.html 57 | 2021-07-26T01:10:32+00:00 58 | 0.64 59 | 60 | 61 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.ZoomChangedEventArgs.html 62 | 2021-07-26T01:10:32+00:00 63 | 0.64 64 | 65 | 66 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.ScrollStateStruct.html 67 | 2021-07-26T01:10:32+00:00 68 | 0.64 69 | 70 | 71 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.DisplayModeEnum.html 72 | 2021-07-26T01:10:32+00:00 73 | 0.64 74 | 75 | 76 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.RotationEnum.html 77 | 2021-07-26T01:10:32+00:00 78 | 0.64 79 | 80 | 81 | https://sumatrapdfcontrol.mcmonteiro.net/api/SumatraPDF.SumatraPDFControl.ZoomVirtualEnum.html 82 | 2021-07-26T01:10:32+00:00 83 | 0.64 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /SumatraPDFControl.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30011.22 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SumatraPDFControl", "SumatraPDFControl\SumatraPDFControl.csproj", "{3DF6A3D4-2F4D-4708-B92B-FD849E397E91}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentation", "{BE94564B-83DD-4B54-8358-3528E854216F}" 9 | ProjectSection(SolutionItems) = preProject 10 | Documentation\docfx.json = Documentation\docfx.json 11 | Documentation\filterConfig.yml = Documentation\filterConfig.yml 12 | Documentation\index.md = Documentation\index.md 13 | Documentation\toc.yml = Documentation\toc.yml 14 | EndProjectSection 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "api", "api", "{ABDA66EF-010B-415B-8F6F-3CC9DBCF9F60}" 17 | ProjectSection(SolutionItems) = preProject 18 | Documentation\api\index.md = Documentation\api\index.md 19 | EndProjectSection 20 | EndProject 21 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Articles", "Articles", "{2766C3F2-8BEF-4E85-8FED-294C279C4279}" 22 | ProjectSection(SolutionItems) = preProject 23 | Documentation\articles\intro.md = Documentation\articles\intro.md 24 | Documentation\articles\toc.yml = Documentation\articles\toc.yml 25 | EndProjectSection 26 | EndProject 27 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9AB36FFF-0532-400B-8A0F-153118679D17}" 28 | ProjectSection(SolutionItems) = preProject 29 | LICENSE = LICENSE 30 | README.md = README.md 31 | EndProjectSection 32 | EndProject 33 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SumatraPDFControlTest", "SumatraPDFControlTest\SumatraPDFControlTest.csproj", "{77504E11-9BCF-42AA-A931-E36377B700CB}" 34 | EndProject 35 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuGet", "NuGet", "{E5B41A94-4A55-4C47-80B0-EB1A5141B727}" 36 | ProjectSection(SolutionItems) = preProject 37 | nuget\nuget.pack&push-SumatraPDFControl.ps1 = nuget\nuget.pack&push-SumatraPDFControl.ps1 38 | nuget\nuget.pack&push.ps1 = nuget\nuget.pack&push.ps1 39 | EndProjectSection 40 | EndProject 41 | Global 42 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 43 | Debug|Any CPU = Debug|Any CPU 44 | Release|Any CPU = Release|Any CPU 45 | EndGlobalSection 46 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 47 | {3DF6A3D4-2F4D-4708-B92B-FD849E397E91}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 48 | {3DF6A3D4-2F4D-4708-B92B-FD849E397E91}.Debug|Any CPU.Build.0 = Debug|Any CPU 49 | {3DF6A3D4-2F4D-4708-B92B-FD849E397E91}.Release|Any CPU.ActiveCfg = Release|Any CPU 50 | {3DF6A3D4-2F4D-4708-B92B-FD849E397E91}.Release|Any CPU.Build.0 = Release|Any CPU 51 | {77504E11-9BCF-42AA-A931-E36377B700CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 52 | {77504E11-9BCF-42AA-A931-E36377B700CB}.Debug|Any CPU.Build.0 = Debug|Any CPU 53 | {77504E11-9BCF-42AA-A931-E36377B700CB}.Release|Any CPU.ActiveCfg = Release|Any CPU 54 | {77504E11-9BCF-42AA-A931-E36377B700CB}.Release|Any CPU.Build.0 = Release|Any CPU 55 | EndGlobalSection 56 | GlobalSection(SolutionProperties) = preSolution 57 | HideSolutionNode = FALSE 58 | EndGlobalSection 59 | GlobalSection(NestedProjects) = preSolution 60 | {BE94564B-83DD-4B54-8358-3528E854216F} = {9AB36FFF-0532-400B-8A0F-153118679D17} 61 | {ABDA66EF-010B-415B-8F6F-3CC9DBCF9F60} = {BE94564B-83DD-4B54-8358-3528E854216F} 62 | {2766C3F2-8BEF-4E85-8FED-294C279C4279} = {BE94564B-83DD-4B54-8358-3528E854216F} 63 | {E5B41A94-4A55-4C47-80B0-EB1A5141B727} = {9AB36FFF-0532-400B-8A0F-153118679D17} 64 | EndGlobalSection 65 | GlobalSection(ExtensibilityGlobals) = postSolution 66 | SolutionGuid = {90D5AB15-14EE-4033-B987-66469015AFDA} 67 | EndGlobalSection 68 | EndGlobal 69 | -------------------------------------------------------------------------------- /SumatraPDFControl/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SumatraPDF.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("SumatraPDF.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap SumatraPDFControl { 67 | get { 68 | object obj = ResourceManager.GetObject("SumatraPDFControl", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Drawing.Bitmap. 75 | /// 76 | internal static System.Drawing.Bitmap SumatraPDFControlMini { 77 | get { 78 | object obj = ResourceManager.GetObject("SumatraPDFControlMini", resourceCulture); 79 | return ((System.Drawing.Bitmap)(obj)); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /docs/api/toc.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 |
5 |
6 | 7 | 8 | 9 |
10 |
11 | 61 |
62 |
-------------------------------------------------------------------------------- /docs/articles/intro.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Comming soon: 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 | 50 | 51 | 58 |
59 | 93 | 94 | 106 |
107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /docs/api/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Namespace SumatraPDF 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 | 50 | 51 | 58 |
59 | 94 | 95 | 107 |
108 | 109 | 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /SumatraPDFControlTest/MDIParent1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Text; 7 | using System.Windows.Forms; 8 | 9 | namespace SumatraPDFControlTest 10 | { 11 | public partial class MDIParent1 : Form 12 | { 13 | private int childFormNumber = 0; 14 | 15 | public MDIParent1() 16 | { 17 | InitializeComponent(); 18 | useLocalSumatraPDFIfAvailable.Checked = true; 19 | } 20 | 21 | private void ShowNewForm(object sender, EventArgs e) 22 | { 23 | Form childForm = new Form(); 24 | childForm.MdiParent = this; 25 | childForm.Text = "Window " + childFormNumber++; 26 | childForm.Show(); 27 | } 28 | 29 | private void OpenFile(object sender, EventArgs e) 30 | { 31 | OpenFileDialog openFileDialog = new OpenFileDialog(); 32 | openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); 33 | openFileDialog.Filter = "Portable Document Format (*.pdf)|*.pdf|All Files (*.*)|*.*"; 34 | openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\Downloads"; 35 | if (openFileDialog.ShowDialog(this) == DialogResult.OK) 36 | { 37 | string FileName = openFileDialog.FileName; 38 | var form = new Form1 { 39 | Filename = FileName, 40 | NewSumatraPDFProcess = openNewSumatraPDFProcessToolStripMenuItem.Checked, 41 | UseLocalSumatraPDF = useLocalSumatraPDFIfAvailable.Checked 42 | }; 43 | form.MdiParent = this; 44 | form.Show(); 45 | } 46 | 47 | } 48 | 49 | private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e) 50 | { 51 | SaveFileDialog saveFileDialog = new SaveFileDialog(); 52 | saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal); 53 | saveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*"; 54 | if (saveFileDialog.ShowDialog(this) == DialogResult.OK) 55 | { 56 | string FileName = saveFileDialog.FileName; 57 | } 58 | } 59 | 60 | private void ExitToolsStripMenuItem_Click(object sender, EventArgs e) 61 | { 62 | this.Close(); 63 | } 64 | 65 | private void ToolBarToolStripMenuItem_Click(object sender, EventArgs e) 66 | { 67 | toolStrip.Visible = toolBarToolStripMenuItem.Checked; 68 | } 69 | 70 | private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e) 71 | { 72 | statusStrip.Visible = statusBarToolStripMenuItem.Checked; 73 | } 74 | 75 | private void CascadeToolStripMenuItem_Click(object sender, EventArgs e) 76 | { 77 | LayoutMdi(MdiLayout.Cascade); 78 | } 79 | 80 | private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e) 81 | { 82 | LayoutMdi(MdiLayout.TileVertical); 83 | } 84 | 85 | private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e) 86 | { 87 | LayoutMdi(MdiLayout.TileHorizontal); 88 | } 89 | 90 | private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e) 91 | { 92 | LayoutMdi(MdiLayout.ArrangeIcons); 93 | } 94 | 95 | private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e) 96 | { 97 | foreach (Form childForm in MdiChildren) 98 | { 99 | childForm.Close(); 100 | } 101 | } 102 | 103 | private void helpToolStripButton_Click(object sender, EventArgs e) 104 | { 105 | System.Diagnostics.Process.Start("https://sumatrapdfcontrol.mcmonteiro.net"); 106 | } 107 | 108 | private void indexToolStripMenuItem_Click(object sender, EventArgs e) 109 | { 110 | helpToolStripButton_Click(sender, e); 111 | } 112 | 113 | private void copyToolStripMenuItem_Click(object sender, EventArgs e) 114 | { 115 | ((Form1)this.ActiveMdiChild)?.CopySelection(); 116 | } 117 | 118 | private void selectAllToolStripMenuItem_Click(object sender, EventArgs e) 119 | { 120 | ((Form1)this.ActiveMdiChild)?.SelectAll(); 121 | } 122 | 123 | private void printToolStripMenuItem_Click(object sender, EventArgs e) 124 | { 125 | ((Form1)this.ActiveMdiChild)?.OpenPrintDialog(); 126 | } 127 | 128 | } 129 | } 130 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Rules in this file were initially inferred by Visual Studio IntelliCode from the C:\Users\marco\source\repos\SumatraPDFControl codebase based on best match to current usage at 03/07/2021 2 | # You can modify the rules from these initially generated values to suit your own policies 3 | # You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference 4 | [*.cs] 5 | 6 | 7 | #Core editorconfig formatting - indentation 8 | 9 | #use soft tabs (spaces) for indentation 10 | indent_style = space 11 | 12 | #Formatting - new line options 13 | 14 | #require members of object intializers to be on separate lines 15 | csharp_new_line_before_members_in_object_initializers =false 16 | #require braces to be on a new line for object_collection_array_initializers, types, control_blocks, and methods (also known as "Allman" style) 17 | csharp_new_line_before_open_brace =all 18 | 19 | #Formatting - organize using options 20 | 21 | #sort System.* using directives alphabetically, and place them before other usings 22 | dotnet_sort_system_directives_first = true 23 | 24 | #Formatting - spacing options 25 | 26 | #require NO space between a cast and the value 27 | csharp_space_after_cast = false 28 | #require a space before the colon for bases or interfaces in a type declaration 29 | csharp_space_after_colon_in_inheritance_clause = true 30 | #require a space after a keyword in a control flow statement such as a for loop 31 | csharp_space_after_keywords_in_control_flow_statements = true 32 | #require a space before the colon for bases or interfaces in a type declaration 33 | csharp_space_before_colon_in_inheritance_clause = true 34 | #remove space within empty argument list parentheses 35 | csharp_space_between_method_call_empty_parameter_list_parentheses = false 36 | #remove space between method call name and opening parenthesis 37 | csharp_space_between_method_call_name_and_opening_parenthesis = false 38 | #do not place space characters after the opening parenthesis and before the closing parenthesis of a method call 39 | csharp_space_between_method_call_parameter_list_parentheses = false 40 | #remove space within empty parameter list parentheses for a method declaration 41 | csharp_space_between_method_declaration_empty_parameter_list_parentheses = false 42 | #place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list. 43 | csharp_space_between_method_declaration_parameter_list_parentheses = false 44 | 45 | #Formatting - wrapping options 46 | 47 | #leave statements and member declarations on the same line 48 | csharp_preserve_single_line_statements = true 49 | 50 | #Style - Code block preferences 51 | 52 | #prefer curly braces even for one line of code 53 | csharp_prefer_braces = true:suggestion 54 | 55 | #Style - expression bodied member options 56 | 57 | #prefer block bodies for constructors 58 | csharp_style_expression_bodied_constructors = false:suggestion 59 | #prefer block bodies for methods 60 | csharp_style_expression_bodied_methods = false:suggestion 61 | 62 | #Style - expression level options 63 | 64 | #prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them 65 | dotnet_style_predefined_type_for_member_access = true:suggestion 66 | 67 | #Style - Expression-level preferences 68 | 69 | #prefer objects to not be initialized using object initializers 70 | dotnet_style_object_initializer = false:suggestion 71 | 72 | #Style - implicit and explicit types 73 | 74 | #prefer explicit type over var in all cases, unless overridden by another code style rule 75 | csharp_style_var_elsewhere = false:suggestion 76 | #prefer explicit type over var to declare variables with built-in system types such as int 77 | csharp_style_var_for_built_in_types = false:suggestion 78 | #prefer explicit type over var when the type is already mentioned on the right-hand side of a declaration 79 | csharp_style_var_when_type_is_apparent = false:suggestion 80 | 81 | #Style - language keyword and framework type options 82 | 83 | #prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them 84 | dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion 85 | 86 | #Style - modifier options 87 | 88 | #prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods. 89 | dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion 90 | 91 | #Style - Modifier preferences 92 | 93 | #when this rule is set to a list of modifiers, prefer the specified ordering. 94 | csharp_preferred_modifier_order = private,public,protected,static,override:suggestion 95 | 96 | #Style - qualification options 97 | 98 | #prefer fields not to be prefaced with this. or Me. in Visual Basic 99 | dotnet_style_qualification_for_field = false:suggestion 100 | #prefer methods not to be prefaced with this. or Me. in Visual Basic 101 | dotnet_style_qualification_for_method = false:suggestion 102 | csharp_new_line_before_else=false 103 | csharp_new_line_before_catch=false 104 | csharp_new_line_before_finally=false 105 | csharp_new_line_before_members_in_anonymous_types=false 106 | csharp_new_line_between_query_expression_clauses=false 107 | 108 | [*.{cs,vb}] 109 | tab_width=4 110 | indent_size=4 -------------------------------------------------------------------------------- /SumatraPDFControlTest/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | text/microsoft-resx 107 | 108 | 109 | 2.0 110 | 111 | 112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 113 | 114 | 115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | -------------------------------------------------------------------------------- /SumatraPDFControl/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\sumatrapdfcontrol.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | 125 | ..\Resources\sumatrapdfcontrolmini.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 126 | 127 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | SumatraPDFControl 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 |
26 | 27 | 50 | 51 | 58 |
59 | 117 | 118 | 130 |
131 | 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /docs/api/SumatraPDF.SumatraPDFControl.ZoomVirtualEnum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Enum SumatraPDFControl.ZoomVirtualEnum 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 140 | 141 | 153 |
154 | 155 | 156 | 157 | 158 | 159 | 160 | -------------------------------------------------------------------------------- /docs/api/SumatraPDF.SumatraPDFControl.RotationEnum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Enum SumatraPDFControl.RotationEnum 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 145 | 146 | 158 |
159 | 160 | 161 | 162 | 163 | 164 | 165 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb 341 | /nuget/SumatraPDF.x64/SumatraPDF.exe 342 | /nuget/SumatraPDF.x86/SumatraPDF.exe 343 | /nuget/NUGET.ORG.APIKEY.TXT 344 | /SumatraPDFControl/log.txt 345 | nuget 346 | -------------------------------------------------------------------------------- /docs/api/SumatraPDF.SumatraPDFControl.DisplayModeEnum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Enum SumatraPDFControl.DisplayModeEnum 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 155 | 156 | 168 |
169 | 170 | 171 | 172 | 173 | 174 | 175 | -------------------------------------------------------------------------------- /docs/api/SumatraPDF.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Namespace SumatraPDF 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 137 | 138 | 150 |
151 | 152 | 153 | 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /docs/api/SumatraPDF.SumatraPDFControl.LinkClickedEventArgs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Class SumatraPDFControl.LinkClickedEventArgs 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 182 | 183 | 195 |
196 | 197 | 198 | 199 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /docs/api/SumatraPDF.SumatraPDFControl.ScrollStateEventArgs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Class SumatraPDFControl.ScrollStateEventArgs 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 182 | 183 | 195 |
196 | 197 | 198 | 199 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /docs/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "homepages": [], 3 | "source_base_path": "C:/Users/marco/source/repos/SumatraPDFControl/Documentation", 4 | "xrefmap": "xrefmap.yml", 5 | "files": [ 6 | { 7 | "type": "Resource", 8 | "source_relative_path": "../SumatraPDFControl/Resources/SumatraPDFControl.png", 9 | "output": { 10 | "resource": { 11 | "relative_path": "images/SumatraPDFControl.png" 12 | } 13 | }, 14 | "is_incremental": false, 15 | "version": "" 16 | }, 17 | { 18 | "type": "Resource", 19 | "source_relative_path": "../SumatraPDFControl/SumatraPDF.ico", 20 | "output": { 21 | "resource": { 22 | "relative_path": "images/SumatraPDF.ico" 23 | } 24 | }, 25 | "is_incremental": false, 26 | "version": "" 27 | }, 28 | { 29 | "type": "ManagedReference", 30 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.ContextMenuOpeningEventArgs.yml", 31 | "output": { 32 | ".html": { 33 | "relative_path": "api/SumatraPDF.SumatraPDFControl.ContextMenuOpeningEventArgs.html", 34 | "hash": "H7nfpZUcEX86nETQ+QGbr2KeJdzpB9z/lyPFZIBc224=" 35 | } 36 | }, 37 | "is_incremental": false, 38 | "version": "" 39 | }, 40 | { 41 | "type": "ManagedReference", 42 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.DisplayModeChangedEventArgs.yml", 43 | "output": { 44 | ".html": { 45 | "relative_path": "api/SumatraPDF.SumatraPDFControl.DisplayModeChangedEventArgs.html", 46 | "hash": "Us5Y8jL2g8U/AUelZkMRYItArncfAHUGvgML2TjA/K0=" 47 | } 48 | }, 49 | "is_incremental": false, 50 | "version": "" 51 | }, 52 | { 53 | "type": "ManagedReference", 54 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.DisplayModeEnum.yml", 55 | "output": { 56 | ".html": { 57 | "relative_path": "api/SumatraPDF.SumatraPDFControl.DisplayModeEnum.html", 58 | "hash": "ijO1Cec0cTI0Gr8jEaYnvlznkrTeS533kCRA3ulBtjU=" 59 | } 60 | }, 61 | "is_incremental": true, 62 | "version": "" 63 | }, 64 | { 65 | "type": "ManagedReference", 66 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.LinkClickedEventArgs.yml", 67 | "output": { 68 | ".html": { 69 | "relative_path": "api/SumatraPDF.SumatraPDFControl.LinkClickedEventArgs.html", 70 | "hash": "M/KcMg7YzAOOFVv/nTUMWvqxrXkfg4Vz2yiq2DXY5Ak=" 71 | } 72 | }, 73 | "is_incremental": false, 74 | "version": "" 75 | }, 76 | { 77 | "type": "ManagedReference", 78 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.PageChangedEventArgs.yml", 79 | "output": { 80 | ".html": { 81 | "relative_path": "api/SumatraPDF.SumatraPDFControl.PageChangedEventArgs.html", 82 | "hash": "Kw7rU190AvASKl7Gczoeii6l0T7Zmk9zS9IvXfziwis=" 83 | } 84 | }, 85 | "is_incremental": false, 86 | "version": "" 87 | }, 88 | { 89 | "type": "ManagedReference", 90 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.RotationEnum.yml", 91 | "output": { 92 | ".html": { 93 | "relative_path": "api/SumatraPDF.SumatraPDFControl.RotationEnum.html", 94 | "hash": "6xKw6Dt3x7ZC9Ppvjd/9xNkE8accUsH70GntwQaqEv0=" 95 | } 96 | }, 97 | "is_incremental": false, 98 | "version": "" 99 | }, 100 | { 101 | "type": "ManagedReference", 102 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.ScrollStateEventArgs.yml", 103 | "output": { 104 | ".html": { 105 | "relative_path": "api/SumatraPDF.SumatraPDFControl.ScrollStateEventArgs.html", 106 | "hash": "y55m3TRy86lzELzkceBoMGPWjjDZ87CMhYz3rcAkaCw=" 107 | } 108 | }, 109 | "is_incremental": false, 110 | "version": "" 111 | }, 112 | { 113 | "type": "ManagedReference", 114 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.ScrollStateStruct.yml", 115 | "output": { 116 | ".html": { 117 | "relative_path": "api/SumatraPDF.SumatraPDFControl.ScrollStateStruct.html", 118 | "hash": "SygP95DJv2lwb/Z+d/Xe6/6JUAYIy6poijwW4wF2CaQ=" 119 | } 120 | }, 121 | "is_incremental": true, 122 | "version": "" 123 | }, 124 | { 125 | "type": "ManagedReference", 126 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.SumatraMessageEventArgs.yml", 127 | "output": { 128 | ".html": { 129 | "relative_path": "api/SumatraPDF.SumatraPDFControl.SumatraMessageEventArgs.html", 130 | "hash": "d6lCX2aQqOFhCkBEbBbv81o+nTDIIdQiGXFDHvlPtag=" 131 | } 132 | }, 133 | "is_incremental": false, 134 | "version": "" 135 | }, 136 | { 137 | "type": "ManagedReference", 138 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.ZoomChangedEventArgs.yml", 139 | "output": { 140 | ".html": { 141 | "relative_path": "api/SumatraPDF.SumatraPDFControl.ZoomChangedEventArgs.html", 142 | "hash": "t0oIkZz19Gp6HHdLWa7hfwSo/IilhwxUMZsdBGY0AVI=" 143 | } 144 | }, 145 | "is_incremental": false, 146 | "version": "" 147 | }, 148 | { 149 | "type": "ManagedReference", 150 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.ZoomVirtualEnum.yml", 151 | "output": { 152 | ".html": { 153 | "relative_path": "api/SumatraPDF.SumatraPDFControl.ZoomVirtualEnum.html", 154 | "hash": "pPVR61bcXz8wyamMG+OH9lPFIRml497qjdLNDQBqYuc=" 155 | } 156 | }, 157 | "is_incremental": true, 158 | "version": "" 159 | }, 160 | { 161 | "type": "ManagedReference", 162 | "source_relative_path": "api/SumatraPDF.SumatraPDFControl.yml", 163 | "output": { 164 | ".html": { 165 | "relative_path": "api/SumatraPDF.SumatraPDFControl.html", 166 | "hash": "0DGtsxgEkpqXZCUi6g1TU5GdTLIMX4LA4XnwFcLuvOc=" 167 | } 168 | }, 169 | "is_incremental": false, 170 | "version": "" 171 | }, 172 | { 173 | "type": "ManagedReference", 174 | "source_relative_path": "api/SumatraPDF.yml", 175 | "output": { 176 | ".html": { 177 | "relative_path": "api/SumatraPDF.html", 178 | "hash": "tA8rn218VuYWHUgf0jypRZhtpA5z4eGTcWoFyh6rlZU=" 179 | } 180 | }, 181 | "is_incremental": false, 182 | "version": "" 183 | }, 184 | { 185 | "log_codes": [ 186 | "InvalidFileLink" 187 | ], 188 | "type": "Conceptual", 189 | "source_relative_path": "api/index.md", 190 | "output": { 191 | ".html": { 192 | "relative_path": "api/index.html", 193 | "hash": "Hj/f7lGqdoCHOPxFZsWsCVdbrwwt+t2PyUyANMmj6Kk=" 194 | } 195 | }, 196 | "is_incremental": true, 197 | "version": "" 198 | }, 199 | { 200 | "type": "Toc", 201 | "source_relative_path": "api/toc.yml", 202 | "output": { 203 | ".html": { 204 | "relative_path": "api/toc.html", 205 | "hash": "Z3lyHx1RNihyg0w+vr8YmI6VeCTY3EV+YPKyxGNzxa4=" 206 | } 207 | }, 208 | "is_incremental": false, 209 | "version": "" 210 | }, 211 | { 212 | "type": "Conceptual", 213 | "source_relative_path": "articles/intro.md", 214 | "output": { 215 | ".html": { 216 | "relative_path": "articles/intro.html", 217 | "hash": "fQL5GJbvdAJ48PA2J4izDBxjNx4Rnq9kXZr3/Hm44FE=" 218 | } 219 | }, 220 | "is_incremental": true, 221 | "version": "" 222 | }, 223 | { 224 | "type": "Toc", 225 | "source_relative_path": "articles/toc.yml", 226 | "output": { 227 | ".html": { 228 | "relative_path": "articles/toc.html", 229 | "hash": "BlPxk5mtl2kgfcZUgkEguqiSAR/EUyUTT4EdebwkQvs=" 230 | } 231 | }, 232 | "is_incremental": false, 233 | "version": "" 234 | }, 235 | { 236 | "type": "Conceptual", 237 | "source_relative_path": "index.md", 238 | "output": { 239 | ".html": { 240 | "relative_path": "index.html", 241 | "hash": "PBZ26q+Eh2HclrvsxDMre5+Xn0A8XdIwFOFtkqYc9dY=" 242 | } 243 | }, 244 | "is_incremental": true, 245 | "version": "" 246 | }, 247 | { 248 | "log_codes": [ 249 | "InvalidFileLink" 250 | ], 251 | "type": "Toc", 252 | "source_relative_path": "toc.yml", 253 | "output": { 254 | ".html": { 255 | "relative_path": "toc.html", 256 | "hash": "oQRnNhrPmqf7x7dUoR1BzIpRCuvDVESTxpIxRutEgF8=" 257 | } 258 | }, 259 | "is_incremental": false, 260 | "version": "" 261 | } 262 | ], 263 | "incremental_info": [ 264 | { 265 | "status": { 266 | "can_incremental": true, 267 | "incrementalPhase": "build", 268 | "total_file_count": 0, 269 | "skipped_file_count": 0 270 | }, 271 | "processors": { 272 | "ConceptualDocumentProcessor": { 273 | "can_incremental": true, 274 | "incrementalPhase": "build", 275 | "total_file_count": 3, 276 | "skipped_file_count": 3 277 | }, 278 | "ManagedReferenceDocumentProcessor": { 279 | "can_incremental": true, 280 | "incrementalPhase": "build", 281 | "total_file_count": 13, 282 | "skipped_file_count": 12 283 | }, 284 | "ResourceDocumentProcessor": { 285 | "can_incremental": false, 286 | "details": "Processor ResourceDocumentProcessor cannot support incremental build because the processor doesn't implement ISupportIncrementalDocumentProcessor interface.", 287 | "incrementalPhase": "build", 288 | "total_file_count": 0, 289 | "skipped_file_count": 0 290 | }, 291 | "TocDocumentProcessor": { 292 | "can_incremental": false, 293 | "details": "Processor TocDocumentProcessor cannot support incremental build because the processor doesn't implement ISupportIncrementalDocumentProcessor interface.", 294 | "incrementalPhase": "build", 295 | "total_file_count": 0, 296 | "skipped_file_count": 0 297 | } 298 | } 299 | }, 300 | { 301 | "status": { 302 | "can_incremental": true, 303 | "details": "Can support incremental post processing.", 304 | "incrementalPhase": "postProcessing", 305 | "total_file_count": 0, 306 | "skipped_file_count": 0 307 | }, 308 | "processors": {} 309 | } 310 | ], 311 | "version_info": {}, 312 | "groups": [ 313 | { 314 | "xrefmap": "xrefmap.yml" 315 | } 316 | ] 317 | } -------------------------------------------------------------------------------- /docs/api/SumatraPDF.SumatraPDFControl.DisplayModeChangedEventArgs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Class SumatraPDFControl.DisplayModeChangedEventArgs 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 182 | 183 | 195 |
196 | 197 | 198 | 199 | 200 | 201 | 202 | -------------------------------------------------------------------------------- /docs/api/SumatraPDF.SumatraPDFControl.SumatraMessageEventArgs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Class SumatraPDFControl.SumatraMessageEventArgs 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 212 | 213 | 225 |
226 | 227 | 228 | 229 | 230 | 231 | 232 | -------------------------------------------------------------------------------- /docs/api/SumatraPDF.SumatraPDFControl.PageChangedEventArgs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Class SumatraPDFControl.PageChangedEventArgs 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 218 | 219 | 231 |
232 | 233 | 234 | 235 | 236 | 237 | 238 | -------------------------------------------------------------------------------- /SumatraPDFControlTest/Form1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Reflection; 7 | using System.Text; 8 | using System.Text.RegularExpressions; 9 | using System.Windows.Forms; 10 | using static SumatraPDF.SumatraPDFControl; 11 | 12 | namespace SumatraPDFControlTest 13 | { 14 | public partial class Form1 : Form 15 | { 16 | public string Filename = string.Empty; 17 | public Boolean NewSumatraPDFProcess = false; 18 | public Boolean UseLocalSumatraPDF = true; 19 | 20 | public Form1() 21 | { 22 | InitializeComponent(); 23 | } 24 | 25 | private void toolStripButton1_Click(object sender, EventArgs e) 26 | { 27 | if (openFileDialog.ShowDialog() == DialogResult.OK) 28 | { 29 | LoadFile(openFileDialog.FileName, int.Parse(toolText.Text == "" ? "1" : toolText.Text), false); 30 | } 31 | 32 | } 33 | 34 | private void toolStripButton2_Click(object sender, EventArgs e) 35 | { 36 | SumatraPDFControl.Page = int.Parse(toolText.Text); 37 | } 38 | 39 | private void toolStripCopySelection_Click(object sender, EventArgs e) 40 | { 41 | SumatraPDFControl.CopySelection(); 42 | } 43 | 44 | private void toolStripToogleToolbar_Click(object sender, EventArgs e) 45 | { 46 | SumatraPDFControl.ToolBarVisible = !SumatraPDFControl.ToolBarVisible; 47 | } 48 | 49 | private void SumatraPDFControl_SumatraMessage(object sender, SumatraMessageEventArgs e) 50 | { 51 | AddText(e.Msg + " - " + e.CallBackReturn); 52 | } 53 | 54 | private void SumatraPDFControl_PageChangedMessage(object sender, PageChangedEventArgs e) 55 | { 56 | toolPage.Text = e.Page.ToString() + " / " + e.NamedDest; 57 | lblCurrPage.Text = SumatraPDFControl.Page.ToString(); 58 | } 59 | 60 | private void SumatraPDFControl_ContextMenuMessage(object sender, ContextMenuOpeningEventArgs e) 61 | { 62 | AddText("ContextMenu - X: " + e.X.ToString() + " - Y: " + e.Y.ToString()); 63 | e.Handled = (cbContextMenuType.SelectedIndex == 2); 64 | } 65 | 66 | private void SumatraPDFControl_ZoomChangedMessage(object sender, ZoomChangedEventArgs e) 67 | { 68 | toolZoom.Text = e.Zoom.ToString(); 69 | toolZoomVirtual.Text = e.ZoomVirtual.ToString(); 70 | // Example limiting zoom in 300% 71 | if (e.Zoom > 300) SumatraPDFControl.Zoom = 300; 72 | } 73 | 74 | private void SumatraPDFControl_LinkClickedMessage(object sender, SumatraPDF.SumatraPDFControl.LinkClickedEventArgs e) 75 | { 76 | AddText("LinkClicked: " + e.LinkText); 77 | } 78 | 79 | private void toolStripButton5_Click(object sender, EventArgs e) 80 | { 81 | SumatraPDFControl.TextSearch(toolText.Text, true); 82 | } 83 | 84 | private void toolStripButton6_Click(object sender, EventArgs e) 85 | { 86 | SumatraPDFControl.TextSearchNext(false); 87 | } 88 | 89 | private void toolStripButton7_Click(object sender, EventArgs e) 90 | { 91 | SumatraPDFControl.TextSearchNext(true); 92 | } 93 | 94 | private void toolStripButton8_Click(object sender, EventArgs e) 95 | { 96 | SumatraPDFControl.NamedDest = toolText.Text; 97 | } 98 | 99 | private void toolStripButton9_Click(object sender, EventArgs e) 100 | { 101 | toolText.Text = SumatraPDFControl.Page.ToString(); 102 | } 103 | 104 | private void toolStripToogleToc_Click(object sender, EventArgs e) 105 | { 106 | SumatraPDFControl.TocVisible = !SumatraPDFControl.TocVisible; 107 | } 108 | 109 | private void toolStripComboBox1_SelectedIndexChanged(object sender, EventArgs e) 110 | { 111 | if (toolPageMode.Text != String.Empty) 112 | SumatraPDFControl.DisplayMode = (DisplayModeEnum)toolPageMode.SelectedIndex; 113 | 114 | } 115 | 116 | private void toolStripButton11_Click(object sender, EventArgs e) 117 | { 118 | toolPageMode.Text = SumatraPDFControl.DisplayMode.ToString(); 119 | } 120 | 121 | private void toolSetZoom_Click(object sender, EventArgs e) 122 | { 123 | SumatraPDFControl.Zoom = float.Parse(toolText.Text); 124 | } 125 | 126 | private void toolZoomVirtualSet_SelectedIndexChanged(object sender, EventArgs e) 127 | { 128 | SumatraPDFControl.ZoomVirtual = (ZoomVirtualEnum)(toolZoomVirtualSet.SelectedIndex * -1); 129 | } 130 | 131 | private void toolGetZoomVirtual_Click(object sender, EventArgs e) 132 | { 133 | toolZoomVirtualSet.Text = SumatraPDFControl.ZoomVirtual.ToString(); 134 | } 135 | 136 | System.IO.FileSystemWatcher fw; 137 | private void LoadFile(string Filename, int Page, bool NewSumatraInstance) 138 | { 139 | if (fw != null) 140 | { 141 | fw.EnableRaisingEvents = false; 142 | fw.Dispose(); 143 | } 144 | SumatraPDFControl.LoadFile(Filename, Page, NewSumatraInstance); 145 | fw = new System.IO.FileSystemWatcher(System.IO.Path.GetDirectoryName(Filename)) 146 | { 147 | NotifyFilter = System.IO.NotifyFilters.LastWrite, 148 | Filter = System.IO.Path.GetFileName(Filename), 149 | IncludeSubdirectories = true 150 | }; 151 | fw.Changed += Fw_Changed; 152 | fw.EnableRaisingEvents = true; 153 | 154 | } 155 | 156 | private void Form1_Shown(object sender, EventArgs e) 157 | { 158 | LoadFile(Filename, 1, NewSumatraInstance: NewSumatraPDFProcess); 159 | cbContextMenuType.SelectedIndex = 1; 160 | Filename = string.Empty; 161 | } 162 | 163 | private void Fw_Changed(object sender, System.IO.FileSystemEventArgs e) 164 | { 165 | SumatraPDFControl.ReloadCurrentFile(); 166 | } 167 | 168 | private void SumatraPDFControl_ScrollStateChanged(object sender, ScrollStateEventArgs e) 169 | { 170 | if (cbShowScrollState.Checked) 171 | { 172 | toolScrollPosX.Text = e.ScrollState.X.ToString(); 173 | toolScrollPosY.Text = e.ScrollState.Y.ToString(); 174 | toolScrollPosPage.Text = e.ScrollState.Page.ToString(); 175 | } 176 | } 177 | 178 | private void toolSetScrollPos_Click(object sender, EventArgs e) 179 | { 180 | Match mSP = Regex.Match(toolText.Text, @"(?.+)\,(?.+)\,\s*(?.+)"); 181 | var pScrollPosition = new ScrollStateStruct( 182 | int.Parse(mSP.Result("${page}")), 183 | Double.Parse(mSP.Result("${x}")), 184 | Double.Parse(mSP.Result("${y}")) 185 | ); 186 | SumatraPDFControl.ScrollState = pScrollPosition; 187 | } 188 | 189 | private void SumatraPDFControl_DisplayModeChangedMessage(object sender, DisplayModeChangedEventArgs e) 190 | { 191 | toolDisplayMode.Text = e.DisplayMode.ToString(); 192 | } 193 | 194 | private void toolGetRotation_Click(object sender, EventArgs e) 195 | { 196 | toolText.Text = SumatraPDFControl.Rotation.ToString(); 197 | } 198 | 199 | private void toolSetRotation_Click(object sender, EventArgs e) 200 | { 201 | SumatraPDFControl.RotateBy((RotationEnum)int.Parse(toolText.Text)); 202 | } 203 | 204 | private void SumatraPDFControl_KeyDown(object sender, KeyEventArgs e) 205 | { 206 | AddText("KeyDown: " + e.KeyData.ToString()); 207 | e.Handled = false; 208 | e.SuppressKeyPress = false; 209 | } 210 | private void SumatraPDFControl_KeyPressedMessage(object sender, KeyPressEventArgs e) 211 | { 212 | AddText("KeyPressed: " + e.KeyChar); 213 | } 214 | 215 | private void SumatraPDFControl_KeyUp(object sender, KeyEventArgs e) 216 | { 217 | AddText("KeyUp: " + e.KeyData.ToString()); 218 | } 219 | 220 | private void AddText(string text) 221 | { 222 | textBox1.Text = DateTime.Now.ToLongTimeString() + ": " + text + System.Environment.NewLine + textBox1.Text; 223 | textBox1.SelectionStart = 0; 224 | } 225 | 226 | private void SumatraPDFControl_MouseClick(object sender, MouseEventArgs e) 227 | { 228 | AddText("MouseClick: " + e.ToString()); 229 | } 230 | 231 | private void SumatraPDFControl_MouseDown(object sender, MouseEventArgs e) 232 | { 233 | AddText("MouseDown: " + e.Button.ToString()); 234 | } 235 | 236 | private void SumatraPDFControl_MouseUp(object sender, MouseEventArgs e) 237 | { 238 | AddText("MouseUp: " + e.Button.ToString()); 239 | } 240 | 241 | private void SumatraPDFControl_MouseDoubleClick(object sender, MouseEventArgs e) 242 | { 243 | AddText("MouseDoubleClick: " + e.Button.ToString() + string.Format(" - ({0},{1})", e.X, e.Y)); 244 | } 245 | 246 | private void toolOpenPrintDialog_Click(object sender, EventArgs e) 247 | { 248 | SumatraPDFControl.OpenPrintDialog(); 249 | } 250 | 251 | private void FormTest_Load(object sender, EventArgs e) 252 | { 253 | // If SumatraPDFPath was not filled try to use SumatraPDF.exe from SumatraPDF compiled source (if available in same SumatraPDFControl solution dir level). 254 | if (UseLocalSumatraPDF && (SumatraPDFControl.SumatraPDFPath == null || SumatraPDFControl.SumatraPDFPath == string.Empty)) { 255 | string arch = System.Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE", EnvironmentVariableTarget.Machine); 256 | string SumatraDir = string.Empty, SumatraDir2 = string.Empty, SumatraDir3 = string.Empty, SumatraPDFSubdir = string.Empty; 257 | 258 | SumatraPDFSubdir = (arch == "AMD64") ? @"\dbg64\" : @"\dbg32\"; 259 | SumatraDir = @"..\..\..\..\..\sumatrapdf\out" + SumatraPDFSubdir; 260 | if (System.IO.File.Exists(SumatraDir + SumatraPDFControl.SumatraPDFExe)) SumatraPDFControl.SumatraPDFPath = SumatraDir; 261 | } 262 | 263 | } 264 | 265 | private void toolStripSelectAllText_Click(object sender, EventArgs e) 266 | { 267 | SumatraPDFControl.SelectAll(); 268 | } 269 | 270 | public void SelectAll() 271 | { 272 | SumatraPDFControl.SelectAll(); 273 | } 274 | 275 | public void CopySelection() 276 | { 277 | SumatraPDFControl.CopySelection(); 278 | } 279 | 280 | public void OpenPrintDialog() 281 | { 282 | SumatraPDFControl.OpenPrintDialog(); 283 | } 284 | 285 | private void buttonGotoFirst_Click(object sender, EventArgs e) 286 | { 287 | SumatraPDFControl.GoToFirstPage(); 288 | } 289 | 290 | private void buttonGotoPrev_Click(object sender, EventArgs e) 291 | { 292 | SumatraPDFControl.GoToPrevPage(); 293 | } 294 | 295 | private void buttonGotoNext_Click(object sender, EventArgs e) 296 | { 297 | SumatraPDFControl.GoToNextPage(); 298 | } 299 | 300 | private void buttonGotoLast_Click(object sender, EventArgs e) 301 | { 302 | SumatraPDFControl.GoToLastPage(); 303 | } 304 | 305 | private void SumatraPDFControl_FileOpened(object sender, EventArgs e) 306 | { 307 | toolPage.Text = SumatraPDFControl.Page.ToString() + " - " + SumatraPDFControl.NamedDest; 308 | lblCurrPage.Text = SumatraPDFControl.Page.ToString(); 309 | lblPageCount.Text = SumatraPDFControl.PageCount.ToString(); 310 | cbKeyAccel.Checked = SumatraPDFControl.KeyAccelerators; 311 | } 312 | 313 | private void btnReload_Click(object sender, EventArgs e) 314 | { 315 | SumatraPDFControl.ReloadCurrentFile(); 316 | } 317 | 318 | private void cbKeyAccel_CheckedChanged(object sender, EventArgs e) 319 | { 320 | SumatraPDFControl.KeyAccelerators = cbKeyAccel.Checked; 321 | } 322 | 323 | private void cbContextMenuType_SelectedIndexChanged(object sender, EventArgs e) 324 | { 325 | switch (cbContextMenuType.SelectedIndex) { 326 | case 1: 327 | SumatraPDFControl.ContextMenuStrip = contextMenuSumatraPDF; 328 | break; 329 | default: 330 | SumatraPDFControl.ContextMenuStrip = null; 331 | break; 332 | } 333 | 334 | } 335 | } 336 | } 337 | -------------------------------------------------------------------------------- /docs/api/SumatraPDF.SumatraPDFControl.ContextMenuOpeningEventArgs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Class SumatraPDFControl.ContextMenuOpeningEventArgs 9 | 10 | 11 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 |
28 | 29 | 52 | 53 | 60 |
61 | 252 | 253 |
254 |
255 | 264 |
265 |
266 | 267 | 268 | 269 | 270 | 271 | 272 | --------------------------------------------------------------------------------