init repo
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
|
||||
</configSections>
|
||||
<log4net>
|
||||
<appender name="DebugAppender" type="log4net.Appender.DebugAppender">
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
<root>
|
||||
<level value="ERROR" />
|
||||
<appender-ref ref="DebugAppender" />
|
||||
</root>
|
||||
</log4net>
|
||||
<appSettings file="Settings.config">
|
||||
<add key="fileconverter.convert.presentationthemesdir" value="..\presentationthemes" />
|
||||
<add key="fileconverter.merge.script" value="merge.js" />
|
||||
<add key="fileconverter.merge.workdir" value="E:\Subversion\AVS\Sources\TeamlabOffice\trunk\OfficeWeb\Word\merge\" />
|
||||
</appSettings>
|
||||
</configuration>
|
||||
@@ -0,0 +1,230 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{321E9746-26BB-484F-BA34-266CBAF38008}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>FileConverter2</RootNamespace>
|
||||
<AssemblyName>FileConverter2</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugOpenSource|AnyCPU' ">
|
||||
<IsOpenSource>true</IsOpenSource>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;OPEN_SOURCE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseOpenSource|AnyCPU' ">
|
||||
<IsOpenSource>true</IsOpenSource>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;OPEN_SOURCE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Condition=" '$(IsOpenSource)' == '' " Include="ASCOfficeEWSEditor, Version=1.0.0.113, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\ASCOfficeEWSEditor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FileConverterUtils2, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\FileConverterUtils2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PdfWriter, Version=1.0.0.2, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\PdfWriter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCDocxFile">
|
||||
<Guid>{CBCEF68A-61B4-49FA-A35F-3BFF46FD3BE8}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCGraphics">
|
||||
<Guid>{AB5F2678-2773-44C4-A637-33DFBC51233B}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCHTMLRenderer">
|
||||
<Guid>{08DC1F03-6867-4585-B939-422C9078F5FD}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCImageStudio3">
|
||||
<Guid>{69DBBABC-8D59-40B8-9906-DAFD4F3EC346}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCMediaCore3">
|
||||
<Guid>{F0A0AAE5-06FE-4ABC-A9F1-26BFFEE2A11F}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="ASCOfficeDocxFile2">
|
||||
<Guid>{A1EEE61A-FAA7-47AF-B078-4E955623B9CA}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCOfficeFile">
|
||||
<Guid>{74CBF220-BF08-11DE-8A39-0800200C9A66}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCOfficeOdfFile">
|
||||
<Guid>{9AEF1F19-91CE-46C0-A380-06A7F56CE4AE}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCOfficePDFWriter">
|
||||
<Guid>{E0DC00B5-13BE-451C-92B5-078A5B44BEEA}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="ASCOfficePPTXFile">
|
||||
<Guid>{95DEE027-7707-4078-A314-33D35AE842FD}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="ASCOfficeUtils">
|
||||
<Guid>{92F87FA9-D3C2-4820-82F6-DEAEC0A3539D}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCOfficeWSHtmlFile">
|
||||
<Guid>{25B7D44B-94A1-4C94-9718-102CFA8F00D5}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCOfficeXlsFile">
|
||||
<Guid>{D9F21C35-D46C-42F3-996D-D4912435F7E7}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCPresentationEditor">
|
||||
<Guid>{B34974D7-C020-45B2-8A19-AFC20526B083}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="XlsxSerializerCom">
|
||||
<Guid>{E4E17295-6FF8-4BAC-B4C2-E17D72111035}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(ProjectDir)bin\Release\$(TargetFileName) $(SolutionDir)..\..\wwwroot\Bin\</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
754
ServerComponents/FileConverterService2/FileConverter2/Program.cs
Normal file
754
ServerComponents/FileConverterService2/FileConverter2/Program.cs
Normal file
@@ -0,0 +1,754 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
|
||||
using FileConverterUtils2;
|
||||
|
||||
using log4net;
|
||||
using log4net.Config;
|
||||
|
||||
#if! OPEN_SOURCE
|
||||
using ASCOfficeEWSEditor.Editor;
|
||||
#endif
|
||||
|
||||
namespace FileConverter2
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static string m_strGuidFile = "";
|
||||
static string m_strFormatFile = "";
|
||||
static int m_cnPercentConst = 10000;
|
||||
static int m_nStageIndex = 1;
|
||||
static int m_nStageCount = 1;
|
||||
|
||||
static uint c_nPageType = 0x0001;
|
||||
static int c_nHtmlRendererMode = 0x04 | 0x10;
|
||||
|
||||
static int c_nSvgDefaultWidth = 960;
|
||||
static int c_nSvgDefaultHeight = 720;
|
||||
|
||||
const int ZIP_NO_COMPRESSION = 0;
|
||||
const int ZIP_BEST_SPEED = 1;
|
||||
const int ZIP_BEST_COMPRESSION = 9;
|
||||
const int ZIP_DEFAULT_COMPRESSION = (-1);
|
||||
|
||||
const int PresentationEditorSavePptx = 1;
|
||||
const int PresentationEditorSavePdf = 2;
|
||||
const int PresentationEditorSaveHtml = 3;
|
||||
|
||||
#if! OPEN_SOURCE
|
||||
static string m_sConfigFontDir = Environment.ExpandEnvironmentVariables(ConfigurationSettings.AppSettings["utils.common.fontdir"]);
|
||||
#else
|
||||
static string m_sConfigFontDir = "";
|
||||
#endif
|
||||
static string m_sConfigThemeDir = ConfigurationSettings.AppSettings["fileconverter.convert.presentationthemesdir"];
|
||||
static string m_sTMImageGuid = "TMImageGuid";
|
||||
static int Main(string[] args)
|
||||
{
|
||||
log4net.Config.XmlConfigurator.Configure();
|
||||
ILog _log = LogManager.GetLogger(typeof(Program));
|
||||
|
||||
int nResult = (int)FileConverterUtils2.ErrorTypes.NoError;
|
||||
int nArgLength = args.Length;
|
||||
if (nArgLength < 1)
|
||||
return (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
try
|
||||
{
|
||||
ASCOfficeUtils.COfficeUtilsClass OfficeUtils = new ASCOfficeUtils.COfficeUtilsClass();
|
||||
TaskQueueDataConvert oTaskQueueDataConvert = TaskQueueDataConvert.DeserializeFromXml(File.ReadAllText(args[0], System.Text.Encoding.UTF8));
|
||||
int nFormatFrom = oTaskQueueDataConvert.m_nFormatFrom;
|
||||
int nFormatTo = oTaskQueueDataConvert.m_nFormatTo;
|
||||
string sFileFrom = oTaskQueueDataConvert.m_sFileFrom;
|
||||
string sFileTo = oTaskQueueDataConvert.m_sFileTo;
|
||||
m_strGuidFile = oTaskQueueDataConvert.m_sKey;
|
||||
m_strFormatFile = nFormatTo.ToString();
|
||||
bool? bPaid = oTaskQueueDataConvert.m_bPaid;
|
||||
bool? bEmbeddedFonts = oTaskQueueDataConvert.m_bEmbeddedFonts;
|
||||
|
||||
if (0 != (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB & nFormatFrom) && 0 != (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS & nFormatTo))
|
||||
{
|
||||
OfficeUtils.ExtractToDirectory(sFileFrom, Path.GetDirectoryName(sFileTo), null, 0);
|
||||
}
|
||||
else if (0 != (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB & nFormatTo) && 0 != (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS & nFormatFrom))
|
||||
{
|
||||
OfficeUtils.CompressFileOrDirectory(Path.GetDirectoryName(sFileFrom), sFileTo, ZIP_DEFAULT_COMPRESSION);
|
||||
}
|
||||
else
|
||||
{
|
||||
int nSourceFormatFrom = nFormatFrom;
|
||||
string sSourceFileFrom = sFileFrom;
|
||||
int nSourceFormatTo = nFormatTo;
|
||||
string sSourceFileTo = sFileTo;
|
||||
|
||||
string sTempDirectory = Path.Combine(Path.GetDirectoryName(sFileTo), "Temp");
|
||||
Directory.CreateDirectory(sTempDirectory);
|
||||
|
||||
string sTempConvertDir = Path.Combine(sTempDirectory, "Convert");
|
||||
Directory.CreateDirectory(sTempConvertDir);
|
||||
|
||||
if (0 != (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB & nFormatFrom) || FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_OLD_DOCUMENT == nFormatFrom ||
|
||||
FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING == nFormatFrom || FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_OLD_PRESENTATION == nFormatFrom)
|
||||
{
|
||||
string sUnzipDir = Path.Combine(sTempDirectory, "Unzip");
|
||||
Directory.CreateDirectory(sUnzipDir);
|
||||
OfficeUtils.ExtractToDirectory(sFileFrom, sUnzipDir, null, 0);
|
||||
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY == nFormatFrom)
|
||||
{
|
||||
sFileFrom = Path.Combine(sUnzipDir, "Editor.bin");
|
||||
nFormatFrom = FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_WORD;
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB_XLSY == nFormatFrom)
|
||||
{
|
||||
sFileFrom = Path.Combine(sUnzipDir, "Editor.bin");
|
||||
nFormatFrom = FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET;
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB_PPTY == nFormatFrom)
|
||||
{
|
||||
sFileFrom = Path.Combine(sUnzipDir, "Editor.bin");
|
||||
nFormatFrom = FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION;
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_OLD_DOCUMENT == nFormatFrom)
|
||||
{
|
||||
string sFileFromArch = Path.Combine(sUnzipDir, "Editor.html.arch");
|
||||
sFileFrom = Path.Combine(sUnzipDir, "Editor.html");
|
||||
if (File.Exists(sFileFromArch))
|
||||
File.Copy(sFileFromArch, sFileFrom, true);
|
||||
nFormatFrom = FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML;
|
||||
|
||||
OldDocumentReplaceImages oOldDocumentReplaceImages = new OldDocumentReplaceImages();
|
||||
oOldDocumentReplaceImages.sPath = Path.GetDirectoryName(sFileFrom);
|
||||
string sContent = File.ReadAllText(sFileFrom, System.Text.Encoding.UTF8);
|
||||
sContent = System.Text.RegularExpressions.Regex.Replace(sContent, "<img(.*?) src=\"(.*?)\"", oOldDocumentReplaceImages.undoReplace);
|
||||
File.WriteAllText(sFileFrom, sContent, System.Text.Encoding.UTF8);
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_OLD_PRESENTATION == nFormatFrom)
|
||||
{
|
||||
sFileFrom = Path.Combine(sUnzipDir, "Editor.xml");
|
||||
|
||||
string sEditorPath = Path.Combine(sUnzipDir, "Editor.xml");
|
||||
string sThemesPath = Path.Combine(sUnzipDir, "Themes.xml");
|
||||
string sReplacePath = Path.GetDirectoryName(sFileFrom);
|
||||
if (File.Exists(sEditorPath))
|
||||
{
|
||||
string sContent = File.ReadAllText(sEditorPath, System.Text.Encoding.UTF8);
|
||||
sContent = sContent.Replace(m_sTMImageGuid, sReplacePath);
|
||||
File.WriteAllText(sEditorPath, sContent, System.Text.Encoding.UTF8);
|
||||
}
|
||||
if (File.Exists(sThemesPath))
|
||||
{
|
||||
string sContent = File.ReadAllText(sThemesPath, System.Text.Encoding.UTF8);
|
||||
sContent = sContent.Replace(m_sTMImageGuid, sReplacePath);
|
||||
File.WriteAllText(sThemesPath, sContent, System.Text.Encoding.UTF8);
|
||||
}
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING == nFormatFrom)
|
||||
{
|
||||
sFileFrom = Path.Combine(sUnzipDir, "Editor.svg");
|
||||
|
||||
string sContent = File.ReadAllText(sFileFrom, System.Text.Encoding.UTF8);
|
||||
sContent = sContent.Replace(m_sTMImageGuid, Path.GetDirectoryName(sFileFrom) + "/");
|
||||
|
||||
File.WriteAllText(sFileFrom, sContent, new System.Text.UTF8Encoding(false));
|
||||
}
|
||||
}
|
||||
string sTempToZipDir = Path.Combine(sTempDirectory, "ToZip"); ;
|
||||
if (0 != (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB & nFormatTo))
|
||||
{
|
||||
Directory.CreateDirectory(sTempToZipDir);
|
||||
|
||||
sFileTo = Path.Combine(sTempToZipDir, "Editor.bin");
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB_DOCY == nFormatTo)
|
||||
nFormatTo = FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_WORD;
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB_XLSY == nFormatTo)
|
||||
nFormatTo = FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET;
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB_PPTY == nFormatTo)
|
||||
nFormatTo = FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION;
|
||||
}
|
||||
#if! OPEN_SOURCE
|
||||
|
||||
ASCOfficeFile.CAVSOfficeFileConverterClass converter = new ASCOfficeFile.CAVSOfficeFileConverterClass();
|
||||
converter.OnProgressEx += new ASCOfficeFile._IAVSOfficeFileConverterEvents_OnProgressExEventHandler(converter_OnProgressEx);
|
||||
#endif
|
||||
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF == nFormatTo)
|
||||
{
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_UNKNOWN == nFormatFrom)
|
||||
{
|
||||
PdfWriter.CPdfWriter oPdfWriter = new PdfWriter.CPdfWriter();
|
||||
oPdfWriter.SetThemesPlace(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), m_sConfigThemeDir));
|
||||
oPdfWriter.SetHtmlPlace(Path.GetDirectoryName(sFileFrom));
|
||||
if (bPaid.HasValue && false == bPaid.Value)
|
||||
oPdfWriter.SetUnregistredVersion(true);
|
||||
if (false == oPdfWriter.SavePdf(sFileFrom, sFileTo))
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (nFormatTo == nFormatFrom || (FileFormats.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF == nFormatFrom))
|
||||
{
|
||||
File.Copy(sFileFrom, sFileTo);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if! OPEN_SOURCE
|
||||
string sAdditionalOptions = "";
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT == nFormatFrom && oTaskQueueDataConvert.m_nCsvTxtEncoding.HasValue)
|
||||
sAdditionalOptions = "<TXTOptions><Encoding>" + oTaskQueueDataConvert.m_nCsvTxtEncoding.Value + "</Encoding></TXTOptions>";
|
||||
converter.LoadFromFile(sFileFrom, sTempConvertDir, "<Options><Display/><DownloadImages>1</DownloadImages><FB2Options><GenerateContent val=\"1\"/></FB2Options>" + sAdditionalOptions + "</Options>");
|
||||
converter.FileType = FileFormats.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF;
|
||||
|
||||
m_nStageIndex = 2;
|
||||
converter.SaveToFile(sFileTo, sTempConvertDir, "");
|
||||
#else
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#if! OPEN_SOURCE
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLRCanvas == nFormatTo || (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_WORD == nFormatTo && 0 == (FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT & nFormatFrom)))
|
||||
{
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_WORD == nFormatTo && 0 == (FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT & nFormatFrom))
|
||||
{
|
||||
nFormatTo = FileFormats.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLRCanvas;
|
||||
sFileTo = Path.GetDirectoryName(sFileTo);
|
||||
}
|
||||
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_OLD_PRESENTATION == nFormatFrom)
|
||||
{
|
||||
ASCPresentationEditor.CAVSPresentationEditor oPresEditor = new ASCPresentationEditor.CAVSPresentationEditor();
|
||||
oPresEditor.TempDirectory = sTempConvertDir;
|
||||
oPresEditor.OpenXmlFile(sFileFrom);
|
||||
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLR == nFormatTo)
|
||||
oPresEditor.Save(3, sFileTo);
|
||||
else
|
||||
oPresEditor.Save(4, sFileTo);
|
||||
oPresEditor.CloseFile(false);
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING == nFormatFrom)
|
||||
{
|
||||
ASCGraphics.SVGTransformerClass piSvgTransformer = new ASCGraphics.SVGTransformerClass();
|
||||
piSvgTransformer.SetAdditionalParam("DefaultWidth", c_nSvgDefaultWidth);
|
||||
piSvgTransformer.SetAdditionalParam("DefaultHeight", c_nSvgDefaultHeight);
|
||||
piSvgTransformer.LoadFile(sFileFrom);
|
||||
int nWidthPx = piSvgTransformer.Width;
|
||||
int nHeightPx = piSvgTransformer.Height;
|
||||
double dWidthMm = 2.54 * 10 * nWidthPx / 96;
|
||||
double dHeightMm = 2.54 * 10 * nHeightPx / 96;
|
||||
|
||||
ASCHTMLRenderer.CASCHTMLRenderer2 piHtmlRenderer = new ASCHTMLRenderer.CASCHTMLRenderer2();
|
||||
piHtmlRenderer.Mode = c_nHtmlRendererMode;
|
||||
piHtmlRenderer.CreateOfficeFile(sFileTo);
|
||||
piHtmlRenderer.NewPage();
|
||||
piHtmlRenderer.Width = dWidthMm;
|
||||
piHtmlRenderer.Height = dHeightMm;
|
||||
piHtmlRenderer.BeginCommand(c_nPageType);
|
||||
piSvgTransformer.Draw(piHtmlRenderer, 0, 0, dWidthMm, dHeightMm);
|
||||
piHtmlRenderer.EndCommand(c_nPageType);
|
||||
piHtmlRenderer.CloseFile();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_nStageCount = 2;
|
||||
m_nStageIndex = 1;
|
||||
|
||||
string sAdditionalOptions = "";
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT == nFormatFrom && oTaskQueueDataConvert.m_nCsvTxtEncoding.HasValue)
|
||||
sAdditionalOptions = "<TXTOptions><Encoding>" + oTaskQueueDataConvert.m_nCsvTxtEncoding.Value + "</Encoding></TXTOptions>";
|
||||
converter.LoadFromFile(sFileFrom, sTempConvertDir, "<Options><Display/><DownloadImages>1</DownloadImages><FB2Options><GenerateContent val=\"1\"/></FB2Options>" + sAdditionalOptions + "</Options>");
|
||||
converter.FileType = nFormatTo;
|
||||
|
||||
m_nStageIndex = 2;
|
||||
converter.SaveToFile(sFileTo, sTempConvertDir, "<Options><LoadInCommandRenderer/><HtmlRendererMode>" + c_nHtmlRendererMode + "</HtmlRendererMode></Options>");
|
||||
}
|
||||
|
||||
if (File.Exists(sFileFrom) && Directory.Exists(sFileTo))
|
||||
File.Copy(sFileFrom, Path.Combine(sFileTo, "origin"), true);
|
||||
|
||||
string sDirTo = sFileTo;
|
||||
string sDocumentJs = Path.Combine(sDirTo, "document.js");
|
||||
string sEditorBin = Path.Combine(sDirTo, "Editor.bin");
|
||||
if (File.Exists(sDocumentJs) && false == File.Exists(sEditorBin))
|
||||
File.Move(sDocumentJs, sEditorBin);
|
||||
}
|
||||
#endif
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_WORD == nFormatTo)
|
||||
{
|
||||
#if! OPEN_SOURCE
|
||||
string sAdditionalOptions = "";
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT_TXT == nFormatFrom && oTaskQueueDataConvert.m_nCsvTxtEncoding.HasValue)
|
||||
sAdditionalOptions = "<TXTOptions><Encoding>" + oTaskQueueDataConvert.m_nCsvTxtEncoding.Value + "</Encoding></TXTOptions>";
|
||||
converter.LoadFromFile(sFileFrom, sTempConvertDir, "<Options><Display/><FB2Options><GenerateContent val=\"0\"/></FB2Options>" + sAdditionalOptions + "</Options>");
|
||||
#else
|
||||
OfficeUtils.ExtractToDirectory(sFileFrom, sTempConvertDir, null, 0);
|
||||
#endif
|
||||
ASCOfficeDocxFile2.CAVSOfficeDocxFile2Class oDocxFile = new ASCOfficeDocxFile2.CAVSOfficeDocxFile2Class();
|
||||
oDocxFile.SetFontDir(m_sConfigFontDir);
|
||||
|
||||
if (bEmbeddedFonts.HasValue && true == bEmbeddedFonts.Value)
|
||||
oDocxFile.SetAdditionalParam("EmbeddedFontsDirectory", Path.Combine(Path.GetDirectoryName(sFileTo), "fonts"));
|
||||
oDocxFile.OpenFile(sTempConvertDir, sFileTo);
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_WORD == nFormatFrom)
|
||||
{
|
||||
if (oTaskQueueDataConvert.m_bFromChanges.HasValue && oTaskQueueDataConvert.m_bFromChanges.Value)
|
||||
{
|
||||
|
||||
string sDirFrom = Path.GetDirectoryName(sFileFrom);
|
||||
string sDirChanges = Path.Combine(sDirFrom, "changes");
|
||||
|
||||
string sNewFileFrom = Path.Combine(sDirFrom, "Editor1.bin");
|
||||
System.Diagnostics.Process convertProc = new System.Diagnostics.Process();
|
||||
convertProc.StartInfo.FileName = "node";
|
||||
convertProc.StartInfo.CreateNoWindow = true;
|
||||
convertProc.StartInfo.UseShellExecute = false;
|
||||
convertProc.StartInfo.WorkingDirectory = ConfigurationSettings.AppSettings["fileconverter.merge.workdir"];
|
||||
convertProc.StartInfo.Arguments = "\"" + ConfigurationSettings.AppSettings["fileconverter.merge.script"] +
|
||||
"\" \"" + sFileFrom +
|
||||
"\" \"" + sDirChanges +
|
||||
"\" \"" + sNewFileFrom + "\"";
|
||||
convertProc.Start();
|
||||
convertProc.WaitForExit();
|
||||
sFileFrom = sNewFileFrom;
|
||||
if(0 != convertProc.ExitCode)
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Unknown;
|
||||
}
|
||||
if (nResult == (int)FileConverterUtils2.ErrorTypes.NoError)
|
||||
{
|
||||
ASCOfficeDocxFile2.CAVSOfficeDocxFile2Class oDocxWriter = new ASCOfficeDocxFile2.CAVSOfficeDocxFile2Class();
|
||||
oDocxWriter.SetAdditionalParam("FontDir", m_sConfigFontDir);
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX != nFormatTo)
|
||||
oDocxWriter.SetAdditionalParam("SaveChartAsImg", true);
|
||||
oDocxWriter.Write(sFileFrom, sTempConvertDir);
|
||||
#if! OPEN_SOURCE
|
||||
if (bPaid.HasValue && false == bPaid)
|
||||
{
|
||||
ASCDocxFile.COfficeDocxFileClass oDocxFile = new ASCDocxFile.COfficeDocxFileClass();
|
||||
oDocxFile.AddObjects(sTempConvertDir, "<AddObjects><Paragraph><Text value=\"Created by YoursDocs\"/></Paragraph><Paragraph><Link value=\"http://www.yoursdocs.com/\" href=\"http://www.yoursdocs.com/\"/></Paragraph></AddObjects>");
|
||||
}
|
||||
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_HTMLZIP != nFormatTo)
|
||||
{
|
||||
converter.FileType = nFormatTo;
|
||||
converter.SaveToFile(sFileTo, sTempConvertDir, "");
|
||||
}
|
||||
else
|
||||
{
|
||||
string sTempConvertDir2 = Path.Combine(sTempDirectory, "Convert2");
|
||||
Directory.CreateDirectory(sTempConvertDir2);
|
||||
|
||||
converter.FileType = FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT_HTML;
|
||||
string sConvertFileTo = Path.Combine(sTempConvertDir2, Path.GetFileNameWithoutExtension(sFileTo) + ".html");
|
||||
converter.SaveToFile(sConvertFileTo, sTempConvertDir, "");
|
||||
|
||||
OfficeUtils.CompressFileOrDirectory(sTempConvertDir2, sFileTo, ZIP_DEFAULT_COMPRESSION);
|
||||
Directory.Delete(sTempConvertDir2, true);
|
||||
}
|
||||
#else
|
||||
OfficeUtils.CompressFileOrDirectory(sTempConvertDir, sFileTo, ZIP_DEFAULT_COMPRESSION);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION == nFormatTo)
|
||||
{
|
||||
#if! OPEN_SOURCE
|
||||
ASCPresentationEditor.CAVSPresentationEditorClass oPresentationEditor = new ASCPresentationEditor.CAVSPresentationEditorClass();
|
||||
oPresentationEditor.TempDirectory = sTempConvertDir;
|
||||
oPresentationEditor.SetFontDir(m_sConfigFontDir);
|
||||
oPresentationEditor.ConvertToPPTY(sFileFrom, sFileTo);
|
||||
#else
|
||||
ASCOfficePPTXFile.CAVSOfficePPTXFileClass oCAVSOfficePPTXFile = new ASCOfficePPTXFile.CAVSOfficePPTXFileClass();
|
||||
oCAVSOfficePPTXFile.TempDirectory = sTempConvertDir;
|
||||
oCAVSOfficePPTXFile.SetFontDir(m_sConfigFontDir);
|
||||
if (bEmbeddedFonts.HasValue && true == bEmbeddedFonts.Value)
|
||||
oCAVSOfficePPTXFile.SetAdditionalParam("EmbeddedFontsDirectory", Path.Combine(Path.GetDirectoryName(sFileTo), "fonts"));
|
||||
oCAVSOfficePPTXFile.OpenFileToPPTY(sFileFrom, sFileTo);
|
||||
#endif
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION == nFormatFrom)
|
||||
{
|
||||
ASCOfficePPTXFile.CAVSOfficePPTXFileClass oCAVSOfficePPTXFile = new ASCOfficePPTXFile.CAVSOfficePPTXFileClass();
|
||||
oCAVSOfficePPTXFile.TempDirectory = sTempConvertDir;
|
||||
oCAVSOfficePPTXFile.SetThemesDir(Path.Combine(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), m_sConfigThemeDir));
|
||||
oCAVSOfficePPTXFile.ConvertPPTYToPPTX(sFileFrom, sFileTo);
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET == nFormatTo)
|
||||
{
|
||||
XlsxSerializerCom.CAVSOfficeXlsxSerizer oXlsxSerizer = new XlsxSerializerCom.CAVSOfficeXlsxSerizer();
|
||||
oXlsxSerizer.SetFontDir(m_sConfigFontDir);
|
||||
if (bEmbeddedFonts.HasValue && true == bEmbeddedFonts.Value)
|
||||
oXlsxSerizer.SetAdditionalParam("EmbeddedFontsDirectory", Path.Combine(Path.GetDirectoryName(sFileTo), "fonts"));
|
||||
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV == nFormatFrom)
|
||||
{
|
||||
int nCsvEncoding = 65001;
|
||||
char cDelimiter = ',';
|
||||
if (oTaskQueueDataConvert.m_nCsvDelimiter.HasValue)
|
||||
{
|
||||
switch (oTaskQueueDataConvert.m_nCsvDelimiter.Value)
|
||||
{
|
||||
case (int)CsvDelimiter.Tab: cDelimiter = '\t'; break;
|
||||
case (int)CsvDelimiter.Semicolon: cDelimiter = ';'; break;
|
||||
case (int)CsvDelimiter.Сolon: cDelimiter = ':'; break;
|
||||
case (int)CsvDelimiter.Comma: cDelimiter = ','; break;
|
||||
case (int)CsvDelimiter.Space: cDelimiter = ' '; break;
|
||||
}
|
||||
}
|
||||
if (oTaskQueueDataConvert.m_nCsvTxtEncoding.HasValue)
|
||||
nCsvEncoding = oTaskQueueDataConvert.m_nCsvTxtEncoding.Value;
|
||||
|
||||
string strXmlOptions = string.Format("<xmlOptions><fileOptions fileType='2' codePage='{0}' delimiter='{1}' /></xmlOptions>", nCsvEncoding, cDelimiter);
|
||||
|
||||
oXlsxSerizer.SaveToFile(sFileTo, sFileFrom, strXmlOptions);
|
||||
}
|
||||
#if! OPEN_SOURCE
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS == nFormatFrom)
|
||||
{
|
||||
ASCOfficeOdfFile.COfficeOdfFileClass oOdfFile = new ASCOfficeOdfFile.COfficeOdfFileClass();
|
||||
oOdfFile.LoadFromFile(sFileFrom, sTempConvertDir, "");
|
||||
oXlsxSerizer.SaveToFile(sFileTo, sTempConvertDir, "");
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS == nFormatFrom)
|
||||
{
|
||||
ASCOfficeXlsFile.CXlsFileClass oXlsFile = new ASCOfficeXlsFile.CXlsFileClass();
|
||||
oXlsFile.LoadFromFile(sFileFrom, sTempConvertDir, "");
|
||||
oXlsxSerizer.SaveToFile(sFileTo, sTempConvertDir, "");
|
||||
}
|
||||
#endif
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX == nFormatFrom)
|
||||
{
|
||||
OfficeUtils.ExtractToDirectory(sFileFrom, sTempConvertDir, null, 0);
|
||||
oXlsxSerizer.SaveToFile(sFileTo, sTempConvertDir, "");
|
||||
}
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_CANVAS_SPREADSHEET == nFormatFrom)
|
||||
{
|
||||
XlsxSerializerCom.CAVSOfficeXlsxSerizer oXlsxSerizer = new XlsxSerializerCom.CAVSOfficeXlsxSerizer();
|
||||
oXlsxSerizer.LoadFromFile(sFileFrom, sTempConvertDir, "");
|
||||
|
||||
string sTempConvertDir2 = Path.Combine(sTempDirectory, "Convert2");
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX == nFormatTo)
|
||||
{
|
||||
#if! OPEN_SOURCE
|
||||
ASCDocxFile.COfficeDocxFileClass oDocxFile = new ASCDocxFile.COfficeDocxFileClass();
|
||||
oDocxFile.SaveToFile(sFileTo, sTempConvertDir, "");
|
||||
#else
|
||||
OfficeUtils.CompressFileOrDirectory(sTempConvertDir, sFileTo, ZIP_DEFAULT_COMPRESSION);
|
||||
#endif
|
||||
}
|
||||
#if! OPEN_SOURCE
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS == nFormatTo)
|
||||
{
|
||||
ASCOfficeXlsFile.CXlsFileClass oXlsFile = new ASCOfficeXlsFile.CXlsFileClass();
|
||||
oXlsFile.SaveToFile(sFileTo, sTempConvertDir, "");
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS == nFormatTo)
|
||||
{
|
||||
Directory.CreateDirectory(sTempConvertDir2);
|
||||
string sFileXlsx = Path.Combine(sTempConvertDir2, "converted.xlsx");
|
||||
ASCDocxFile.COfficeDocxFileClass oDocxFile = new ASCDocxFile.COfficeDocxFileClass();
|
||||
oDocxFile.SaveToFile(sFileXlsx, sTempConvertDir, "");
|
||||
ASCOfficeEWSEditor.Editor.ODSConverter.ODSConverter.ConvertFile(sFileXlsx, sFileTo, CleverAge.OdfConverter.OdfConverterLib.ConversionDirection.XlsxToOds);
|
||||
}
|
||||
#endif
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV == nFormatTo)
|
||||
{
|
||||
int nCsvEncoding = System.Text.Encoding.UTF8.CodePage;
|
||||
if (oTaskQueueDataConvert.m_nCsvTxtEncoding.HasValue)
|
||||
nCsvEncoding = oTaskQueueDataConvert.m_nCsvTxtEncoding.Value;
|
||||
char cDelimiter = ',';
|
||||
if (oTaskQueueDataConvert.m_nCsvDelimiter.HasValue)
|
||||
{
|
||||
switch (oTaskQueueDataConvert.m_nCsvDelimiter.Value)
|
||||
{
|
||||
case 1: cDelimiter = (char)0x09; break;
|
||||
case 2: cDelimiter = ';'; break;
|
||||
case 3: cDelimiter = ':'; break;
|
||||
case 4: cDelimiter = ','; break;
|
||||
case 5: cDelimiter = ' '; break;
|
||||
}
|
||||
}
|
||||
string strXmlOptions = string.Format("<xmlOptions><fileOptions fileType='2' codePage='{0}' delimiter='{1}' /></xmlOptions>", nCsvEncoding, cDelimiter);
|
||||
oXlsxSerizer.LoadFromFile(sFileFrom, sFileTo, strXmlOptions);
|
||||
}
|
||||
#if! OPEN_SOURCE
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_HTMLZIP == nFormatTo)
|
||||
{
|
||||
Directory.CreateDirectory(sTempConvertDir2);
|
||||
ASCOfficeWSHtmlFile.CWSHtmlFileClass oWSHtmlFile = new ASCOfficeWSHtmlFile.CWSHtmlFileClass();
|
||||
oWSHtmlFile.SaveToFile(Path.Combine(sTempConvertDir2, "main.html"), sTempConvertDir, "");
|
||||
OfficeUtils.CompressFileOrDirectory(sTempConvertDir2, sFileTo, ZIP_DEFAULT_COMPRESSION);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if! OPEN_SOURCE
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_OTHER_OLD_DRAWING == nFormatFrom)
|
||||
{
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_PDF == nFormatTo)
|
||||
{
|
||||
ASCGraphics.SVGTransformerClass piSvgTransformer = new ASCGraphics.SVGTransformerClass();
|
||||
piSvgTransformer.LoadFile(sFileFrom);
|
||||
int nWidthPx = piSvgTransformer.Width;
|
||||
int nHeightPx = piSvgTransformer.Height;
|
||||
double dWidthMm = 2.54 * 10 * nWidthPx / 72;
|
||||
double dHeightMm = 2.54 * 10 * nHeightPx / 72;
|
||||
|
||||
ASCOfficePDFWriter.CPDFWriterClass piPdfWriter = new ASCOfficePDFWriter.CPDFWriterClass();
|
||||
piPdfWriter.CreatePDF();
|
||||
piPdfWriter.NewPage();
|
||||
piPdfWriter.Width = dWidthMm;
|
||||
piPdfWriter.Height = dHeightMm;
|
||||
piPdfWriter.BeginCommand(c_nPageType);
|
||||
piSvgTransformer.Draw(piPdfWriter, 0, 0, dWidthMm, dHeightMm);
|
||||
piPdfWriter.EndCommand(c_nPageType);
|
||||
piPdfWriter.SaveToFile(sFileTo);
|
||||
piPdfWriter.DeletePDF();
|
||||
}
|
||||
else
|
||||
{
|
||||
string sXmlTo = "";
|
||||
string sXmlAddition = "";
|
||||
switch (nFormatTo)
|
||||
{
|
||||
case FileFormats.AVS_OFFICESTUDIO_FILE_IMAGE_PNG: sXmlTo = "Png"; break;
|
||||
case FileFormats.AVS_OFFICESTUDIO_FILE_IMAGE_JPG: sXmlTo = "Jpeg"; sXmlAddition = " quality=\"80\""; break;
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
ASCImageStudio3.ImageTransformsClass piImageTransform = new ASCImageStudio3.ImageTransformsClass();
|
||||
string sXml = "<transforms>";
|
||||
sXml += "<ImageFile-LoadImage sourcepath='" + sFileFrom + "'/>";
|
||||
|
||||
sXml += "</transforms>";
|
||||
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
if (piImageTransform.SetXml(sXml))
|
||||
if (piImageTransform.Transform())
|
||||
{
|
||||
object oFullImage;
|
||||
piImageTransform.GetResult(0, out oFullImage);
|
||||
|
||||
ASCMediaCore3.CAVSUncompressedVideoFrame piUnkFrame = (ASCMediaCore3.CAVSUncompressedVideoFrame)oFullImage;
|
||||
|
||||
if (piUnkFrame.BufferSize > 0)
|
||||
{
|
||||
piImageTransform.SetSource(0, oFullImage);
|
||||
sXml = "<transforms>";
|
||||
sXml += "<ImageFile-SaveAs" + sXmlTo + " destinationpath=\"" + sFileTo + "\" format=\"8888\"" + sXmlAddition + "/>";
|
||||
sXml += "</transforms>";
|
||||
if (piImageTransform.SetXml(sXml))
|
||||
if (piImageTransform.Transform())
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.NoError;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
_log.Error("Exception catched while image transform.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (0 != (FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT & nFormatFrom) && 0 != (FileFormats.AVS_OFFICESTUDIO_FILE_DOCUMENT & nFormatTo))
|
||||
{
|
||||
m_nStageCount = 2;
|
||||
m_nStageIndex = 1;
|
||||
|
||||
converter.LoadFromFile(sFileFrom, sTempConvertDir, "");
|
||||
converter.FileType = nFormatTo;
|
||||
|
||||
m_nStageIndex = 2;
|
||||
converter.SaveToFile(sFileTo, sTempConvertDir, "");
|
||||
}
|
||||
else if (0 != (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET & nFormatFrom) && 0 != (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET & nFormatTo))
|
||||
{
|
||||
string sXlsxDir = Path.Combine(sTempConvertDir, "xlsx");
|
||||
Directory.CreateDirectory(sXlsxDir);
|
||||
if(FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX == nFormatFrom)
|
||||
{
|
||||
ASCDocxFile.COfficeDocxFileClass oDocxFileClass = new ASCDocxFile.COfficeDocxFileClass();
|
||||
oDocxFileClass.LoadFromFile(sFileFrom, sXlsxDir, "");
|
||||
}
|
||||
else if(FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS == nFormatFrom)
|
||||
{
|
||||
ASCOfficeXlsFile.CXlsFileClass oXlsFileClass = new ASCOfficeXlsFile.CXlsFileClass();
|
||||
oXlsFileClass.LoadFromFile(sFileFrom, sXlsxDir, "");
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS == nFormatFrom)
|
||||
{
|
||||
ASCOfficeOdfFile.COfficeOdfFileClass oOdfFile = new ASCOfficeOdfFile.COfficeOdfFileClass();
|
||||
oOdfFile.LoadFromFile(sFileFrom, sXlsxDir, "");
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV == nFormatFrom)
|
||||
{
|
||||
string sTempFile = Path.Combine(sTempConvertDir, "temp_from.xlsx");
|
||||
using (EWSEditor oEditor = new EWSEditor())
|
||||
{
|
||||
Workbook wb = oEditor.LoadWorkbookFromCSV(sFileFrom, System.Text.Encoding.UTF8.CodePage, ',');
|
||||
wb.Save(sTempFile, ASCOfficeEWSEditor.Editor.FileFormats.Format.XLSX);
|
||||
}
|
||||
ASCDocxFile.COfficeDocxFileClass oDocxFileClass = new ASCDocxFile.COfficeDocxFileClass();
|
||||
oDocxFileClass.LoadFromFile(sTempFile, sXlsxDir, "");
|
||||
}
|
||||
else
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
if (nResult == (int)FileConverterUtils2.ErrorTypes.NoError)
|
||||
{
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX == nFormatTo)
|
||||
{
|
||||
ASCDocxFile.COfficeDocxFileClass oDocxFileClass = new ASCDocxFile.COfficeDocxFileClass();
|
||||
oDocxFileClass.SaveToFile(sFileTo, sXlsxDir, "");
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS == nFormatTo)
|
||||
{
|
||||
ASCOfficeXlsFile.CXlsFileClass oXlsFileClass = new ASCOfficeXlsFile.CXlsFileClass();
|
||||
oXlsFileClass.SaveToFile(sFileTo, sXlsxDir, "");
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_ODS == nFormatTo)
|
||||
{
|
||||
string sTempFile = Path.Combine(sTempConvertDir, "temp_to.xlsx");
|
||||
ASCDocxFile.COfficeDocxFileClass oDocxFileClass = new ASCDocxFile.COfficeDocxFileClass();
|
||||
oDocxFileClass.SaveToFile(sTempFile, sXlsxDir, "");
|
||||
ASCOfficeEWSEditor.Editor.ODSConverter.ODSConverter.ConvertFile(sTempFile, sFileTo, CleverAge.OdfConverter.OdfConverterLib.ConversionDirection.XlsxToOds);
|
||||
}
|
||||
else if (FileFormats.AVS_OFFICESTUDIO_FILE_SPREADSHEET_CSV == nFormatTo)
|
||||
{
|
||||
string sTempFile = Path.Combine(sTempConvertDir, "temp_to.xlsx");
|
||||
ASCDocxFile.COfficeDocxFileClass oDocxFileClass = new ASCDocxFile.COfficeDocxFileClass();
|
||||
oDocxFileClass.SaveToFile(sTempFile, sXlsxDir, "");
|
||||
using (EWSEditor oEditor = new EWSEditor())
|
||||
{
|
||||
Workbook wb = oEditor.LoadWorkbook(sTempFile);
|
||||
int nCsvEncoding = System.Text.Encoding.UTF8.CodePage;
|
||||
if (oTaskQueueDataConvert.m_nCsvTxtEncoding.HasValue)
|
||||
nCsvEncoding = oTaskQueueDataConvert.m_nCsvTxtEncoding.Value;
|
||||
char cDelimiter = ',';
|
||||
if (oTaskQueueDataConvert.m_nCsvDelimiter.HasValue)
|
||||
{
|
||||
switch (oTaskQueueDataConvert.m_nCsvDelimiter.Value)
|
||||
{
|
||||
case 1: cDelimiter = (char)0x09; break;
|
||||
case 2: cDelimiter = ';'; break;
|
||||
case 3: cDelimiter = ':'; break;
|
||||
case 4: cDelimiter = ','; break;
|
||||
case 5: cDelimiter = ' '; break;
|
||||
}
|
||||
}
|
||||
wb.SaveToCSV(sFileTo, nCsvEncoding, cDelimiter);
|
||||
}
|
||||
}
|
||||
else
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
}
|
||||
}
|
||||
else if (0 != (FileFormats.AVS_OFFICESTUDIO_FILE_PRESENTATION & nFormatFrom) && 0 != (FileFormats.AVS_OFFICESTUDIO_FILE_PRESENTATION & nFormatTo))
|
||||
{
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX == nFormatTo)
|
||||
{
|
||||
ASCPresentationEditor.CAVSPresentationEditorClass oPresentationEditor = new ASCPresentationEditor.CAVSPresentationEditorClass();
|
||||
oPresentationEditor.TempDirectory = sTempConvertDir;
|
||||
oPresentationEditor.SetFontDir(m_sConfigFontDir);
|
||||
oPresentationEditor.OpenFile(sFileFrom);
|
||||
oPresentationEditor.Save(PresentationEditorSavePptx, sFileTo);
|
||||
}
|
||||
else
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
|
||||
if (0 != (FileFormats.AVS_OFFICESTUDIO_FILE_TEAMLAB & nSourceFormatTo))
|
||||
{
|
||||
if (FileFormats.AVS_OFFICESTUDIO_FILE_CROSSPLATFORM_HTMLRCanvas == nFormatTo)
|
||||
OfficeUtils.CompressFileOrDirectory(sFileTo, sSourceFileTo, ZIP_DEFAULT_COMPRESSION);
|
||||
else
|
||||
OfficeUtils.CompressFileOrDirectory(Path.GetDirectoryName(sFileTo), sSourceFileTo, ZIP_DEFAULT_COMPRESSION);
|
||||
}
|
||||
#if! OPEN_SOURCE
|
||||
|
||||
System.Runtime.InteropServices.Marshal.ReleaseComObject(converter);
|
||||
#endif
|
||||
Directory.Delete(sTempDirectory, true);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (e is System.Runtime.InteropServices.COMException)
|
||||
{
|
||||
System.Runtime.InteropServices.COMException eCOMException = e as System.Runtime.InteropServices.COMException;
|
||||
nResult = eCOMException.ErrorCode;
|
||||
}
|
||||
else
|
||||
nResult = (int)FileConverterUtils2.ErrorTypes.Convert;
|
||||
|
||||
_log.Error("Exception catched in Main() method.", e);
|
||||
}
|
||||
return nResult;
|
||||
}
|
||||
|
||||
private static void converter_OnProgressEx(int nID, int nPercent, ref short Cancel)
|
||||
{
|
||||
nPercent /= m_cnPercentConst;
|
||||
int nStagePercentStart = (100 / m_nStageCount) * (m_nStageIndex - 1);
|
||||
int nOutputPercent = (nStagePercentStart + (nPercent / m_nStageCount));
|
||||
|
||||
nOutputPercent = nOutputPercent * 95 / 100;
|
||||
Console.WriteLine("\"" + m_strGuidFile + "\" \"" + nOutputPercent.ToString() + "\" \"" + m_strFormatFile + "\"");
|
||||
}
|
||||
private class OldDocumentReplaceImages
|
||||
{
|
||||
public string sPath;
|
||||
public string undoReplace(System.Text.RegularExpressions.Match m)
|
||||
{
|
||||
if (m.Groups.Count >= 3)
|
||||
{
|
||||
string href = m.Groups[2].Value;
|
||||
int index = href.IndexOf(m_sTMImageGuid);
|
||||
if (-1 != index)
|
||||
href = sPath + href.Substring(index + m_sTMImageGuid.Length);
|
||||
return "<img" + m.Groups[1].Value + " src=\"" + href + "\"";
|
||||
}
|
||||
else
|
||||
return m.Groups[0].Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("FileConverter2")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ascensio System SIA")]
|
||||
[assembly: AssemblyProduct("FileConverter2")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA Copyright (c) 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("54616771-b4e0-4242-b6f8-af0fea15f794")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.15")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.15")]
|
||||
@@ -0,0 +1,36 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C# Express 2008
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileConverterService2", "FileConverterService2\FileConverterService2.csproj", "{290A48D1-F7E2-4478-AFE6-AE5C744CD633}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileConverter2", "FileConverter2\FileConverter2.csproj", "{321E9746-26BB-484F-BA34-266CBAF38008}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
DebugOpenSource|Any CPU = DebugOpenSource|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
ReleaseOpenSource|Any CPU = ReleaseOpenSource|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{290A48D1-F7E2-4478-AFE6-AE5C744CD633}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{290A48D1-F7E2-4478-AFE6-AE5C744CD633}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{290A48D1-F7E2-4478-AFE6-AE5C744CD633}.DebugOpenSource|Any CPU.ActiveCfg = DebugOpenSource|Any CPU
|
||||
{290A48D1-F7E2-4478-AFE6-AE5C744CD633}.DebugOpenSource|Any CPU.Build.0 = DebugOpenSource|Any CPU
|
||||
{290A48D1-F7E2-4478-AFE6-AE5C744CD633}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{290A48D1-F7E2-4478-AFE6-AE5C744CD633}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{290A48D1-F7E2-4478-AFE6-AE5C744CD633}.ReleaseOpenSource|Any CPU.ActiveCfg = ReleaseOpenSource|Any CPU
|
||||
{290A48D1-F7E2-4478-AFE6-AE5C744CD633}.ReleaseOpenSource|Any CPU.Build.0 = ReleaseOpenSource|Any CPU
|
||||
{321E9746-26BB-484F-BA34-266CBAF38008}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{321E9746-26BB-484F-BA34-266CBAF38008}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{321E9746-26BB-484F-BA34-266CBAF38008}.DebugOpenSource|Any CPU.ActiveCfg = DebugOpenSource|Any CPU
|
||||
{321E9746-26BB-484F-BA34-266CBAF38008}.DebugOpenSource|Any CPU.Build.0 = DebugOpenSource|Any CPU
|
||||
{321E9746-26BB-484F-BA34-266CBAF38008}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{321E9746-26BB-484F-BA34-266CBAF38008}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{321E9746-26BB-484F-BA34-266CBAF38008}.ReleaseOpenSource|Any CPU.ActiveCfg = ReleaseOpenSource|Any CPU
|
||||
{321E9746-26BB-484F-BA34-266CBAF38008}.ReleaseOpenSource|Any CPU.Build.0 = ReleaseOpenSource|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
|
||||
</configSections>
|
||||
<!--<log4net>
|
||||
<appender name="FileAppender" type="log4net.Appender.FileAppender">
|
||||
<param name="File" value="e:\\logs\\log-file.txt" />
|
||||
<param name="AppendToFile" value="true" />
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
|
||||
</layout>
|
||||
</appender>
|
||||
<root>
|
||||
<level value="ALL" />
|
||||
<appender-ref ref="FileAppender" />
|
||||
</root>
|
||||
</log4net>-->
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<clear />
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" />
|
||||
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
|
||||
</DbProviderFactories>
|
||||
</system.data>
|
||||
<connectionStrings>
|
||||
<!--<add name="ConnectionString" connectionString="data source=D:\Projects\AVS\Sources\AVSOfficeStudio\AVSOfficeWeb\wwwroot\App_Data\sqlite.db3" providerName="System.Data.SQLite" />-->
|
||||
<add name="ConnectionString" connectionString="server=localhost;user id=usrFileConv;password=usrFileConv;database=convertdb;pooling=false;Character Set=utf8;" providerName="MySql.Data.MySqlClient" />
|
||||
<add name="ConnectionString2" connectionString="Server=localhost;database=canvaseditors;user id=canvas_usr;password=canvas_usr;pooling=True;Character Set=utf8" providerName="MySql.Data.MySqlClient" />
|
||||
</connectionStrings>
|
||||
<appSettings file="Settings.config">
|
||||
<add key="sleeptimeout" value="5" />
|
||||
<add key="sleeptimeoutiddle" value="5" />
|
||||
<add key="maxconverttime" value="60" />
|
||||
<add key="maxconverttimeiddle" value="300" />
|
||||
<add key="maxconvertiddlefiles" value="5" />
|
||||
<add key="maxdownloadbytes" value="10000000" />
|
||||
<!--number of processes per processor-->
|
||||
<add key="maxprocesscount" value="1" />
|
||||
|
||||
<!--download folder-->
|
||||
<add key="fileconverterservice.relativedir" value="..\origin" />
|
||||
<add key="fileconverterservice.gc.removedtaskatonce" value="10" />
|
||||
<add key="fileconverterservice.gc.runperiod" value="3600" />
|
||||
<add key="fileconverterservice.percent.runperiod" value="500" />
|
||||
<add key="utils.taskqueue.db.connectionstring" value="ConnectionString2"/>
|
||||
</appSettings>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="AWSSDK" publicKeyToken="CD2D24CD2BACE800" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.3.19.0" newVersion="1.3.19.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
using System.ServiceProcess;
|
||||
using log4net;
|
||||
using log4net.Config;
|
||||
|
||||
namespace FileConverterService2
|
||||
{
|
||||
public sealed class FileConverterService2 : ServiceBase
|
||||
{
|
||||
public const string AscFileConverterServiceName = "ASC File Converter Service2";
|
||||
private readonly ILog _log;
|
||||
private readonly FileConverter fileConverter;
|
||||
|
||||
public FileConverterService2()
|
||||
{
|
||||
log4net.Config.XmlConfigurator.Configure();
|
||||
_log = LogManager.GetLogger(typeof(FileConverterService2));
|
||||
|
||||
this.ServiceName = AscFileConverterServiceName;
|
||||
this.EventLog.Log = "Application";
|
||||
fileConverter = new FileConverter(System.Environment.MachineName);
|
||||
|
||||
this.CanHandlePowerEvent = false;
|
||||
this.CanHandleSessionChangeEvent = false;
|
||||
this.CanPauseAndContinue = false;
|
||||
this.CanShutdown = true;
|
||||
this.CanStop = true;
|
||||
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
protected override void OnStart(string[] args)
|
||||
{
|
||||
_log.Info("Service start");
|
||||
StartDaemon();
|
||||
base.OnStart(args);
|
||||
}
|
||||
|
||||
protected override void OnStop()
|
||||
{
|
||||
_log.Info("Service stop");
|
||||
fileConverter.Stop();
|
||||
base.OnStop();
|
||||
}
|
||||
|
||||
protected override void OnPause()
|
||||
{
|
||||
_log.Info("Service pause");
|
||||
base.OnPause();
|
||||
}
|
||||
|
||||
protected override void OnContinue()
|
||||
{
|
||||
_log.Info("Service continue");
|
||||
base.OnContinue();
|
||||
}
|
||||
|
||||
protected override void OnShutdown()
|
||||
{
|
||||
_log.Info("Service shutdown");
|
||||
fileConverter.Stop();
|
||||
base.OnShutdown();
|
||||
}
|
||||
|
||||
protected override void OnCustomCommand(int command)
|
||||
{
|
||||
|
||||
base.OnCustomCommand(command);
|
||||
}
|
||||
|
||||
protected override bool OnPowerEvent(PowerBroadcastStatus powerStatus)
|
||||
{
|
||||
if (powerStatus == PowerBroadcastStatus.Suspend)
|
||||
{
|
||||
fileConverter.Stop();
|
||||
}
|
||||
return base.OnPowerEvent(powerStatus);
|
||||
}
|
||||
|
||||
protected override void OnSessionChange(
|
||||
SessionChangeDescription changeDescription)
|
||||
{
|
||||
base.OnSessionChange(changeDescription);
|
||||
}
|
||||
|
||||
public void StartDaemon()
|
||||
{
|
||||
fileConverter.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.21022</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{290A48D1-F7E2-4478-AFE6-AE5C744CD633}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>FileConverterService2</RootNamespace>
|
||||
<AssemblyName>FileConverterService2</AssemblyName>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'DebugOpenSource|AnyCPU' ">
|
||||
<IsOpenSource>true</IsOpenSource>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;OPEN_SOURCE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'ReleaseOpenSource|AnyCPU' ">
|
||||
<IsOpenSource>true</IsOpenSource>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;OPEN_SOURCE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
<ItemGroup>
|
||||
<Compile Include="FileConverter.cs" />
|
||||
<Compile Include="FileConverterService2.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FileConverterService2Installer.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="AWSSDK, Version=1.3.19.0, Culture=neutral, PublicKeyToken=cd2d24cd2bace800, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\AWSSDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FileConverterUtils2, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\FileConverterUtils2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ionic.Zip.Reduced, Version=1.9.1.5, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\Ionic.Zip.Reduced.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\wwwroot\Bin\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Configuration.Install" />
|
||||
<Reference Include="System.Core">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization">
|
||||
<RequiredTargetFramework>3.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="Settings.config">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == '' " Include="ASCGraphics">
|
||||
<Guid>{AB5F2678-2773-44C4-A637-33DFBC51233B}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Include="ASCOfficeFile">
|
||||
<Guid>{74CBF220-BF08-11DE-8A39-0800200C9A66}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
<COMReference Condition=" '$(IsOpenSource)' == 'true' " Include="OfficeCore">
|
||||
<Guid>{2FA8EF81-55E5-4F98-B399-2DF9A5DA5E41}</Guid>
|
||||
<VersionMajor>1</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>tlbimp</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>copy $(ProjectDir)bin\Release\$(TargetFileName) $(SolutionDir)..\..\wwwroot\Bin\</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
using System.ComponentModel;
|
||||
using System.Configuration.Install;
|
||||
using System.ServiceProcess;
|
||||
|
||||
namespace FileConverterService2
|
||||
{
|
||||
|
||||
[RunInstaller(true)]
|
||||
public class FileConverterServiceInstaller : Installer
|
||||
{
|
||||
|
||||
public FileConverterServiceInstaller()
|
||||
{
|
||||
ServiceProcessInstaller serviceProcessInstaller =
|
||||
new ServiceProcessInstaller();
|
||||
ServiceInstaller serviceInstaller = new ServiceInstaller();
|
||||
|
||||
serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
|
||||
serviceProcessInstaller.Username = null;
|
||||
serviceProcessInstaller.Password = null;
|
||||
|
||||
serviceInstaller.DisplayName = FileConverterService2.AscFileConverterServiceName;
|
||||
serviceInstaller.StartType = ServiceStartMode.Automatic;
|
||||
|
||||
serviceInstaller.ServiceName = FileConverterService2.AscFileConverterServiceName;
|
||||
this.Installers.Add(serviceProcessInstaller);
|
||||
this.Installers.Add(serviceInstaller);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
using System;
|
||||
using System.ServiceProcess;
|
||||
|
||||
namespace FileConverterService2
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var service = new FileConverterService2();
|
||||
if ((args.Length > 0 && args[0] == "-d") || Environment.UserInteractive)
|
||||
{
|
||||
service.StartDaemon();
|
||||
}
|
||||
else
|
||||
{
|
||||
ServiceBase.Run(service);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* This program is a free software product. You can redistribute it and/or
|
||||
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
||||
* version 3 as published by the Free Software Foundation. In accordance with
|
||||
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
||||
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
||||
* of any third-party rights.
|
||||
*
|
||||
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
||||
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
*
|
||||
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
|
||||
* EU, LV-1021.
|
||||
*
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
* of the Program must display Appropriate Legal Notices, as required under
|
||||
* Section 5 of the GNU AGPL version 3.
|
||||
*
|
||||
* Pursuant to Section 7(b) of the License you must retain the original Product
|
||||
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
||||
* grant you any rights under trademark law for use of our trademarks.
|
||||
*
|
||||
* All the Product's GUI elements, including illustrations and icon sets, as
|
||||
* well as technical writing content are licensed under the terms of the
|
||||
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("FileConverterService2")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Ascensio System SIA")]
|
||||
[assembly: AssemblyProduct("FileConverterService2")]
|
||||
[assembly: AssemblyCopyright("Ascensio System SIA Copyright (c) 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("2f0ef597-725c-4954-976e-9808c513f9a5")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.26")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.26")]
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0"?>
|
||||
<appSettings>
|
||||
<add key="utils.common.fontdir" value="D:\Subversion\AVS\Sources\AVSOfficeStudio\OfficeWebCommon\TM_Fonts_Generator\Generations\Input"/>
|
||||
<!--Access credentinals-->
|
||||
<add key="AWSAccessKey" value="AKIAJXWUXR4MUL4MKZMA"/>
|
||||
<add key="AWSSecretKey" value="U5yvGrCYkQBaw39DggsM9Ygt5VZoJ80Gok/YdeSv"/>
|
||||
|
||||
<add key="utils.storage.impl" value="fs"/>
|
||||
|
||||
<!--S3 storage settings-->
|
||||
<add key="utils.storage.s3.region" value="us-west-2"/>
|
||||
<add key="utils.storage.s3.bucketname" value="static-doc.teamlab.com"/>
|
||||
<add key="utils.storage.s3.foldername" value="storage"/>
|
||||
<add key="utils.storage.s3.readbuffersize" value="5242880" />
|
||||
|
||||
<!--Filesystem storage settings-->
|
||||
<add key="utils.storage.fs.keyfiles" value="E:\Subversion\AVS\Sources\TeamlabOffice\trunk\wwwroot\files"/>
|
||||
|
||||
<add key="utils.taskresult.impl" value="db"/>
|
||||
<add key="utils.taskresult.ttl" value="7.00:00:00"/>
|
||||
<add key="utils.taskresult.db.connectionstring" value="ConnectionString2"/>
|
||||
|
||||
<add key="utils.taskqueue.impl" value="db"/>
|
||||
<add key="utils.taskqueue.db.connectionstring" value="ConnectionString2"/>
|
||||
|
||||
<add key="utils.filestatistic.impl" value="db"/>
|
||||
<add key="utils.filestatistic.db.connectionstring" value="ConnectionString2"/>
|
||||
|
||||
<!--SQS settings-->
|
||||
<add key="utils.taskqueue.sqs.lp" value="https://sqs.us-west-2.amazonaws.com/997789372772/document-tasks-queue-high-priority" />
|
||||
<add key="utils.taskqueue.sqs.np" value="https://sqs.us-west-2.amazonaws.com/997789372772/document-tasks-queue-high-priority" />
|
||||
<add key="utils.taskqueue.sqs.hp" value="https://sqs.us-west-2.amazonaws.com/997789372772/document-tasks-queue-high-priority" />
|
||||
</appSettings>
|
||||
Reference in New Issue
Block a user