Skip to content

Commit

Permalink
- Experimental PDF/A & PDF/X support
Browse files Browse the repository at this point in the history
- Much less memory consumption
  • Loading branch information
simonegli committed Aug 11, 2014
1 parent a7b0ace commit bf845b3
Show file tree
Hide file tree
Showing 44 changed files with 559 additions and 309 deletions.
4 changes: 2 additions & 2 deletions XamlImageConverter.Awesomium/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("3.11.0.0")]
[assembly: AssemblyFileVersion("3.11.0.0")]
[assembly: AssemblyVersion("3.12.0.0")]
[assembly: AssemblyFileVersion("3.12.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<AssemblyName>html2pdf</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -94,6 +95,7 @@
<Content Include="Lazy\Awesomium\inspector.pak" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="sgKey.snk" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Expand Down
2 changes: 1 addition & 1 deletion XamlImageConverter.Exe/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class Program {
}

if (a.Count == 0 || new[] { "-h", "help", "-help", "?", "/?", "-?" }.Any(s => a.Any(at => s == at.Trim().ToLower()))) {
Console.WriteLine("XamlImageConverter 3.11 by Chris Cavanagh & David Egli");
Console.WriteLine("XamlImageConverter 3.12 by Chris Cavanagh & David Egli");
Console.WriteLine("Creates snapshots, gif animations or html image maps from XAML, SVG & PSD images\n\r");
Console.Error.WriteLine("XamlImageConverter [-x] [-w] [-1] [-s [running time]] [-r] [-v]");
Console.Error.WriteLine(" [-l librarypath] [-p projectpath] configFile { configFile }");
Expand Down
4 changes: 2 additions & 2 deletions XamlImageConverter.Exe/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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( "3.11.0.0" )]
[assembly: AssemblyFileVersion( "3.11.0.0" )]
[assembly: AssemblyVersion( "3.12.0.0" )]
[assembly: AssemblyFileVersion( "3.12.0.0" )]
2 changes: 1 addition & 1 deletion XamlImageConverter.Exe/XamlImageConverter.Exe.csproj.user
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<StartArguments>-w -v -l "D:\Code\Visitenkarte\Simon Egli\bin\Debug" -p "D:\Code\Visitenkarte\Simon Egli" "D:\Code\Visitenkarte\Simon Egli\CreateLogos.xic.xaml"</StartArguments>
</PropertyGroup>
<PropertyGroup>
<ProjectView>ProjectFiles</ProjectView>
<ProjectView>ShowAllFiles</ProjectView>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<StartArguments>-p "D:\Code\Visitenkarte\Simon Egli" -l "D:\Code\Visitenkarte\Simon Egli\bin\Debug" -w -f ~/CreateLogos.xic.xaml</StartArguments>
Expand Down
16 changes: 8 additions & 8 deletions XamlImageConverter.ItemWizard/ItemWizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public class ItemWizard: IWizard {
if (configSections == null) webconfig.AddFirst(configSections = new XElement("configSections"));

//configSections.Elements().Where(x => ((string)x.Attribute("type") ?? "").Contains("PublicKeyToken=60c2ec984bc1bb45")).Remove();
configSections.Add(XElement.Parse("<section name='XamlImageConverter' type='XamlImageConverter.Configuration, XamlImageConverters.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"));
configSections.Add(XElement.Parse("<section name='XamlImageConverter' type='XamlImageConverter.Configuration, XamlImageConverters.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"));
// XamlImageConverter section
if (webconfig.Element("XamlImageConverter") == null) configSections.AddAfterSelf(XElement.Parse("<XamlImageConverter Log='true' Cache='~/Images/Cache' />"));
}
Expand All @@ -336,11 +336,11 @@ public class ItemWizard: IWizard {
var handlers = server.Element("handlers");
if (handlers == null) server.Add(handlers = new XElement("handlers"));
handlers.Elements().Where(x => ((string)x.Attribute("type") ?? "").Contains("PublicKeyToken=60c2ec984bc1bb45")).Remove();
handlers.Add(XElement.Parse("<add name='XamlImageConverter.Xaml' verb='*' path='*.xaml' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"),
XElement.Parse("<add name='XamlImageConverter.Svg' verb='*' path='*.svg' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"),
XElement.Parse("<add name='XamlImageConverter.Svgz' verb='*' path='*.svgz' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"),
XElement.Parse("<add name='XamlImageConverter.Psd' verb='*' path='*.psd' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"),
XElement.Parse("<add name='XamlImageConverter.Dynamic' verb='*' path='xic.axd' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"));
handlers.Add(XElement.Parse("<add name='XamlImageConverter.Xaml' verb='*' path='*.xaml' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"),
XElement.Parse("<add name='XamlImageConverter.Svg' verb='*' path='*.svg' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"),
XElement.Parse("<add name='XamlImageConverter.Svgz' verb='*' path='*.svgz' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"),
XElement.Parse("<add name='XamlImageConverter.Psd' verb='*' path='*.psd' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"),
XElement.Parse("<add name='XamlImageConverter.Dynamic' verb='*' path='xic.axd' preCondition='integratedMode' type='XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"));

// system.web
var web = webconfig.Element("system.web");
Expand All @@ -352,15 +352,15 @@ public class ItemWizard: IWizard {
var assemblies = comp.Element("assemblies");
if (assemblies == null) comp.Add(assemblies = new XElement("assemblies"));
assemblies.Elements().Where(x => ((string)x.Attribute("assembly") ?? "").Contains("PublicKeyToken=60c2ec984bc1bb45")).Remove();
assemblies.Add(XElement.Parse("<add assembly='XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45'/>"));
assemblies.Add(XElement.Parse("<add assembly='XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45'/>"));

// pages
var pages = web.Element("pages");
if (pages == null) comp.AddAfterSelf(pages = new XElement("pages"));
var controls = pages.Element("controls");
if (controls == null) pages.Add(controls = new XElement("controls"));
controls.Elements().Where(x => ((string)x.Attribute("assembly") ?? "").Contains("PublicKeyToken=60c2ec984bc1bb45")).Remove();
controls.Add(XElement.Parse("<add tagPrefix='xic' namespace='XamlImageConverter.Web.UI' assembly='XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"));
controls.Add(XElement.Parse("<add tagPrefix='xic' namespace='XamlImageConverter.Web.UI' assembly='XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45' />"));

/*
// httpHandlers
Expand Down
4 changes: 2 additions & 2 deletions XamlImageConverter.ItemWizard/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("3.11.0.0")]
[assembly: AssemblyFileVersion("3.11.0.0")]
[assembly: AssemblyVersion("3.12.0.0")]
[assembly: AssemblyFileVersion("3.12.0.0")]
82 changes: 41 additions & 41 deletions XamlImageConverter.Test.Web/Web.config
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="XamlImageConverter" type="XamlImageConverter.Configuration, XamlImageConverter, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
<section name="XamlImageConverter" type="XamlImageConverter.Configuration, XamlImageConverter, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
</configSections>
<XamlImageConverter log="true" cache="~/Images/Cache" separateDomain="false"/>
<appSettings/>
<connectionStrings/>
<!--
For a description of web.config changes for .NET 4.5 see http:https://go.microsoft.com/fwlink/?LinkId=235367.
For a description of web.config changes for .NET 4.5 see http:https://go.microsoft.com/fwlink/?LinkId=235367.
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5" />
</system.Web>
The following attributes can be set on the <httpRuntime> tag.
<system.Web>
<httpRuntime targetFramework="4.5" />
</system.Web>
-->
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="4.0">
<controls>
<add tagPrefix="xic" namespace="XamlImageConverter.Web.UI" assembly="XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
</controls>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<customErrors mode="Off"/>
<httpRuntime requestValidationMode="2.0" />
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="4.0">
<controls>
<add tagPrefix="xic" namespace="XamlImageConverter.Web.UI" assembly="XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
</controls>
</pages>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<customErrors mode="Off"/>
<httpRuntime requestValidationMode="2.0"/>
</system.web>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
The system.webServer section is required for running ASP.NET AJAX under Internet
Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
<handlers>
<add name="XamlImageConverterXaml" verb="*" path="*.xaml" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
<add name="XamlImageConverterPsd" verb="*" path="*.svg" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
<add name="XamlImageConverterSvg" verb="*" path="*.svgz" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
<add name="XamlImageConverterSvgz" verb="*" path="*.psd" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
<add name="XamlImageConverterDynamic" verb="*" path="xic.axd" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.11.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
</handlers>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add name="XamlImageConverterXaml" verb="*" path="*.xaml" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
<add name="XamlImageConverterPsd" verb="*" path="*.svg" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
<add name="XamlImageConverterSvg" verb="*" path="*.svgz" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
<add name="XamlImageConverterSvgz" verb="*" path="*.psd" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
<add name="XamlImageConverterDynamic" verb="*" path="xic.axd" preCondition="integratedMode" type="XamlImageConverter.Web.XamlImageHandler, XamlImageConverter.Web, Version=3.12.0.0, Culture=neutral, PublicKeyToken=60c2ec984bc1bb45"/>
</handlers>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@
<img src="Homepage.xaml?png" runat="server" />
<hr />

<h3>A PDF of the above xaml</h3>
<h3>A PDF of the above xaml</h3>
<pre><code>&lt;a href="Homepage.xaml?pdf"&gt;Homepage PDF&lt;/a&gt;</code></pre>
<a href="Homepage.xaml?pdf">Homepage PDF</a>
<hr />

<h3>A PDF of www.msn.com</h3>
<pre><code>&lt;a href="xic.axd?Source=http:%2F%2Fwww.msn.com&amp;Image=msn.pdf&amp;Page=A4"&gt;MSN Printout&lt;/a&gt;</code></pre>
<a href="xic.axd?Source=http:%2F%2Fwww.msn.com&Image=msn.pdf&Page=A4">MSN Printout</a>
<hr />

<h3>Rendering of multiple images with a batch script file, and of an animated gif.</h3>
<pre><code>&lt;img src="CreateImages.xic.xaml?Image=Images/Homepage/animated-loader.gif" runat="server" /&gt;</code></pre>
<img src="CreateImages.xic.xaml?Image=Images/Homepage/animated-loader.gif" runat="server" />
Expand Down
15 changes: 14 additions & 1 deletion XamlImageConverter.Test.Web/XamlImageConverter.Test.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@
<Content Include="Lazy\Awesomium\xinput9_1_0.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lazy\gxps\gsdll32.dll" />
<Content Include="Lazy\gxps\gswin32.exe" />
<Content Include="Lazy\gxps\gswin32c.exe" />
<Content Include="Lazy\gxps\gxps-9.05-win32.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -217,8 +220,8 @@
<Content Include="XamlImageConverter.Demo\jquery.js" />
<Content Include="XamlImageConverter.Demo\jquery.maphilight.min.js" />
<Content Include="XamlImageConverter.Demo\Kaxaml.gif" />
<Content Include="XamlImageConverter.Demo\Readme.aspx" />
<Content Include="XamlImageConverter.Demo\generic-lines.png" />
<Content Include="XamlImageConverter.Demo\Readme.aspx" />
<Content Include="XamlImageConverter.Demo\SiteSpecification.xml" />
<Content Include="XamlImageConverter.Demo\Tux.svg" />
<Content Include="XamlImageConverter.Demo\Usa.Map.html" />
Expand Down Expand Up @@ -296,6 +299,16 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="Lazy\gxps\gsdll32.lib" />
</ItemGroup>
<ItemGroup>
<Content Include="Lazy\gxps\ISOcoated_v2_300_eci.icc" />
<Content Include="Lazy\gxps\ISOcoated_v2_eci.icc" />
<Content Include="Lazy\gxps\PDFA.ps" />
<Content Include="Lazy\gxps\PDFX.ps" />
<Content Include="Lazy\gxps\sRGB_v4_ICC_preference.icc" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
Expand Down
Loading

0 comments on commit bf845b3

Please sign in to comment.