├── .gitattributes ├── .gitignore ├── HtmlToPDF-AtServer.sln ├── HtmlToPDF-AtServer ├── App_Start │ └── RouteConfig.cs ├── Content │ ├── Site.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ └── polar.jpg ├── Controllers │ └── HomeController.cs ├── Global.asax ├── Global.asax.cs ├── HtmlToPDF-AtServer.csproj ├── Models │ └── test.cs ├── Properties │ └── AssemblyInfo.cs ├── SavedPDF │ └── clientPDF_Arslan_14-Feb-2019.pdf ├── Scripts │ ├── bootstrap.js │ ├── bootstrap.min.js │ ├── jquery-1.10.2.intellisense.js │ ├── jquery-1.10.2.js │ ├── jquery-1.10.2.min.js │ ├── jquery-1.10.2.min.map │ └── modernizr-2.6.2.js ├── Views │ ├── Home │ │ └── Index.cshtml │ ├── Shared │ │ ├── _Layout.cshtml │ │ └── sample.html │ ├── _ViewStart.cshtml │ └── web.config ├── Web.Debug.config ├── Web.Release.config ├── Web.config ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── libeay32.dll ├── libgcc_s_dw2-1.dll ├── mingwm10.dll ├── packages.config ├── ssleay32.dll └── wkhtmltox0.dll ├── LICENSE ├── README.md └── htmlToPdfdemo.gif /.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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /HtmlToPDF-AtServer.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.28307.421 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HtmlToPDF-AtServer", "HtmlToPDF-AtServer\HtmlToPDF-AtServer.csproj", "{9F22402B-D391-45F1-A717-D4DDC0420503}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9F22402B-D391-45F1-A717-D4DDC0420503}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9F22402B-D391-45F1-A717-D4DDC0420503}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9F22402B-D391-45F1-A717-D4DDC0420503}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9F22402B-D391-45F1-A717-D4DDC0420503}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {3AD215EC-FA7B-4447-99CB-C2A899D32F0C} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/App_Start/RouteConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace HtmlToPDF_AtServer 9 | { 10 | public class RouteConfig 11 | { 12 | public static void RegisterRoutes(RouteCollection routes) 13 | { 14 | routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 15 | 16 | routes.MapRoute( 17 | name: "Default", 18 | url: "{controller}/{action}/{id}", 19 | defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Content/Site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Set padding to keep content from hitting the edges */ 7 | .body-content { 8 | padding-left: 15px; 9 | padding-right: 15px; 10 | } 11 | 12 | /* Set width on the form input elements since they're 100% wide by default */ 13 | input, 14 | select, 15 | textarea { 16 | max-width: 280px; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Content/polar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/Content/polar.jpg -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Drawing; 4 | using System.Drawing.Printing; 5 | using System.Linq; 6 | using System.Web; 7 | using System.Web.Mvc; 8 | using Pechkin; 9 | using Pechkin.Synchronized; // Installing PECHKIN.Synchronized from Nuget (Simple PECHKIN will install automatically) 10 | using System.IO; 11 | using HtmlToPDF_AtServer.Models; 12 | 13 | namespace HtmlToPDF_AtServer.Controllers 14 | { 15 | public class HomeController : Controller 16 | { 17 | // GET: Home 18 | public ActionResult Index() 19 | { 20 | return View(); 21 | } 22 | 23 | // Method to Convert Template HTML with Dynamic Data to PDF and Save it on Server 24 | 25 | public ActionResult ConvertPdf() 26 | { 27 | 28 | // Setting Up Global Configuration for PDF writer 29 | 30 | GlobalConfig gc = new GlobalConfig(); 31 | 32 | gc.SetMargins(new Margins(100, 100, 100, 100)) 33 | .SetDocumentTitle("Test document") 34 | .SetPaperSize(PaperKind.Letter); 35 | 36 | 37 | // Initializing PECHKIN object with Global Configuration 38 | 39 | IPechkin pechkin = new SynchronizedPechkin(gc); 40 | 41 | // ANY model Object (Custom Model) with Data in It 42 | 43 | test newTest = new test { Id = 2, Name = "Arslan" }; 44 | 45 | // Getting Image path from Server Folder. If any user/admin upload there image to Server 46 | // Path can vary according to your needs where you put your uploads. 47 | 48 | string imgPath = Server.MapPath("~/Content/") + "polar.jpg"; 49 | 50 | // Method writting at Bottom to convert Image to Base 64. So you can print images on PDF 51 | // Just pass Image path string created above to it and it will return base64 string 52 | 53 | var base64Image = ImageToBase64(imgPath); 54 | 55 | // Reading TEMPLATE.HTML from stored location to be ready and converted into PDF 56 | // Converting HTML into String (Stream) to pass on network or replace tags inside its TEXT. 57 | 58 | string body = string.Empty; 59 | StreamReader reader = new StreamReader(Server.MapPath("~/Views/Shared/sample.html")); 60 | using (reader) 61 | { 62 | body = reader.ReadToEnd(); 63 | } 64 | 65 | // REPLACING tags inside TEMPLATE.HTML with dynamic data Taken from any MODEL. 66 | 67 | body = body.Replace("{NAME}", newTest.Name); 68 | body = body.Replace("{ID}", Convert.ToString(newTest.Id)); 69 | body = body.Replace("{SRC}", base64Image); // This is Image src , replaced with BASE64 string 70 | 71 | // CONVERTING Body(html stream) to Bytes with PECHKIN to be Convert to PDF asnd able to store on server. 72 | 73 | byte[] pdfContent = pechkin.Convert(body); 74 | 75 | // Setting Up Directory Path. Where PDF files will be save on Server. 76 | 77 | string directory = Server.MapPath("~/SavedPDF/"); 78 | 79 | // Setting up PDF File Name (Dynamic Name for every client Name with Date) 80 | 81 | string filename = "clientPDF_" + newTest.Name + "_" + DateTime.Now.ToString("dd-MMM-yyyy") + ".pdf"; 82 | 83 | // Writing Byte Array (PDF CONTENT) to File completely. If Success The SUCCESS messeg will be written on Console. 84 | 85 | if (ByteArrayToFile(directory + filename, pdfContent)) 86 | { 87 | Console.WriteLine("PDF Succesfully created"); 88 | } 89 | else 90 | { 91 | Console.WriteLine("Cannot create PDF"); 92 | } 93 | 94 | // Returing to Main Page 95 | 96 | return RedirectToAction("Index"); 97 | } 98 | 99 | // Method To Wrie BYTES on FILE 100 | 101 | public bool ByteArrayToFile(string fileName, byte[] byteArray) 102 | { 103 | try 104 | { 105 | FileStream fileStream = new FileStream(fileName, FileMode.Create, FileAccess.Write); 106 | fileStream.Write(byteArray, 0, byteArray.Length); 107 | fileStream.Close(); 108 | 109 | return true; 110 | } 111 | catch (Exception exception) 112 | { 113 | Console.WriteLine("Exception caught in process while trying to save : {0}", exception.ToString()); 114 | } 115 | 116 | return false; 117 | } 118 | 119 | // Method To Load image form Server Path and Convert it to Base 64 120 | 121 | private string ImageToBase64(string imagePath) 122 | { 123 | using (Image image = Image.FromFile(imagePath)) 124 | { 125 | using (MemoryStream mStream = new MemoryStream()) 126 | { 127 | image.Save(mStream, image.RawFormat); 128 | byte[] imageBytes = mStream.ToArray(); 129 | var base64String = Convert.ToBase64String(imageBytes); 130 | 131 | return "data:image/jpg;base64," + base64String; 132 | } 133 | } 134 | } 135 | } 136 | } -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="HtmlToPDF_AtServer.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Global.asax.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using System.Web.Mvc; 6 | using System.Web.Routing; 7 | 8 | namespace HtmlToPDF_AtServer 9 | { 10 | public class MvcApplication : System.Web.HttpApplication 11 | { 12 | protected void Application_Start() 13 | { 14 | AreaRegistration.RegisterAllAreas(); 15 | RouteConfig.RegisterRoutes(RouteTable.Routes); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/HtmlToPDF-AtServer.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | 8 | 9 | 2.0 10 | {9F22402B-D391-45F1-A717-D4DDC0420503} 11 | {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} 12 | Library 13 | Properties 14 | HtmlToPDF_AtServer 15 | HtmlToPDF-AtServer 16 | v4.6.1 17 | true 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | true 29 | full 30 | false 31 | bin\ 32 | DEBUG;TRACE 33 | prompt 34 | 4 35 | 36 | 37 | true 38 | pdbonly 39 | true 40 | bin\ 41 | TRACE 42 | prompt 43 | 4 44 | 45 | 46 | 47 | ..\packages\Common.Logging.2.1.1\lib\net40\Common.Logging.dll 48 | 49 | 50 | 51 | ..\packages\Pechkin.0.5.8.1\lib\net40\Pechkin.dll 52 | 53 | 54 | ..\packages\Pechkin.Synchronized.0.5.8.1\lib\net40\Pechkin.Synchronized.dll 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | ..\packages\Microsoft.AspNet.Razor.3.2.4\lib\net45\System.Web.Razor.dll 76 | 77 | 78 | ..\packages\Microsoft.AspNet.Webpages.3.2.4\lib\net45\System.Web.Webpages.dll 79 | 80 | 81 | ..\packages\Microsoft.AspNet.Webpages.3.2.4\lib\net45\System.Web.Webpages.Deployment.dll 82 | 83 | 84 | ..\packages\Microsoft.AspNet.Webpages.3.2.4\lib\net45\System.Web.Webpages.Razor.dll 85 | 86 | 87 | ..\packages\Microsoft.AspNet.Webpages.3.2.4\lib\net45\System.Web.Helpers.dll 88 | 89 | 90 | ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll 91 | 92 | 93 | ..\packages\Microsoft.AspNet.Mvc.5.2.4\lib\net45\System.Web.Mvc.dll 94 | 95 | 96 | ..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.0\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | Always 108 | 109 | 110 | Always 111 | 112 | 113 | Always 114 | 115 | 116 | 117 | 118 | Always 119 | 120 | 121 | 122 | Always 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | Global.asax 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | Web.config 151 | 152 | 153 | Web.config 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 10.0 162 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | True 172 | True 173 | 53157 174 | / 175 | http://localhost:53157/ 176 | False 177 | False 178 | 179 | 180 | False 181 | 182 | 183 | 184 | 185 | 186 | 187 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 188 | 189 | 190 | 191 | 198 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Models/test.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | 6 | namespace HtmlToPDF_AtServer.Models 7 | { 8 | public class test 9 | { 10 | public int Id { get; set; } 11 | 12 | public string Name { get; set; } 13 | 14 | } 15 | } -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("HtmlToPDF_AtServer")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("HtmlToPDF_AtServer")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9f22402b-d391-45f1-a717-d4ddc0420503")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/SavedPDF/clientPDF_Arslan_14-Feb-2019.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/SavedPDF/clientPDF_Arslan_14-Feb-2019.pdf -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Scripts/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /* NUGET: BEGIN LICENSE TEXT 2 | * 3 | * Microsoft grants you the right to use these script files for the sole 4 | * purpose of either: (i) interacting through your browser with the Microsoft 5 | * website or online service, subject to the applicable licensing or use 6 | * terms; or (ii) using the files as included with a Microsoft product subject 7 | * to that product's license terms. Microsoft reserves all other rights to the 8 | * files not expressly granted by Microsoft, whether by implication, estoppel 9 | * or otherwise. Insofar as a script file is dual licensed under GPL, 10 | * Microsoft neither took the code under GPL nor distributes it thereunder but 11 | * under the terms set out in this paragraph. All notices and licenses 12 | * below are for informational purposes only. 13 | * 14 | * NUGET: END LICENSE TEXT */ 15 | 16 | /** 17 | * bootstrap.js v3.0.0 by @fat and @mdo 18 | * Copyright 2013 Twitter Inc. 19 | * http://www.apache.org/licenses/LICENSE-2.0 20 | */ 21 | if(!jQuery)throw new Error("Bootstrap requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]}}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()})}(window.jQuery),+function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype.close=function(b){function c(){f.trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one(a.support.transition.end,c).emulateTransitionEnd(150):c())};var d=a.fn.alert;a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("bs.alert");e||d.data("bs.alert",e=new c(this)),"string"==typeof b&&e[b].call(d)})},a.fn.alert.Constructor=c,a.fn.alert.noConflict=function(){return a.fn.alert=d,this},a(document).on("click.bs.alert.data-api",b,c.prototype.close)}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d)};b.DEFAULTS={loadingText:"loading..."},b.prototype.setState=function(a){var b="disabled",c=this.$element,d=c.is("input")?"val":"html",e=c.data();a+="Text",e.resetText||c.data("resetText",c[d]()),c[d](e[a]||this.options[a]),setTimeout(function(){"loadingText"==a?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},b.prototype.toggle=function(){var a=this.$element.closest('[data-toggle="buttons"]');if(a.length){var b=this.$element.find("input").prop("checked",!this.$element.hasClass("active")).trigger("change");"radio"===b.prop("type")&&a.find(".active").removeClass("active")}this.$element.toggleClass("active")};var c=a.fn.button;a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof c&&c;e||d.data("bs.button",e=new b(this,f)),"toggle"==c?e.toggle():c&&e.setState(c)})},a.fn.button.Constructor=b,a.fn.button.noConflict=function(){return a.fn.button=c,this},a(document).on("click.bs.button.data-api","[data-toggle^=button]",function(b){var c=a(b.target);c.hasClass("btn")||(c=c.closest(".btn")),c.button("toggle"),b.preventDefault()})}(window.jQuery),+function(a){"use strict";var b=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",a.proxy(this.pause,this)).on("mouseleave",a.proxy(this.cycle,this))};b.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},b.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},b.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},b.prototype.to=function(b){var c=this,d=this.getActiveIndex();return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},b.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition.end&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},b.prototype.next=function(){return this.sliding?void 0:this.slide("next")},b.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},b.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}this.sliding=!0,f&&this.pause();var j=a.Event("slide.bs.carousel",{relatedTarget:e[0],direction:g});if(!e.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var b=a(i.$indicators.children()[i.getActiveIndex()]);b&&b.addClass("active")})),a.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(j),j.isDefaultPrevented())return;e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(j),j.isDefaultPrevented())return;d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return f&&this.cycle(),this}};var c=a.fn.carousel;a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c),g="string"==typeof c?c:f.slide;e||d.data("bs.carousel",e=new b(this,f)),"number"==typeof c?e.to(c):g?e[g]():f.interval&&e.pause().cycle()})},a.fn.carousel.Constructor=b,a.fn.carousel.noConflict=function(){return a.fn.carousel=c,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(b){var c,d=a(this),e=a(d.attr("data-target")||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"")),f=a.extend({},e.data(),d.data()),g=d.attr("data-slide-to");g&&(f.interval=!1),e.carousel(f),(g=d.attr("data-slide-to"))&&e.data("bs.carousel").to(g),b.preventDefault()}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var b=a(this);b.carousel(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.DEFAULTS={toggle:!0},b.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},b.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b=a.Event("show.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.$parent&&this.$parent.find("> .panel > .in");if(c&&c.length){var d=c.data("bs.collapse");if(d&&d.transitioning)return;c.collapse("hide"),d||c.data("bs.collapse",null)}var e=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[e](0),this.transitioning=1;var f=function(){this.$element.removeClass("collapsing").addClass("in")[e]("auto"),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return f.call(this);var g=a.camelCase(["scroll",e].join("-"));this.$element.one(a.support.transition.end,a.proxy(f,this)).emulateTransitionEnd(350)[e](this.$element[0][g])}}},b.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?(this.$element[c](0).one(a.support.transition.end,a.proxy(d,this)).emulateTransitionEnd(350),void 0):d.call(this)}}},b.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var c=a.fn.collapse;a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.collapse",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.collapse.Constructor=b,a.fn.collapse.noConflict=function(){return a.fn.collapse=c,this},a(document).on("click.bs.collapse.data-api","[data-toggle=collapse]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.collapse"),h=g?"toggle":d.data(),i=d.attr("data-parent"),j=i&&a(i);g&&g.transitioning||(j&&j.find('[data-toggle=collapse][data-parent="'+i+'"]').not(d).addClass("collapsed"),d[f.hasClass("in")?"addClass":"removeClass"]("collapsed")),f.collapse(h)})}(window.jQuery),+function(a){"use strict";function b(){a(d).remove(),a(e).each(function(b){var d=c(a(this));d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown")),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown"))})}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}var d=".dropdown-backdrop",e="[data-toggle=dropdown]",f=function(b){a(b).on("click.bs.dropdown",this.toggle)};f.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){if("ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(''}),b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),b.prototype.constructor=b,b.prototype.getDefaults=function(){return b.DEFAULTS},b.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content")[this.options.html?"html":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},b.prototype.hasContent=function(){return this.getTitle()||this.getContent()},b.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},b.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},b.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var c=a.fn.popover;a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof c&&c;e||d.data("bs.popover",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.noConflict=function(){return a.fn.popover=c,this}}(window.jQuery),+function(a){"use strict";function b(c,d){var e,f=a.proxy(this.process,this);this.$element=a(c).is("body")?a(window):a(c),this.$body=a("body"),this.$scrollElement=this.$element.on("scroll.bs.scroll-spy.data-api",f),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||(e=a(c).attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.offsets=a([]),this.targets=a([]),this.activeTarget=null,this.refresh(),this.process()}b.DEFAULTS={offset:10},b.prototype.refresh=function(){var b=this.$element[0]==window?"offset":"position";this.offsets=a([]),this.targets=a([]);var c=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#\w/.test(e)&&a(e);return f&&f.length&&[[f[b]().top+(!a.isWindow(c.$scrollElement.get(0))&&c.$scrollElement.scrollTop()),e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){c.offsets.push(this[0]),c.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,d=c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(b>=d)return g!=(a=f.last()[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parents(".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate")};var c=a.fn.scrollspy;a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=c,this},a(window).on("load",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),+function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.parent("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},b.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one(a.support.transition.end,e).emulateTransitionEnd(150):e(),f.removeClass("in")};var c=a.fn.tab;a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new b(this)),"string"==typeof c&&e[c]()})},a.fn.tab.Constructor=b,a.fn.tab.noConflict=function(){return a.fn.tab=c,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.options=a.extend({},b.DEFAULTS,d),this.$window=a(window).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(c),this.affixed=this.unpin=null,this.checkPosition()};b.RESET="affix affix-top affix-bottom",b.DEFAULTS={offset:0},b.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},b.prototype.checkPosition=function(){if(this.$element.is(":visible")){var c=a(document).height(),d=this.$window.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top()),"function"==typeof h&&(h=f.bottom());var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=c-h?"bottom":null!=g&&g>=d?"top":!1;this.affixed!==i&&(this.unpin&&this.$element.css("top",""),this.affixed=i,this.unpin="bottom"==i?e.top-d:null,this.$element.removeClass(b.RESET).addClass("affix"+(i?"-"+i:"")),"bottom"==i&&this.$element.offset({top:document.body.offsetHeight-h-this.$element.height()}))}};var c=a.fn.affix;a.fn.affix=function(c){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof c&&c;e||d.data("bs.affix",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.affix.Constructor=b,a.fn.affix.noConflict=function(){return a.fn.affix=c,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var b=a(this),c=b.data();c.offset=c.offset||{},c.offsetBottom&&(c.offset.bottom=c.offsetBottom),c.offsetTop&&(c.offset.top=c.offsetTop),b.affix(c)})})}(window.jQuery); -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Scripts/modernizr-2.6.2.js: -------------------------------------------------------------------------------- 1 | /* NUGET: BEGIN LICENSE TEXT 2 | * 3 | * Microsoft grants you the right to use these script files for the sole 4 | * purpose of either: (i) interacting through your browser with the Microsoft 5 | * website or online service, subject to the applicable licensing or use 6 | * terms; or (ii) using the files as included with a Microsoft product subject 7 | * to that product's license terms. Microsoft reserves all other rights to the 8 | * files not expressly granted by Microsoft, whether by implication, estoppel 9 | * or otherwise. Insofar as a script file is dual licensed under GPL, 10 | * Microsoft neither took the code under GPL nor distributes it thereunder but 11 | * under the terms set out in this paragraph. All notices and licenses 12 | * below are for informational purposes only. 13 | * 14 | * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton; http://www.modernizr.com/license/ 15 | * 16 | * Includes matchMedia polyfill; Copyright (c) 2010 Filament Group, Inc; http://opensource.org/licenses/MIT 17 | * 18 | * Includes material adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js; Copyright 2009-2012 by contributors; http://opensource.org/licenses/MIT 19 | * 20 | * Includes material from css-support; Copyright (c) 2005-2012 Diego Perini; https://github.com/dperini/css-support/blob/master/LICENSE 21 | * 22 | * NUGET: END LICENSE TEXT */ 23 | 24 | /*! 25 | * Modernizr v2.6.2 26 | * www.modernizr.com 27 | * 28 | * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton 29 | * Available under the BSD and MIT licenses: www.modernizr.com/license/ 30 | */ 31 | 32 | /* 33 | * Modernizr tests which native CSS3 and HTML5 features are available in 34 | * the current UA and makes the results available to you in two ways: 35 | * as properties on a global Modernizr object, and as classes on the 36 | * element. This information allows you to progressively enhance 37 | * your pages with a granular level of control over the experience. 38 | * 39 | * Modernizr has an optional (not included) conditional resource loader 40 | * called Modernizr.load(), based on Yepnope.js (yepnopejs.com). 41 | * To get a build that includes Modernizr.load(), as well as choosing 42 | * which tests to include, go to www.modernizr.com/download/ 43 | * 44 | * Authors Faruk Ates, Paul Irish, Alex Sexton 45 | * Contributors Ryan Seddon, Ben Alman 46 | */ 47 | 48 | window.Modernizr = (function( window, document, undefined ) { 49 | 50 | var version = '2.6.2', 51 | 52 | Modernizr = {}, 53 | 54 | /*>>cssclasses*/ 55 | // option for enabling the HTML classes to be added 56 | enableClasses = true, 57 | /*>>cssclasses*/ 58 | 59 | docElement = document.documentElement, 60 | 61 | /** 62 | * Create our "modernizr" element that we do most feature tests on. 63 | */ 64 | mod = 'modernizr', 65 | modElem = document.createElement(mod), 66 | mStyle = modElem.style, 67 | 68 | /** 69 | * Create the input element for various Web Forms feature tests. 70 | */ 71 | inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/ , 72 | 73 | /*>>smile*/ 74 | smile = ':)', 75 | /*>>smile*/ 76 | 77 | toString = {}.toString, 78 | 79 | // TODO :: make the prefixes more granular 80 | /*>>prefixes*/ 81 | // List of property values to set for css tests. See ticket #21 82 | prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), 83 | /*>>prefixes*/ 84 | 85 | /*>>domprefixes*/ 86 | // Following spec is to expose vendor-specific style properties as: 87 | // elem.style.WebkitBorderRadius 88 | // and the following would be incorrect: 89 | // elem.style.webkitBorderRadius 90 | 91 | // Webkit ghosts their properties in lowercase but Opera & Moz do not. 92 | // Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+ 93 | // erik.eae.net/archives/2008/03/10/21.48.10/ 94 | 95 | // More here: github.com/Modernizr/Modernizr/issues/issue/21 96 | omPrefixes = 'Webkit Moz O ms', 97 | 98 | cssomPrefixes = omPrefixes.split(' '), 99 | 100 | domPrefixes = omPrefixes.toLowerCase().split(' '), 101 | /*>>domprefixes*/ 102 | 103 | /*>>ns*/ 104 | ns = {'svg': 'http://www.w3.org/2000/svg'}, 105 | /*>>ns*/ 106 | 107 | tests = {}, 108 | inputs = {}, 109 | attrs = {}, 110 | 111 | classes = [], 112 | 113 | slice = classes.slice, 114 | 115 | featureName, // used in testing loop 116 | 117 | 118 | /*>>teststyles*/ 119 | // Inject element with style element and some CSS rules 120 | injectElementWithStyles = function( rule, callback, nodes, testnames ) { 121 | 122 | var style, ret, node, docOverflow, 123 | div = document.createElement('div'), 124 | // After page load injecting a fake body doesn't work so check if body exists 125 | body = document.body, 126 | // IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it. 127 | fakeBody = body || document.createElement('body'); 128 | 129 | if ( parseInt(nodes, 10) ) { 130 | // In order not to give false positives we create a node for each test 131 | // This also allows the method to scale for unspecified uses 132 | while ( nodes-- ) { 133 | node = document.createElement('div'); 134 | node.id = testnames ? testnames[nodes] : mod + (nodes + 1); 135 | div.appendChild(node); 136 | } 137 | } 138 | 139 | // '].join(''); 145 | div.id = mod; 146 | // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody. 147 | // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270 148 | (body ? div : fakeBody).innerHTML += style; 149 | fakeBody.appendChild(div); 150 | if ( !body ) { 151 | //avoid crashing IE8, if background image is used 152 | fakeBody.style.background = ''; 153 | //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible 154 | fakeBody.style.overflow = 'hidden'; 155 | docOverflow = docElement.style.overflow; 156 | docElement.style.overflow = 'hidden'; 157 | docElement.appendChild(fakeBody); 158 | } 159 | 160 | ret = callback(div, rule); 161 | // If this is done after page load we don't want to remove the body so check if body exists 162 | if ( !body ) { 163 | fakeBody.parentNode.removeChild(fakeBody); 164 | docElement.style.overflow = docOverflow; 165 | } else { 166 | div.parentNode.removeChild(div); 167 | } 168 | 169 | return !!ret; 170 | 171 | }, 172 | /*>>teststyles*/ 173 | 174 | /*>>mq*/ 175 | // adapted from matchMedia polyfill 176 | // by Scott Jehl and Paul Irish 177 | // gist.github.com/786768 178 | testMediaQuery = function( mq ) { 179 | 180 | var matchMedia = window.matchMedia || window.msMatchMedia; 181 | if ( matchMedia ) { 182 | return matchMedia(mq).matches; 183 | } 184 | 185 | var bool; 186 | 187 | injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function( node ) { 188 | bool = (window.getComputedStyle ? 189 | getComputedStyle(node, null) : 190 | node.currentStyle)['position'] == 'absolute'; 191 | }); 192 | 193 | return bool; 194 | 195 | }, 196 | /*>>mq*/ 197 | 198 | 199 | /*>>hasevent*/ 200 | // 201 | // isEventSupported determines if a given element supports the given event 202 | // kangax.github.com/iseventsupported/ 203 | // 204 | // The following results are known incorrects: 205 | // Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative 206 | // Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333 207 | // ... 208 | isEventSupported = (function() { 209 | 210 | var TAGNAMES = { 211 | 'select': 'input', 'change': 'input', 212 | 'submit': 'form', 'reset': 'form', 213 | 'error': 'img', 'load': 'img', 'abort': 'img' 214 | }; 215 | 216 | function isEventSupported( eventName, element ) { 217 | 218 | element = element || document.createElement(TAGNAMES[eventName] || 'div'); 219 | eventName = 'on' + eventName; 220 | 221 | // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those 222 | var isSupported = eventName in element; 223 | 224 | if ( !isSupported ) { 225 | // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element 226 | if ( !element.setAttribute ) { 227 | element = document.createElement('div'); 228 | } 229 | if ( element.setAttribute && element.removeAttribute ) { 230 | element.setAttribute(eventName, ''); 231 | isSupported = is(element[eventName], 'function'); 232 | 233 | // If property was created, "remove it" (by setting value to `undefined`) 234 | if ( !is(element[eventName], 'undefined') ) { 235 | element[eventName] = undefined; 236 | } 237 | element.removeAttribute(eventName); 238 | } 239 | } 240 | 241 | element = null; 242 | return isSupported; 243 | } 244 | return isEventSupported; 245 | })(), 246 | /*>>hasevent*/ 247 | 248 | // TODO :: Add flag for hasownprop ? didn't last time 249 | 250 | // hasOwnProperty shim by kangax needed for Safari 2.0 support 251 | _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; 252 | 253 | if ( !is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined') ) { 254 | hasOwnProp = function (object, property) { 255 | return _hasOwnProperty.call(object, property); 256 | }; 257 | } 258 | else { 259 | hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ 260 | return ((property in object) && is(object.constructor.prototype[property], 'undefined')); 261 | }; 262 | } 263 | 264 | // Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js 265 | // es5.github.com/#x15.3.4.5 266 | 267 | if (!Function.prototype.bind) { 268 | Function.prototype.bind = function bind(that) { 269 | 270 | var target = this; 271 | 272 | if (typeof target != "function") { 273 | throw new TypeError(); 274 | } 275 | 276 | var args = slice.call(arguments, 1), 277 | bound = function () { 278 | 279 | if (this instanceof bound) { 280 | 281 | var F = function(){}; 282 | F.prototype = target.prototype; 283 | var self = new F(); 284 | 285 | var result = target.apply( 286 | self, 287 | args.concat(slice.call(arguments)) 288 | ); 289 | if (Object(result) === result) { 290 | return result; 291 | } 292 | return self; 293 | 294 | } else { 295 | 296 | return target.apply( 297 | that, 298 | args.concat(slice.call(arguments)) 299 | ); 300 | 301 | } 302 | 303 | }; 304 | 305 | return bound; 306 | }; 307 | } 308 | 309 | /** 310 | * setCss applies given styles to the Modernizr DOM node. 311 | */ 312 | function setCss( str ) { 313 | mStyle.cssText = str; 314 | } 315 | 316 | /** 317 | * setCssAll extrapolates all vendor-specific css strings. 318 | */ 319 | function setCssAll( str1, str2 ) { 320 | return setCss(prefixes.join(str1 + ';') + ( str2 || '' )); 321 | } 322 | 323 | /** 324 | * is returns a boolean for if typeof obj is exactly type. 325 | */ 326 | function is( obj, type ) { 327 | return typeof obj === type; 328 | } 329 | 330 | /** 331 | * contains returns a boolean for if substr is found within str. 332 | */ 333 | function contains( str, substr ) { 334 | return !!~('' + str).indexOf(substr); 335 | } 336 | 337 | /*>>testprop*/ 338 | 339 | // testProps is a generic CSS / DOM property test. 340 | 341 | // In testing support for a given CSS property, it's legit to test: 342 | // `elem.style[styleName] !== undefined` 343 | // If the property is supported it will return an empty string, 344 | // if unsupported it will return undefined. 345 | 346 | // We'll take advantage of this quick test and skip setting a style 347 | // on our modernizr element, but instead just testing undefined vs 348 | // empty string. 349 | 350 | // Because the testing of the CSS property names (with "-", as 351 | // opposed to the camelCase DOM properties) is non-portable and 352 | // non-standard but works in WebKit and IE (but not Gecko or Opera), 353 | // we explicitly reject properties with dashes so that authors 354 | // developing in WebKit or IE first don't end up with 355 | // browser-specific content by accident. 356 | 357 | function testProps( props, prefixed ) { 358 | for ( var i in props ) { 359 | var prop = props[i]; 360 | if ( !contains(prop, "-") && mStyle[prop] !== undefined ) { 361 | return prefixed == 'pfx' ? prop : true; 362 | } 363 | } 364 | return false; 365 | } 366 | /*>>testprop*/ 367 | 368 | // TODO :: add testDOMProps 369 | /** 370 | * testDOMProps is a generic DOM property test; if a browser supports 371 | * a certain property, it won't return undefined for it. 372 | */ 373 | function testDOMProps( props, obj, elem ) { 374 | for ( var i in props ) { 375 | var item = obj[props[i]]; 376 | if ( item !== undefined) { 377 | 378 | // return the property name as a string 379 | if (elem === false) return props[i]; 380 | 381 | // let's bind a function 382 | if (is(item, 'function')){ 383 | // default to autobind unless override 384 | return item.bind(elem || obj); 385 | } 386 | 387 | // return the unbound function or obj or value 388 | return item; 389 | } 390 | } 391 | return false; 392 | } 393 | 394 | /*>>testallprops*/ 395 | /** 396 | * testPropsAll tests a list of DOM properties we want to check against. 397 | * We specify literally ALL possible (known and/or likely) properties on 398 | * the element including the non-vendor prefixed one, for forward- 399 | * compatibility. 400 | */ 401 | function testPropsAll( prop, prefixed, elem ) { 402 | 403 | var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), 404 | props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); 405 | 406 | // did they call .prefixed('boxSizing') or are we just testing a prop? 407 | if(is(prefixed, "string") || is(prefixed, "undefined")) { 408 | return testProps(props, prefixed); 409 | 410 | // otherwise, they called .prefixed('requestAnimationFrame', window[, elem]) 411 | } else { 412 | props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); 413 | return testDOMProps(props, prefixed, elem); 414 | } 415 | } 416 | /*>>testallprops*/ 417 | 418 | 419 | /** 420 | * Tests 421 | * ----- 422 | */ 423 | 424 | // The *new* flexbox 425 | // dev.w3.org/csswg/css3-flexbox 426 | 427 | tests['flexbox'] = function() { 428 | return testPropsAll('flexWrap'); 429 | }; 430 | 431 | // The *old* flexbox 432 | // www.w3.org/TR/2009/WD-css3-flexbox-20090723/ 433 | 434 | tests['flexboxlegacy'] = function() { 435 | return testPropsAll('boxDirection'); 436 | }; 437 | 438 | // On the S60 and BB Storm, getContext exists, but always returns undefined 439 | // so we actually have to call getContext() to verify 440 | // github.com/Modernizr/Modernizr/issues/issue/97/ 441 | 442 | tests['canvas'] = function() { 443 | var elem = document.createElement('canvas'); 444 | return !!(elem.getContext && elem.getContext('2d')); 445 | }; 446 | 447 | tests['canvastext'] = function() { 448 | return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function')); 449 | }; 450 | 451 | // webk.it/70117 is tracking a legit WebGL feature detect proposal 452 | 453 | // We do a soft detect which may false positive in order to avoid 454 | // an expensive context creation: bugzil.la/732441 455 | 456 | tests['webgl'] = function() { 457 | return !!window.WebGLRenderingContext; 458 | }; 459 | 460 | /* 461 | * The Modernizr.touch test only indicates if the browser supports 462 | * touch events, which does not necessarily reflect a touchscreen 463 | * device, as evidenced by tablets running Windows 7 or, alas, 464 | * the Palm Pre / WebOS (touch) phones. 465 | * 466 | * Additionally, Chrome (desktop) used to lie about its support on this, 467 | * but that has since been rectified: crbug.com/36415 468 | * 469 | * We also test for Firefox 4 Multitouch Support. 470 | * 471 | * For more info, see: modernizr.github.com/Modernizr/touch.html 472 | */ 473 | 474 | tests['touch'] = function() { 475 | var bool; 476 | 477 | if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { 478 | bool = true; 479 | } else { 480 | injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) { 481 | bool = node.offsetTop === 9; 482 | }); 483 | } 484 | 485 | return bool; 486 | }; 487 | 488 | 489 | // geolocation is often considered a trivial feature detect... 490 | // Turns out, it's quite tricky to get right: 491 | // 492 | // Using !!navigator.geolocation does two things we don't want. It: 493 | // 1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513 494 | // 2. Disables page caching in WebKit: webk.it/43956 495 | // 496 | // Meanwhile, in Firefox < 8, an about:config setting could expose 497 | // a false positive that would throw an exception: bugzil.la/688158 498 | 499 | tests['geolocation'] = function() { 500 | return 'geolocation' in navigator; 501 | }; 502 | 503 | 504 | tests['postmessage'] = function() { 505 | return !!window.postMessage; 506 | }; 507 | 508 | 509 | // Chrome incognito mode used to throw an exception when using openDatabase 510 | // It doesn't anymore. 511 | tests['websqldatabase'] = function() { 512 | return !!window.openDatabase; 513 | }; 514 | 515 | // Vendors had inconsistent prefixing with the experimental Indexed DB: 516 | // - Webkit's implementation is accessible through webkitIndexedDB 517 | // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB 518 | // For speed, we don't test the legacy (and beta-only) indexedDB 519 | tests['indexedDB'] = function() { 520 | return !!testPropsAll("indexedDB", window); 521 | }; 522 | 523 | // documentMode logic from YUI to filter out IE8 Compat Mode 524 | // which false positives. 525 | tests['hashchange'] = function() { 526 | return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7); 527 | }; 528 | 529 | // Per 1.6: 530 | // This used to be Modernizr.historymanagement but the longer 531 | // name has been deprecated in favor of a shorter and property-matching one. 532 | // The old API is still available in 1.6, but as of 2.0 will throw a warning, 533 | // and in the first release thereafter disappear entirely. 534 | tests['history'] = function() { 535 | return !!(window.history && history.pushState); 536 | }; 537 | 538 | tests['draganddrop'] = function() { 539 | var div = document.createElement('div'); 540 | return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); 541 | }; 542 | 543 | // FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10 544 | // will be supported until FF19 (2/12/13), at which time, ESR becomes FF17. 545 | // FF10 still uses prefixes, so check for it until then. 546 | // for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/ 547 | tests['websockets'] = function() { 548 | return 'WebSocket' in window || 'MozWebSocket' in window; 549 | }; 550 | 551 | 552 | // css-tricks.com/rgba-browser-support/ 553 | tests['rgba'] = function() { 554 | // Set an rgba() color and check the returned value 555 | 556 | setCss('background-color:rgba(150,255,150,.5)'); 557 | 558 | return contains(mStyle.backgroundColor, 'rgba'); 559 | }; 560 | 561 | tests['hsla'] = function() { 562 | // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally, 563 | // except IE9 who retains it as hsla 564 | 565 | setCss('background-color:hsla(120,40%,100%,.5)'); 566 | 567 | return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); 568 | }; 569 | 570 | tests['multiplebgs'] = function() { 571 | // Setting multiple images AND a color on the background shorthand property 572 | // and then querying the style.background property value for the number of 573 | // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! 574 | 575 | setCss('background:url(https://),url(https://),red url(https://)'); 576 | 577 | // If the UA supports multiple backgrounds, there should be three occurrences 578 | // of the string "url(" in the return value for elemStyle.background 579 | 580 | return (/(url\s*\(.*?){3}/).test(mStyle.background); 581 | }; 582 | 583 | 584 | 585 | // this will false positive in Opera Mini 586 | // github.com/Modernizr/Modernizr/issues/396 587 | 588 | tests['backgroundsize'] = function() { 589 | return testPropsAll('backgroundSize'); 590 | }; 591 | 592 | tests['borderimage'] = function() { 593 | return testPropsAll('borderImage'); 594 | }; 595 | 596 | 597 | // Super comprehensive table about all the unique implementations of 598 | // border-radius: muddledramblings.com/table-of-css3-border-radius-compliance 599 | 600 | tests['borderradius'] = function() { 601 | return testPropsAll('borderRadius'); 602 | }; 603 | 604 | // WebOS unfortunately false positives on this test. 605 | tests['boxshadow'] = function() { 606 | return testPropsAll('boxShadow'); 607 | }; 608 | 609 | // FF3.0 will false positive on this test 610 | tests['textshadow'] = function() { 611 | return document.createElement('div').style.textShadow === ''; 612 | }; 613 | 614 | 615 | tests['opacity'] = function() { 616 | // Browsers that actually have CSS Opacity implemented have done so 617 | // according to spec, which means their return values are within the 618 | // range of [0.0,1.0] - including the leading zero. 619 | 620 | setCssAll('opacity:.55'); 621 | 622 | // The non-literal . in this regex is intentional: 623 | // German Chrome returns this value as 0,55 624 | // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632 625 | return (/^0.55$/).test(mStyle.opacity); 626 | }; 627 | 628 | 629 | // Note, Android < 4 will pass this test, but can only animate 630 | // a single property at a time 631 | // daneden.me/2011/12/putting-up-with-androids-bullshit/ 632 | tests['cssanimations'] = function() { 633 | return testPropsAll('animationName'); 634 | }; 635 | 636 | 637 | tests['csscolumns'] = function() { 638 | return testPropsAll('columnCount'); 639 | }; 640 | 641 | 642 | tests['cssgradients'] = function() { 643 | /** 644 | * For CSS Gradients syntax, please see: 645 | * webkit.org/blog/175/introducing-css-gradients/ 646 | * developer.mozilla.org/en/CSS/-moz-linear-gradient 647 | * developer.mozilla.org/en/CSS/-moz-radial-gradient 648 | * dev.w3.org/csswg/css3-images/#gradients- 649 | */ 650 | 651 | var str1 = 'background-image:', 652 | str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', 653 | str3 = 'linear-gradient(left top,#9f9, white);'; 654 | 655 | setCss( 656 | // legacy webkit syntax (FIXME: remove when syntax not in use anymore) 657 | (str1 + '-webkit- '.split(' ').join(str2 + str1) + 658 | // standard syntax // trailing 'background-image:' 659 | prefixes.join(str3 + str1)).slice(0, -str1.length) 660 | ); 661 | 662 | return contains(mStyle.backgroundImage, 'gradient'); 663 | }; 664 | 665 | 666 | tests['cssreflections'] = function() { 667 | return testPropsAll('boxReflect'); 668 | }; 669 | 670 | 671 | tests['csstransforms'] = function() { 672 | return !!testPropsAll('transform'); 673 | }; 674 | 675 | 676 | tests['csstransforms3d'] = function() { 677 | 678 | var ret = !!testPropsAll('perspective'); 679 | 680 | // Webkit's 3D transforms are passed off to the browser's own graphics renderer. 681 | // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in 682 | // some conditions. As a result, Webkit typically recognizes the syntax but 683 | // will sometimes throw a false positive, thus we must do a more thorough check: 684 | if ( ret && 'webkitPerspective' in docElement.style ) { 685 | 686 | // Webkit allows this media query to succeed only if the feature is enabled. 687 | // `@media (transform-3d),(-webkit-transform-3d){ ... }` 688 | injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function( node, rule ) { 689 | ret = node.offsetLeft === 9 && node.offsetHeight === 3; 690 | }); 691 | } 692 | return ret; 693 | }; 694 | 695 | 696 | tests['csstransitions'] = function() { 697 | return testPropsAll('transition'); 698 | }; 699 | 700 | 701 | /*>>fontface*/ 702 | // @font-face detection routine by Diego Perini 703 | // javascript.nwbox.com/CSSSupport/ 704 | 705 | // false positives: 706 | // WebOS github.com/Modernizr/Modernizr/issues/342 707 | // WP7 github.com/Modernizr/Modernizr/issues/538 708 | tests['fontface'] = function() { 709 | var bool; 710 | 711 | injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function( node, rule ) { 712 | var style = document.getElementById('smodernizr'), 713 | sheet = style.sheet || style.styleSheet, 714 | cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : ''; 715 | 716 | bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0; 717 | }); 718 | 719 | return bool; 720 | }; 721 | /*>>fontface*/ 722 | 723 | // CSS generated content detection 724 | tests['generatedcontent'] = function() { 725 | var bool; 726 | 727 | injectElementWithStyles(['#',mod,'{font:0/0 a}#',mod,':after{content:"',smile,'";visibility:hidden;font:3px/1 a}'].join(''), function( node ) { 728 | bool = node.offsetHeight >= 3; 729 | }); 730 | 731 | return bool; 732 | }; 733 | 734 | 735 | 736 | // These tests evaluate support of the video/audio elements, as well as 737 | // testing what types of content they support. 738 | // 739 | // We're using the Boolean constructor here, so that we can extend the value 740 | // e.g. Modernizr.video // true 741 | // Modernizr.video.ogg // 'probably' 742 | // 743 | // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 744 | // thx to NielsLeenheer and zcorpan 745 | 746 | // Note: in some older browsers, "no" was a return value instead of empty string. 747 | // It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2 748 | // It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5 749 | 750 | tests['video'] = function() { 751 | var elem = document.createElement('video'), 752 | bool = false; 753 | 754 | // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224 755 | try { 756 | if ( bool = !!elem.canPlayType ) { 757 | bool = new Boolean(bool); 758 | bool.ogg = elem.canPlayType('video/ogg; codecs="theora"') .replace(/^no$/,''); 759 | 760 | // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 761 | bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"') .replace(/^no$/,''); 762 | 763 | bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,''); 764 | } 765 | 766 | } catch(e) { } 767 | 768 | return bool; 769 | }; 770 | 771 | tests['audio'] = function() { 772 | var elem = document.createElement('audio'), 773 | bool = false; 774 | 775 | try { 776 | if ( bool = !!elem.canPlayType ) { 777 | bool = new Boolean(bool); 778 | bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,''); 779 | bool.mp3 = elem.canPlayType('audio/mpeg;') .replace(/^no$/,''); 780 | 781 | // Mimetypes accepted: 782 | // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements 783 | // bit.ly/iphoneoscodecs 784 | bool.wav = elem.canPlayType('audio/wav; codecs="1"') .replace(/^no$/,''); 785 | bool.m4a = ( elem.canPlayType('audio/x-m4a;') || 786 | elem.canPlayType('audio/aac;')) .replace(/^no$/,''); 787 | } 788 | } catch(e) { } 789 | 790 | return bool; 791 | }; 792 | 793 | 794 | // In FF4, if disabled, window.localStorage should === null. 795 | 796 | // Normally, we could not test that directly and need to do a 797 | // `('localStorage' in window) && ` test first because otherwise Firefox will 798 | // throw bugzil.la/365772 if cookies are disabled 799 | 800 | // Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem 801 | // will throw the exception: 802 | // QUOTA_EXCEEDED_ERRROR DOM Exception 22. 803 | // Peculiarly, getItem and removeItem calls do not throw. 804 | 805 | // Because we are forced to try/catch this, we'll go aggressive. 806 | 807 | // Just FWIW: IE8 Compat mode supports these features completely: 808 | // www.quirksmode.org/dom/html5.html 809 | // But IE8 doesn't support either with local files 810 | 811 | tests['localstorage'] = function() { 812 | try { 813 | localStorage.setItem(mod, mod); 814 | localStorage.removeItem(mod); 815 | return true; 816 | } catch(e) { 817 | return false; 818 | } 819 | }; 820 | 821 | tests['sessionstorage'] = function() { 822 | try { 823 | sessionStorage.setItem(mod, mod); 824 | sessionStorage.removeItem(mod); 825 | return true; 826 | } catch(e) { 827 | return false; 828 | } 829 | }; 830 | 831 | 832 | tests['webworkers'] = function() { 833 | return !!window.Worker; 834 | }; 835 | 836 | 837 | tests['applicationcache'] = function() { 838 | return !!window.applicationCache; 839 | }; 840 | 841 | 842 | // Thanks to Erik Dahlstrom 843 | tests['svg'] = function() { 844 | return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; 845 | }; 846 | 847 | // specifically for SVG inline in HTML, not within XHTML 848 | // test page: paulirish.com/demo/inline-svg 849 | tests['inlinesvg'] = function() { 850 | var div = document.createElement('div'); 851 | div.innerHTML = ''; 852 | return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; 853 | }; 854 | 855 | // SVG SMIL animation 856 | tests['smil'] = function() { 857 | return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); 858 | }; 859 | 860 | // This test is only for clip paths in SVG proper, not clip paths on HTML content 861 | // demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg 862 | 863 | // However read the comments to dig into applying SVG clippaths to HTML content here: 864 | // github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491 865 | tests['svgclippaths'] = function() { 866 | return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); 867 | }; 868 | 869 | /*>>webforms*/ 870 | // input features and input types go directly onto the ret object, bypassing the tests loop. 871 | // Hold this guy to execute in a moment. 872 | function webforms() { 873 | /*>>input*/ 874 | // Run through HTML5's new input attributes to see if the UA understands any. 875 | // We're using f which is the element created early on 876 | // Mike Taylr has created a comprehensive resource for testing these attributes 877 | // when applied to all input types: 878 | // miketaylr.com/code/input-type-attr.html 879 | // spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary 880 | 881 | // Only input placeholder is tested while textarea's placeholder is not. 882 | // Currently Safari 4 and Opera 11 have support only for the input placeholder 883 | // Both tests are available in feature-detects/forms-placeholder.js 884 | Modernizr['input'] = (function( props ) { 885 | for ( var i = 0, len = props.length; i < len; i++ ) { 886 | attrs[ props[i] ] = !!(props[i] in inputElem); 887 | } 888 | if (attrs.list){ 889 | // safari false positive's on datalist: webk.it/74252 890 | // see also github.com/Modernizr/Modernizr/issues/146 891 | attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement); 892 | } 893 | return attrs; 894 | })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); 895 | /*>>input*/ 896 | 897 | /*>>inputtypes*/ 898 | // Run through HTML5's new input types to see if the UA understands any. 899 | // This is put behind the tests runloop because it doesn't return a 900 | // true/false like all the other tests; instead, it returns an object 901 | // containing each input type with its corresponding true/false value 902 | 903 | // Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/ 904 | Modernizr['inputtypes'] = (function(props) { 905 | 906 | for ( var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++ ) { 907 | 908 | inputElem.setAttribute('type', inputElemType = props[i]); 909 | bool = inputElem.type !== 'text'; 910 | 911 | // We first check to see if the type we give it sticks.. 912 | // If the type does, we feed it a textual value, which shouldn't be valid. 913 | // If the value doesn't stick, we know there's input sanitization which infers a custom UI 914 | if ( bool ) { 915 | 916 | inputElem.value = smile; 917 | inputElem.style.cssText = 'position:absolute;visibility:hidden;'; 918 | 919 | if ( /^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined ) { 920 | 921 | docElement.appendChild(inputElem); 922 | defaultView = document.defaultView; 923 | 924 | // Safari 2-4 allows the smiley as a value, despite making a slider 925 | bool = defaultView.getComputedStyle && 926 | defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && 927 | // Mobile android web browser has false positive, so must 928 | // check the height to see if the widget is actually there. 929 | (inputElem.offsetHeight !== 0); 930 | 931 | docElement.removeChild(inputElem); 932 | 933 | } else if ( /^(search|tel)$/.test(inputElemType) ){ 934 | // Spec doesn't define any special parsing or detectable UI 935 | // behaviors so we pass these through as true 936 | 937 | // Interestingly, opera fails the earlier test, so it doesn't 938 | // even make it here. 939 | 940 | } else if ( /^(url|email)$/.test(inputElemType) ) { 941 | // Real url and email support comes with prebaked validation. 942 | bool = inputElem.checkValidity && inputElem.checkValidity() === false; 943 | 944 | } else { 945 | // If the upgraded input compontent rejects the :) text, we got a winner 946 | bool = inputElem.value != smile; 947 | } 948 | } 949 | 950 | inputs[ props[i] ] = !!bool; 951 | } 952 | return inputs; 953 | })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); 954 | /*>>inputtypes*/ 955 | } 956 | /*>>webforms*/ 957 | 958 | 959 | // End of test definitions 960 | // ----------------------- 961 | 962 | 963 | 964 | // Run through all tests and detect their support in the current UA. 965 | // todo: hypothetically we could be doing an array of tests and use a basic loop here. 966 | for ( var feature in tests ) { 967 | if ( hasOwnProp(tests, feature) ) { 968 | // run the test, throw the return value into the Modernizr, 969 | // then based on that boolean, define an appropriate className 970 | // and push it into an array of classes we'll join later. 971 | featureName = feature.toLowerCase(); 972 | Modernizr[featureName] = tests[feature](); 973 | 974 | classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); 975 | } 976 | } 977 | 978 | /*>>webforms*/ 979 | // input tests need to run. 980 | Modernizr.input || webforms(); 981 | /*>>webforms*/ 982 | 983 | 984 | /** 985 | * addTest allows the user to define their own feature tests 986 | * the result will be added onto the Modernizr object, 987 | * as well as an appropriate className set on the html element 988 | * 989 | * @param feature - String naming the feature 990 | * @param test - Function returning true if feature is supported, false if not 991 | */ 992 | Modernizr.addTest = function ( feature, test ) { 993 | if ( typeof feature == 'object' ) { 994 | for ( var key in feature ) { 995 | if ( hasOwnProp( feature, key ) ) { 996 | Modernizr.addTest( key, feature[ key ] ); 997 | } 998 | } 999 | } else { 1000 | 1001 | feature = feature.toLowerCase(); 1002 | 1003 | if ( Modernizr[feature] !== undefined ) { 1004 | // we're going to quit if you're trying to overwrite an existing test 1005 | // if we were to allow it, we'd do this: 1006 | // var re = new RegExp("\\b(no-)?" + feature + "\\b"); 1007 | // docElement.className = docElement.className.replace( re, '' ); 1008 | // but, no rly, stuff 'em. 1009 | return Modernizr; 1010 | } 1011 | 1012 | test = typeof test == 'function' ? test() : test; 1013 | 1014 | if (typeof enableClasses !== "undefined" && enableClasses) { 1015 | docElement.className += ' ' + (test ? '' : 'no-') + feature; 1016 | } 1017 | Modernizr[feature] = test; 1018 | 1019 | } 1020 | 1021 | return Modernizr; // allow chaining. 1022 | }; 1023 | 1024 | 1025 | // Reset modElem.cssText to nothing to reduce memory footprint. 1026 | setCss(''); 1027 | modElem = inputElem = null; 1028 | 1029 | /*>>shiv*/ 1030 | /*! HTML5 Shiv v3.6.1 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed */ 1031 | ;(function(window, document) { 1032 | /*jshint evil:true */ 1033 | /** Preset options */ 1034 | var options = window.html5 || {}; 1035 | 1036 | /** Used to skip problem elements */ 1037 | var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; 1038 | 1039 | /** Not all elements can be cloned in IE **/ 1040 | var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; 1041 | 1042 | /** Detect whether the browser supports default html5 styles */ 1043 | var supportsHtml5Styles; 1044 | 1045 | /** Name of the expando, to work with multiple documents or to re-shiv one document */ 1046 | var expando = '_html5shiv'; 1047 | 1048 | /** The id for the the documents expando */ 1049 | var expanID = 0; 1050 | 1051 | /** Cached data for each document */ 1052 | var expandoData = {}; 1053 | 1054 | /** Detect whether the browser supports unknown elements */ 1055 | var supportsUnknownElements; 1056 | 1057 | (function() { 1058 | try { 1059 | var a = document.createElement('a'); 1060 | a.innerHTML = ''; 1061 | //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles 1062 | supportsHtml5Styles = ('hidden' in a); 1063 | 1064 | supportsUnknownElements = a.childNodes.length == 1 || (function() { 1065 | // assign a false positive if unable to shiv 1066 | (document.createElement)('a'); 1067 | var frag = document.createDocumentFragment(); 1068 | return ( 1069 | typeof frag.cloneNode == 'undefined' || 1070 | typeof frag.createDocumentFragment == 'undefined' || 1071 | typeof frag.createElement == 'undefined' 1072 | ); 1073 | }()); 1074 | } catch(e) { 1075 | supportsHtml5Styles = true; 1076 | supportsUnknownElements = true; 1077 | } 1078 | 1079 | }()); 1080 | 1081 | /*--------------------------------------------------------------------------*/ 1082 | 1083 | /** 1084 | * Creates a style sheet with the given CSS text and adds it to the document. 1085 | * @private 1086 | * @param {Document} ownerDocument The document. 1087 | * @param {String} cssText The CSS text. 1088 | * @returns {StyleSheet} The style element. 1089 | */ 1090 | function addStyleSheet(ownerDocument, cssText) { 1091 | var p = ownerDocument.createElement('p'), 1092 | parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; 1093 | 1094 | p.innerHTML = 'x'; 1095 | return parent.insertBefore(p.lastChild, parent.firstChild); 1096 | } 1097 | 1098 | /** 1099 | * Returns the value of `html5.elements` as an array. 1100 | * @private 1101 | * @returns {Array} An array of shived element node names. 1102 | */ 1103 | function getElements() { 1104 | var elements = html5.elements; 1105 | return typeof elements == 'string' ? elements.split(' ') : elements; 1106 | } 1107 | 1108 | /** 1109 | * Returns the data associated to the given document 1110 | * @private 1111 | * @param {Document} ownerDocument The document. 1112 | * @returns {Object} An object of data. 1113 | */ 1114 | function getExpandoData(ownerDocument) { 1115 | var data = expandoData[ownerDocument[expando]]; 1116 | if (!data) { 1117 | data = {}; 1118 | expanID++; 1119 | ownerDocument[expando] = expanID; 1120 | expandoData[expanID] = data; 1121 | } 1122 | return data; 1123 | } 1124 | 1125 | /** 1126 | * returns a shived element for the given nodeName and document 1127 | * @memberOf html5 1128 | * @param {String} nodeName name of the element 1129 | * @param {Document} ownerDocument The context document. 1130 | * @returns {Object} The shived element. 1131 | */ 1132 | function createElement(nodeName, ownerDocument, data){ 1133 | if (!ownerDocument) { 1134 | ownerDocument = document; 1135 | } 1136 | if(supportsUnknownElements){ 1137 | return ownerDocument.createElement(nodeName); 1138 | } 1139 | if (!data) { 1140 | data = getExpandoData(ownerDocument); 1141 | } 1142 | var node; 1143 | 1144 | if (data.cache[nodeName]) { 1145 | node = data.cache[nodeName].cloneNode(); 1146 | } else if (saveClones.test(nodeName)) { 1147 | node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); 1148 | } else { 1149 | node = data.createElem(nodeName); 1150 | } 1151 | 1152 | // Avoid adding some elements to fragments in IE < 9 because 1153 | // * Attributes like `name` or `type` cannot be set/changed once an element 1154 | // is inserted into a document/fragment 1155 | // * Link elements with `src` attributes that are inaccessible, as with 1156 | // a 403 response, will cause the tab/window to crash 1157 | // * Script elements appended to fragments will execute when their `src` 1158 | // or `text` property is set 1159 | return node.canHaveChildren && !reSkip.test(nodeName) ? data.frag.appendChild(node) : node; 1160 | } 1161 | 1162 | /** 1163 | * returns a shived DocumentFragment for the given document 1164 | * @memberOf html5 1165 | * @param {Document} ownerDocument The context document. 1166 | * @returns {Object} The shived DocumentFragment. 1167 | */ 1168 | function createDocumentFragment(ownerDocument, data){ 1169 | if (!ownerDocument) { 1170 | ownerDocument = document; 1171 | } 1172 | if(supportsUnknownElements){ 1173 | return ownerDocument.createDocumentFragment(); 1174 | } 1175 | data = data || getExpandoData(ownerDocument); 1176 | var clone = data.frag.cloneNode(), 1177 | i = 0, 1178 | elems = getElements(), 1179 | l = elems.length; 1180 | for(;i>shiv*/ 1319 | 1320 | // Assign private properties to the return object with prefix 1321 | Modernizr._version = version; 1322 | 1323 | // expose these for the plugin API. Look in the source for how to join() them against your input 1324 | /*>>prefixes*/ 1325 | Modernizr._prefixes = prefixes; 1326 | /*>>prefixes*/ 1327 | /*>>domprefixes*/ 1328 | Modernizr._domPrefixes = domPrefixes; 1329 | Modernizr._cssomPrefixes = cssomPrefixes; 1330 | /*>>domprefixes*/ 1331 | 1332 | /*>>mq*/ 1333 | // Modernizr.mq tests a given media query, live against the current state of the window 1334 | // A few important notes: 1335 | // * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false 1336 | // * A max-width or orientation query will be evaluated against the current state, which may change later. 1337 | // * You must specify values. Eg. If you are testing support for the min-width media query use: 1338 | // Modernizr.mq('(min-width:0)') 1339 | // usage: 1340 | // Modernizr.mq('only screen and (max-width:768)') 1341 | Modernizr.mq = testMediaQuery; 1342 | /*>>mq*/ 1343 | 1344 | /*>>hasevent*/ 1345 | // Modernizr.hasEvent() detects support for a given event, with an optional element to test on 1346 | // Modernizr.hasEvent('gesturestart', elem) 1347 | Modernizr.hasEvent = isEventSupported; 1348 | /*>>hasevent*/ 1349 | 1350 | /*>>testprop*/ 1351 | // Modernizr.testProp() investigates whether a given style property is recognized 1352 | // Note that the property names must be provided in the camelCase variant. 1353 | // Modernizr.testProp('pointerEvents') 1354 | Modernizr.testProp = function(prop){ 1355 | return testProps([prop]); 1356 | }; 1357 | /*>>testprop*/ 1358 | 1359 | /*>>testallprops*/ 1360 | // Modernizr.testAllProps() investigates whether a given style property, 1361 | // or any of its vendor-prefixed variants, is recognized 1362 | // Note that the property names must be provided in the camelCase variant. 1363 | // Modernizr.testAllProps('boxSizing') 1364 | Modernizr.testAllProps = testPropsAll; 1365 | /*>>testallprops*/ 1366 | 1367 | 1368 | /*>>teststyles*/ 1369 | // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards 1370 | // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... }) 1371 | Modernizr.testStyles = injectElementWithStyles; 1372 | /*>>teststyles*/ 1373 | 1374 | 1375 | /*>>prefixed*/ 1376 | // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input 1377 | // Modernizr.prefixed('boxSizing') // 'MozBoxSizing' 1378 | 1379 | // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style. 1380 | // Return values will also be the camelCase variant, if you need to translate that to hypenated style use: 1381 | // 1382 | // str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-'); 1383 | 1384 | // If you're trying to ascertain which transition end event to bind to, you might do something like... 1385 | // 1386 | // var transEndEventNames = { 1387 | // 'WebkitTransition' : 'webkitTransitionEnd', 1388 | // 'MozTransition' : 'transitionend', 1389 | // 'OTransition' : 'oTransitionEnd', 1390 | // 'msTransition' : 'MSTransitionEnd', 1391 | // 'transition' : 'transitionend' 1392 | // }, 1393 | // transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; 1394 | 1395 | Modernizr.prefixed = function(prop, obj, elem){ 1396 | if(!obj) { 1397 | return testPropsAll(prop, 'pfx'); 1398 | } else { 1399 | // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame' 1400 | return testPropsAll(prop, obj, elem); 1401 | } 1402 | }; 1403 | /*>>prefixed*/ 1404 | 1405 | 1406 | /*>>cssclasses*/ 1407 | // Remove "no-js" class from element, if it exists: 1408 | docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') + 1409 | 1410 | // Add the new classes to the element. 1411 | (enableClasses ? ' js ' + classes.join(' ') : ''); 1412 | /*>>cssclasses*/ 1413 | 1414 | return Modernizr; 1415 | 1416 | })(this, this.document); 1417 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model HtmlToPDF_AtServer.Models.test 2 | 3 | @{ 4 | ViewBag.Title = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |
10 | Click To Save PDF 11 |
12 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewBag.Title - My ASP.NET Application 7 | 8 | 9 | 10 | 11 | 12 | 28 | 29 |
30 | @RenderBody() 31 |
32 |
33 |

© @DateTime.Now.Year - My ASP.NET Application

34 |
35 |
36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Views/Shared/sample.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Sample Page 6 | 7 | 8 |
9 |
10 |

{NAME}

11 |
12 |

{ID}

13 |
14 |
15 | 16 |
17 |
18 |

Thanks FOr Using

19 | 20 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Views/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 |
7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Web.Debug.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Web.Release.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18 | 19 | 30 | 31 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/Web.config: -------------------------------------------------------------------------------- 1 |  2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 38 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/fonts/glyphicons-halflings-regular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 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 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/libeay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/libeay32.dll -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/libgcc_s_dw2-1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/libgcc_s_dw2-1.dll -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/mingwm10.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/mingwm10.dll -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/ssleay32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/ssleay32.dll -------------------------------------------------------------------------------- /HtmlToPDF-AtServer/wkhtmltox0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/HtmlToPDF-AtServer/wkhtmltox0.dll -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CSharpModule-HtmlToPDF-AtServer 👏 2 | 3 | ## Saving HTML to PDF on server Folder with conversion of Images to Base64 and with Dynamic Data, using PECHKIN Library. 4 | 5 | Thanks To [PECHKIN](https://github.com/gmanny/Pechkin) Library. Install [Pechkin.Sychronized](https://www.nuget.org/packages/Pechkin.Synchronized/) from nuGet & Save your HTML to PDF. 6 | 7 | 📑💫💻 8 | 9 | ## "Proper Comments for Understanding & Readable Easy Code! "Written Separately!" 🤟🤟🤟 10 | 11 | --- 12 | 13 | ## Demo in Motion **(Saving PDF to Server Folder)**: 😉 14 | 15 | ![](htmlToPdfdemo.gif) 16 | 17 | --- 18 | 19 | ## 📄 License 🔐 20 | 21 | CSharpModule-HtmlToPDF-AtServer (Saving HTML to PDF on server Folder) 22 | Copyright (C) 2019 - Arslan Ameer 23 | 24 | This program is free software: you can redistribute it and/or modify 25 | it under the terms of the GNU General Public License as published by 26 | the Free Software Foundation, either version 3 of the License, or 27 | (at your option) any later version. 28 | 29 | This program is distributed in the hope that it will be useful, 30 | but WITHOUT ANY WARRANTY; without even the implied warranty of 31 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 32 | GNU General Public License for more details. 33 | 34 | You should have received a copy of the GNU General Public License 35 | along with this program. If not, see 36 | -------------------------------------------------------------------------------- /htmlToPdfdemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ArslanAmeer/CSharp-Module-HtmlToPDF-AtServer/3d07815c5fc23de99e5371a130dfc41e957a36d4/htmlToPdfdemo.gif --------------------------------------------------------------------------------