diff --git a/TuesPechkin.TestFormsApp/TuesPechkin.TestFormsApp.csproj b/TuesPechkin.TestFormsApp/TuesPechkin.TestFormsApp.csproj
index 2f1b4f2..c8d8014 100644
--- a/TuesPechkin.TestFormsApp/TuesPechkin.TestFormsApp.csproj
+++ b/TuesPechkin.TestFormsApp/TuesPechkin.TestFormsApp.csproj
@@ -15,27 +15,6 @@
512
-
- x86
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- false
-
-
- x86
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
- false
-
true
bin\x64\Debug\
@@ -56,26 +35,6 @@
MinimumRecommendedRules.ruleset
false
-
- true
- bin\Debug\
- DEBUG;TRACE
- full
- AnyCPU
- prompt
- MinimumRecommendedRules.ruleset
- false
-
-
- bin\Release\
- TRACE
- true
- pdbonly
- AnyCPU
- prompt
- MinimumRecommendedRules.ruleset
- false
-
diff --git a/TuesPechkin.TestWebApp/Controllers/HomeController.cs b/TuesPechkin.TestWebApp/Controllers/HomeController.cs
index 25ff916..12d6962 100644
--- a/TuesPechkin.TestWebApp/Controllers/HomeController.cs
+++ b/TuesPechkin.TestWebApp/Controllers/HomeController.cs
@@ -9,18 +9,20 @@ public class HomeController : Controller
{
private static IConverter converter =
new ThreadSafeConverter(
- new PdfToolset(
- new Win64EmbeddedDeployment(
+ new RemotingToolset(
+ new Win32EmbeddedDeployment(
new StaticDeployment(
- Path.Combine(Path.GetTempPath(), "wkhtmltox.dll")))));
+ Path.Combine(
+ Path.GetTempPath(),
+ Guid.NewGuid().ToString(),
+ "wkhtmltox.dll")))));
- //
// GET: /Home/
public ActionResult Index()
{
- var html = "Just some test HTML
";
- var doc = new HtmlToPdfDocument(html);
-
+ var doc = new HtmlToPdfDocument();
+ doc.Objects.Add(new ObjectSettings { PageUrl = "www.google.com " });
+
for (var i = 0; i < 5; i++)
{
var result = converter.Convert(doc);
diff --git a/TuesPechkin.TestWebApp/TuesPechkin.TestWebApp.csproj b/TuesPechkin.TestWebApp/TuesPechkin.TestWebApp.csproj
index 4cd6ca3..b4ef627 100644
--- a/TuesPechkin.TestWebApp/TuesPechkin.TestWebApp.csproj
+++ b/TuesPechkin.TestWebApp/TuesPechkin.TestWebApp.csproj
@@ -24,26 +24,6 @@
true
-
- true
- full
- false
- bin\
- DEBUG;TRACE
- prompt
- 4
- false
-
-
- full
- true
- bin\
- TRACE
- prompt
- 4
- false
- true
-
@@ -236,9 +216,9 @@
-
- {f77cffca-1cf0-49c8-98b6-5c6009c6be63}
- TuesPechkin.Wkhtmltox.Win64
+
+ {1bcd70ef-32ef-4339-9ccf-ea07415a39a9}
+ TuesPechkin.Wkhtmltox.Win32
{023df833-b252-48b3-b6af-dbbb13e39b13}
@@ -249,6 +229,25 @@
10.0
$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+ true
+ bin\
+ DEBUG;TRACE
+ full
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+
+
+ true
+ bin\
+ TRACE
+ true
+ full
+ x86
+ prompt
+ MinimumRecommendedRules.ruleset
+
diff --git a/TuesPechkin.Tests/GeneralTests.cs b/TuesPechkin.Tests/GeneralTests.cs
index fbcb0ef..60a05d5 100644
--- a/TuesPechkin.Tests/GeneralTests.cs
+++ b/TuesPechkin.Tests/GeneralTests.cs
@@ -45,7 +45,13 @@ public void ConvertsAfterAppDomainRecycles()
new RemotingToolset(
new StaticDeployment(dllPath)));
- var document = new HtmlToPdfDocument("some html
");
+ var document = new HtmlToPdfDocument
+ {
+ Objects =
+ {
+ new ObjectSettings { PageUrl = "www.google.com" }
+ }
+ };
AppDomain.CurrentDomain.SetData("result", converter.Convert(document));
};
diff --git a/TuesPechkin.Tests/TuesPechkin.Tests.csproj b/TuesPechkin.Tests/TuesPechkin.Tests.csproj
index 0c801cd..6d5ed59 100644
--- a/TuesPechkin.Tests/TuesPechkin.Tests.csproj
+++ b/TuesPechkin.Tests/TuesPechkin.Tests.csproj
@@ -41,46 +41,6 @@
-
- true
- bin\x64\Debug\
- DEBUG;TRACE
- full
- x64
- prompt
- MinimumRecommendedRules.ruleset
- false
-
-
- bin\x64\Release\
- TRACE
- true
- pdbonly
- x64
- prompt
- MinimumRecommendedRules.ruleset
- false
-
-
- true
- bin\Debug\
- DEBUG;TRACE
- full
- AnyCPU
- prompt
- MinimumRecommendedRules.ruleset
- false
-
-
- bin\Release\
- TRACE
- true
- pdbonly
- AnyCPU
- prompt
- MinimumRecommendedRules.ruleset
- false
-
diff --git a/TuesPechkin.Tests/TuesPechkinTests.cs b/TuesPechkin.Tests/TuesPechkinTests.cs
index e24b9b3..b704125 100644
--- a/TuesPechkin.Tests/TuesPechkinTests.cs
+++ b/TuesPechkin.Tests/TuesPechkinTests.cs
@@ -35,7 +35,7 @@ static TuesPechkinTests()
[TestCleanup]
public void TestCleanup()
{
- converter.Invoke(() => toolset.Unload());
+ toolset.Unload();
}
protected AppDomain GetAppDomain(string name)
diff --git a/TuesPechkin.sln b/TuesPechkin.sln
index 4423dad..bb2bc57 100644
--- a/TuesPechkin.sln
+++ b/TuesPechkin.sln
@@ -34,18 +34,15 @@ Global
{023DF833-B252-48B3-B6AF-DBBB13E39B13}.Debug|Any CPU.Build.0 = Debug|Any CPU
{023DF833-B252-48B3-B6AF-DBBB13E39B13}.Release|Any CPU.ActiveCfg = Release|Any CPU
{023DF833-B252-48B3-B6AF-DBBB13E39B13}.Release|Any CPU.Build.0 = Release|Any CPU
- {35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Release|Any CPU.Build.0 = Release|Any CPU
- {D58769FA-E008-4016-A81C-A85C606B3691}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D58769FA-E008-4016-A81C-A85C606B3691}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D58769FA-E008-4016-A81C-A85C606B3691}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D58769FA-E008-4016-A81C-A85C606B3691}.Release|Any CPU.Build.0 = Release|Any CPU
- {B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Release|Any CPU.ActiveCfg = Release|x64
+ {35E72E2C-DE58-4ED7-9B47-5EF13860AF42}.Release|Any CPU.Build.0 = Release|x64
+ {D58769FA-E008-4016-A81C-A85C606B3691}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {D58769FA-E008-4016-A81C-A85C606B3691}.Release|Any CPU.ActiveCfg = Release|x86
+ {D58769FA-E008-4016-A81C-A85C606B3691}.Release|Any CPU.Build.0 = Release|x86
+ {B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Debug|Any CPU.ActiveCfg = Debug|x86
+ {B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Release|Any CPU.ActiveCfg = Release|x86
+ {B12D40DF-C865-4116-9C42-0EEDCF9FB19A}.Release|Any CPU.Build.0 = Release|x86
{1BCD70EF-32EF-4339-9CCF-EA07415A39A9}.Debug|Any CPU.ActiveCfg = Debug|x86
{1BCD70EF-32EF-4339-9CCF-EA07415A39A9}.Debug|Any CPU.Build.0 = Debug|x86
{1BCD70EF-32EF-4339-9CCF-EA07415A39A9}.Release|Any CPU.ActiveCfg = Release|x86
diff --git a/TuesPechkin/NestingToolset.cs b/TuesPechkin/NestingToolset.cs
index f63568f..01549af 100644
--- a/TuesPechkin/NestingToolset.cs
+++ b/TuesPechkin/NestingToolset.cs
@@ -9,6 +9,8 @@ public abstract class NestingToolset : MarshalByRefObject, IToolset
{
public abstract event EventHandler Unloaded;
+ internal event EventHandler BeforeUnload;
+
public IDeployment Deployment { get; protected set; }
public bool Loaded { get; protected set; }
@@ -24,6 +26,14 @@ public override object InitializeLifetimeService()
return null;
}
+ internal void OnBeforeUnload(object sender)
+ {
+ if (BeforeUnload != null)
+ {
+ BeforeUnload(sender, EventArgs.Empty);
+ }
+ }
+
public void AddObject(IntPtr converter, IntPtr objectConfig, byte[] html)
{
NestedToolset.AddObject(converter, objectConfig, html);
diff --git a/TuesPechkin/Properties/AssemblyInfo.cs b/TuesPechkin/Properties/AssemblyInfo.cs
index e11649d..fd3ad6c 100644
--- a/TuesPechkin/Properties/AssemblyInfo.cs
+++ b/TuesPechkin/Properties/AssemblyInfo.cs
@@ -2,35 +2,11 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
[assembly: AssemblyTitle("TuesPechkin")]
[assembly: AssemblyDescription(".NET wrapper for wkhtmltopdf; supports 32-bit, 64-bit, multi-threaded and IIS environments.")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TuesPechkin")]
[assembly: AssemblyCopyright("Copyright 2014 Derek Gray")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
+[assembly: AssemblyVersion("2.0.1")]
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("11f63696-7105-436d-9ec6-2fee54c40b11")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("2.0.0")]
-[assembly: AssemblyFileVersion("2.0.0")]
diff --git a/TuesPechkin/RemotingToolset.cs b/TuesPechkin/RemotingToolset.cs
index 2240ade..e207c61 100644
--- a/TuesPechkin/RemotingToolset.cs
+++ b/TuesPechkin/RemotingToolset.cs
@@ -62,14 +62,7 @@ public override void Unload()
{
if (Loaded)
{
- NestedToolset.Unload();
-
TearDownAppDomain(null, EventArgs.Empty);
-
- if (Unloaded != null)
- {
- Unloaded(this, EventArgs.Empty);
- }
}
}
@@ -99,6 +92,8 @@ private void TearDownAppDomain(object sender, EventArgs e)
return;
}
+ OnBeforeUnload((ActionShim)(() => NestedToolset.Unload()));
+
AppDomain.Unload(remoteDomain);
var expected = Path.Combine(
diff --git a/TuesPechkin/ThreadSafeConverter.cs b/TuesPechkin/ThreadSafeConverter.cs
index a9c33cf..5435cf9 100644
--- a/TuesPechkin/ThreadSafeConverter.cs
+++ b/TuesPechkin/ThreadSafeConverter.cs
@@ -15,6 +15,14 @@ public ThreadSafeConverter(IToolset toolset)
{
new Thread(() => StopThread()).Start();
};
+
+ if (toolset is NestingToolset)
+ {
+ (toolset as NestingToolset).BeforeUnload += (sender, args) =>
+ {
+ Invoke(sender as ActionShim);
+ };
+ }
}
public override byte[] Convert(IDocument document)
diff --git a/TuesPechkin/TuesPechkin.csproj b/TuesPechkin/TuesPechkin.csproj
index 667905e..9f4fefb 100644
--- a/TuesPechkin/TuesPechkin.csproj
+++ b/TuesPechkin/TuesPechkin.csproj
@@ -16,56 +16,6 @@
true
-
- true
- bin\Debug\
- DEBUG;TRACE
- true
- full
- x86
- bin\Debug\Pechkin.dll.CodeAnalysisLog.xml
- true
- GlobalSuppressions.cs
- prompt
- MinimumRecommendedRules.ruleset
- ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
- ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
-
-
- bin\Release\
- TRACE
- true
- true
- pdbonly
- x86
- bin\Release\Pechkin.dll.CodeAnalysisLog.xml
- true
- GlobalSuppressions.cs
- prompt
- MinimumRecommendedRules.ruleset
- ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets
- ;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules
-
-
- true
- bin\x64\Debug\
- DEBUG;TRACE
- true
- full
- x64
- prompt
- MinimumRecommendedRules.ruleset
-
-
- bin\x64\Release\
- TRACE
- true
- true
- pdbonly
- x64
- prompt
- MinimumRecommendedRules.ruleset
-
true
bin\Debug\
diff --git a/TuesPechkin/TuesPechkin.nuspec b/TuesPechkin/TuesPechkin.nuspec
new file mode 100644
index 0000000..c2aa977
--- /dev/null
+++ b/TuesPechkin/TuesPechkin.nuspec
@@ -0,0 +1,15 @@
+
+
+
+ TuesPechkin
+ 2.0.1
+ TuesPechkin
+ tuespetre
+ tuespetre
+ https://github.com/tuespetre/TuesPechkin
+ false
+ A .NET wrapper for wkhtmltopdf. Supports .NET 2.0 and up, 32-bit, 64-bit, multithreading, and IIS environments.
+ Copyright 2015
+ wkhtmltopdf html pdf
+
+
\ No newline at end of file