mirror of https://github.com/tobya/DocTo
Built xlsto app
Still need to do some work to get conversion working.
This commit is contained in:
parent
2802e988ba
commit
25090ec1c4
Binary file not shown.
BIN
exe/docto.exe
BIN
exe/docto.exe
Binary file not shown.
|
@ -1,7 +1,98 @@
|
|||
unit ExcelUtils;
|
||||
(*************************************************************
|
||||
Copyright © 2012 Toby Allen (http://github.com/tobya)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sub-license, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice, and every other copyright notice found in this software, and all the attributions in every file, and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
****************************************************************)
|
||||
interface
|
||||
|
||||
uses Classes, MainUtils, ResourceUtils, ActiveX, ComObj, WinINet, Variants, Types;
|
||||
|
||||
type
|
||||
|
||||
TExcelXLSConverter = Class(TDocumentConverter)
|
||||
Private
|
||||
ExcelApp : OleVariant;
|
||||
|
||||
public
|
||||
constructor Create() ;
|
||||
function CreateOfficeApp() : boolean; override;
|
||||
function DestroyOfficeApp() : boolean; override;
|
||||
function ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): string; override;
|
||||
function AvailableFormats() : TStringList; override;
|
||||
|
||||
End;
|
||||
|
||||
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
||||
|
||||
function TExcelXLSConverter.AvailableFormats() : TStringList;
|
||||
var
|
||||
Formats : TStringList;
|
||||
|
||||
begin
|
||||
Formats := Tstringlist.Create();
|
||||
LoadStringListFromResource('EXCELFORMATS',Formats);
|
||||
|
||||
result := Formats;
|
||||
end;
|
||||
|
||||
|
||||
{ TWordDocConverter }
|
||||
|
||||
constructor TExcelXLSConverter.Create;
|
||||
begin
|
||||
inherited;
|
||||
extension := '.xls';
|
||||
FLogFilename := 'XlsTo.Log';
|
||||
end;
|
||||
|
||||
function TExcelXLSConverter.CreateOfficeApp: boolean;
|
||||
begin
|
||||
ExcelApp := CreateOleObject('Excel.Application');
|
||||
ExcelApp.Visible := false;
|
||||
end;
|
||||
|
||||
function TExcelXLSConverter.DestroyOfficeApp: boolean;
|
||||
begin
|
||||
if not VarIsEmpty(ExcelApp) then
|
||||
begin
|
||||
ExcelApp.Quit();
|
||||
end;
|
||||
|
||||
end;
|
||||
|
||||
function TExcelXLSConverter.ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): string;
|
||||
begin
|
||||
//Open doc and save in requested format.
|
||||
ExcelApp.Workbooks.Open( FileToConvert);
|
||||
if OutputFileFormat = 50000 then //pdf
|
||||
begin
|
||||
|
||||
ExcelApp.activesheet.ExportAsFixedFormat(0, OutputFilename );
|
||||
|
||||
end
|
||||
else
|
||||
begin
|
||||
ExcelApp.activesheet.SaveAs( OutputFilename, OutputFileFormat);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
ExcelApp.activedocument.Close;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
|
|
@ -24,7 +24,7 @@ type
|
|||
end;
|
||||
|
||||
TDocumentConverter = class
|
||||
private
|
||||
protected
|
||||
Formats : TStringlist;
|
||||
FOutputFileFormatString: String;
|
||||
FOutputFileFormat: Integer;
|
||||
|
@ -44,6 +44,7 @@ type
|
|||
FIsDirInput: Boolean;
|
||||
FOutputExt: string;
|
||||
FWebHook : String;
|
||||
FExtension : String;
|
||||
|
||||
FHaltOnWordError: Boolean;
|
||||
FRemoveFileOnConvert: boolean;
|
||||
|
@ -74,6 +75,8 @@ type
|
|||
property DoSubDirs : Boolean read FDoSubDirs write SetDoSubDirs;
|
||||
property OutputExt : string read FOutputExt write SetOutputExt;
|
||||
property RemoveFileOnConvert: boolean read FRemoveFileOnConvert write SetRemoveFileOnConvert;
|
||||
procedure SetExtension(const Value: String); virtual;
|
||||
function GetExtension: String; virtual;
|
||||
public
|
||||
|
||||
Constructor Create();
|
||||
|
@ -82,7 +85,7 @@ type
|
|||
|
||||
|
||||
function Execute() : string; virtual;
|
||||
function ExecuteConversion() : string; virtual; abstract;
|
||||
function ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): string; virtual; abstract;
|
||||
|
||||
function DestroyOfficeApp() : boolean; virtual; abstract;
|
||||
function CreateOfficeApp() : boolean; virtual; abstract;
|
||||
|
@ -102,6 +105,7 @@ type
|
|||
property LogFilename: String read FLogFilename write SetLogFilename;
|
||||
Property Version : String read FVersionString;
|
||||
property HaltOnWordError : Boolean read FHaltOnWordError write SetHaltOnWordError;
|
||||
property Extension: String read GetExtension write SetExtension;
|
||||
|
||||
end;
|
||||
|
||||
|
@ -216,7 +220,7 @@ begin
|
|||
log('Ready to Execute' , VERBOSE);
|
||||
try
|
||||
|
||||
ExecuteConversion();
|
||||
ExecuteConversion(FileToConvert, OutputFilename, OutputFileFormat);
|
||||
|
||||
if RemoveFileOnConvert then
|
||||
begin
|
||||
|
@ -324,7 +328,7 @@ HelpStrings : TStringList;
|
|||
begin
|
||||
//Initislise
|
||||
iParam := 0;
|
||||
Formats := AvailableWordFormats();
|
||||
Formats := AvailableFormats();
|
||||
|
||||
|
||||
OutputLog := true;
|
||||
|
@ -381,7 +385,7 @@ begin
|
|||
IsDirInput := true;
|
||||
DoSubDirs := true;
|
||||
{TODO: allow user to specify *.doc extension }
|
||||
ListFiles(finputfile, '*.doc',true,FInputFiles);
|
||||
ListFiles(finputfile, '*' + Extension,true,FInputFiles);
|
||||
end
|
||||
else
|
||||
begin
|
||||
|
@ -554,6 +558,16 @@ begin
|
|||
FDoSubDirs := Value;
|
||||
end;
|
||||
|
||||
function TDocumentConverter.GetExtension: String;
|
||||
begin
|
||||
Result := fExtension;
|
||||
end;
|
||||
|
||||
procedure TDocumentConverter.SetExtension(const Value: String);
|
||||
begin
|
||||
FExtension := Value;
|
||||
end;
|
||||
|
||||
procedure TDocumentConverter.SetHaltOnWordError(const Value: Boolean);
|
||||
begin
|
||||
FHaltOnWordError := Value;
|
||||
|
@ -690,6 +704,8 @@ end;
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
function TDocumentConverter.GetUrl(Url: string): String;
|
||||
var
|
||||
NetHandle: HINTERNET;
|
||||
|
|
|
@ -20,16 +20,21 @@ type
|
|||
TWordDocConverter = Class(TDocumentConverter)
|
||||
Private
|
||||
WordApp : OleVariant;
|
||||
protected
|
||||
|
||||
|
||||
|
||||
public
|
||||
Constructor Create();
|
||||
function CreateOfficeApp() : boolean; override;
|
||||
function DestroyOfficeApp() : boolean; override;
|
||||
function ExecuteConversion() : string; override;
|
||||
function ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): string; override;
|
||||
function AvailableFormats() : TStringList; override;
|
||||
|
||||
End;
|
||||
|
||||
|
||||
function AvailableWordFormats() : TStringList;
|
||||
|
||||
|
||||
implementation
|
||||
|
||||
|
@ -49,6 +54,13 @@ end;
|
|||
|
||||
{ TWordDocConverter }
|
||||
|
||||
constructor TWordDocConverter.Create;
|
||||
begin
|
||||
inherited;
|
||||
Extension := '.doc';
|
||||
LogFilename := 'DocTo.Log';
|
||||
end;
|
||||
|
||||
function TWordDocConverter.CreateOfficeApp: boolean;
|
||||
begin
|
||||
Wordapp := CreateOleObject('Word.Application');
|
||||
|
@ -64,13 +76,15 @@ begin
|
|||
|
||||
end;
|
||||
|
||||
function TWordDocConverter.ExecuteConversion: string;
|
||||
function TWordDocConverter.ExecuteConversion(fileToConvert: String; OutputFilename: String; OutputFileFormat : Integer): string;
|
||||
begin
|
||||
//Open doc and save in requested format.
|
||||
Wordapp.documents.Open(FileToConvert, false, true);
|
||||
Wordapp.documents.Open( FileToConvert, false, true);
|
||||
Wordapp.activedocument.Saveas(OutputFilename ,OutputFileFormat );
|
||||
|
||||
Wordapp.activedocument.Close;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
program XlsTo;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
{$R 'xlsFormats.res' 'xlsFormats.rc'}
|
||||
{$R *.res}
|
||||
uses
|
||||
SysUtils,
|
||||
Classes,
|
||||
ActiveX,
|
||||
ExcelUtils in 'ExcelUtils.pas',
|
||||
MainUtils in 'MainUtils.pas',
|
||||
ResourceUtils in 'ResourceUtils.pas',
|
||||
PathUtils in 'PathUtils.pas';
|
||||
|
||||
var
|
||||
i : integer;
|
||||
paramlist : TStringlist;
|
||||
DocConv : TExcelXLSConverter;
|
||||
LogResult : String;
|
||||
begin
|
||||
|
||||
paramlist := TStringlist.create;
|
||||
DocConv := TExcelXLSConverter.Create;
|
||||
try
|
||||
try
|
||||
|
||||
for i := 1 to ParamCount do
|
||||
begin
|
||||
paramlist.Add(ParamStr(i));
|
||||
end;
|
||||
|
||||
DocConv.LoadConfig(paramlist);
|
||||
|
||||
CoInitialize(nil);
|
||||
LogResult := DocConv.Execute;
|
||||
DocConv.log( LogResult );
|
||||
|
||||
CoUninitialize;
|
||||
|
||||
|
||||
finally
|
||||
paramlist.Free;
|
||||
end;
|
||||
except on E: Exception do
|
||||
WriteLn('Error:' + E.Message);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
end.
|
|
@ -0,0 +1,124 @@
|
|||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{28BAD534-7394-45D5-A465-DDC534BD22AB}</ProjectGuid>
|
||||
<MainSource>XlsTo.dpr</MainSource>
|
||||
<ProjectVersion>12.3</ProjectVersion>
|
||||
<Base>True</Base>
|
||||
<Config Condition="'$(Config)'==''">Debug</Config>
|
||||
<Platform>Win32</Platform>
|
||||
<AppType>Console</AppType>
|
||||
<FrameworkType>None</FrameworkType>
|
||||
<DCC_DCCCompiler>DCC32</DCC_DCCCompiler>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_1)'!=''">
|
||||
<Cfg_1>true</Cfg_1>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_2)'!=''">
|
||||
<Cfg_2>true</Cfg_2>
|
||||
<CfgParent>Base</CfgParent>
|
||||
<Base>true</Base>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Base)'!=''">
|
||||
<DCC_ImageBase>00400000</DCC_ImageBase>
|
||||
<DCC_DcuOutput>.\$(Config)\$(Platform)</DCC_DcuOutput>
|
||||
<DCC_UnitAlias>WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;$(DCC_UnitAlias)</DCC_UnitAlias>
|
||||
<DCC_ExeOutput>.\$(Config)\$(Platform)</DCC_ExeOutput>
|
||||
<DCC_E>false</DCC_E>
|
||||
<DCC_N>false</DCC_N>
|
||||
<DCC_S>false</DCC_S>
|
||||
<DCC_F>false</DCC_F>
|
||||
<DCC_K>false</DCC_K>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_1)'!=''">
|
||||
<DCC_ExeOutput>../exe</DCC_ExeOutput>
|
||||
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
|
||||
<DCC_Optimize>false</DCC_Optimize>
|
||||
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Cfg_2)'!=''">
|
||||
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
|
||||
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
|
||||
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
|
||||
<DCC_DebugInformation>false</DCC_DebugInformation>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DelphiCompile Include="XlsTo.dpr">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<RcCompile Include="xlsFormats.rc">
|
||||
<ContainerId>RC</ContainerId>
|
||||
<ContainerId>RC</ContainerId>
|
||||
<Form>xlsFormats.res</Form>
|
||||
</RcCompile>
|
||||
<DCCReference Include="ExcelUtils.pas"/>
|
||||
<DCCReference Include="MainUtils.pas"/>
|
||||
<DCCReference Include="ResourceUtils.pas"/>
|
||||
<DCCReference Include="PathUtils.pas"/>
|
||||
<None Include="res\xlsFormats.txt"/>
|
||||
<BuildConfiguration Include="Release">
|
||||
<Key>Cfg_2</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Base">
|
||||
<Key>Base</Key>
|
||||
</BuildConfiguration>
|
||||
<BuildConfiguration Include="Debug">
|
||||
<Key>Cfg_1</Key>
|
||||
<CfgParent>Base</CfgParent>
|
||||
</BuildConfiguration>
|
||||
</ItemGroup>
|
||||
<Import Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')" Project="$(BDS)\Bin\CodeGear.Delphi.Targets"/>
|
||||
<Import Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')" Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj"/>
|
||||
<ProjectExtensions>
|
||||
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
|
||||
<Borland.ProjectType/>
|
||||
<BorlandProject>
|
||||
<Delphi.Personality>
|
||||
<VersionInfo>
|
||||
<VersionInfo Name="IncludeVerInfo">False</VersionInfo>
|
||||
<VersionInfo Name="AutoIncBuild">False</VersionInfo>
|
||||
<VersionInfo Name="MajorVer">1</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">0</VersionInfo>
|
||||
<VersionInfo Name="Release">0</VersionInfo>
|
||||
<VersionInfo Name="Build">0</VersionInfo>
|
||||
<VersionInfo Name="Debug">False</VersionInfo>
|
||||
<VersionInfo Name="PreRelease">False</VersionInfo>
|
||||
<VersionInfo Name="Special">False</VersionInfo>
|
||||
<VersionInfo Name="Private">False</VersionInfo>
|
||||
<VersionInfo Name="DLL">False</VersionInfo>
|
||||
<VersionInfo Name="Locale">6153</VersionInfo>
|
||||
<VersionInfo Name="CodePage">1252</VersionInfo>
|
||||
</VersionInfo>
|
||||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName"/>
|
||||
<VersionInfoKeys Name="FileDescription"/>
|
||||
<VersionInfoKeys Name="FileVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"/>
|
||||
<VersionInfoKeys Name="LegalCopyright"/>
|
||||
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||
<VersionInfoKeys Name="OriginalFilename"/>
|
||||
<VersionInfoKeys Name="ProductName"/>
|
||||
<VersionInfoKeys Name="ProductVersion">1.0.0.0</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="Comments"/>
|
||||
</VersionInfoKeys>
|
||||
<Source>
|
||||
<Source Name="MainSource">XlsTo.dpr</Source>
|
||||
</Source>
|
||||
<Parameters>
|
||||
<Parameters Name="RunParams">-f "C:\Users\Toby\Documents\GitHub\DocTo\exe\test\InputFiles\TestXL.xls" -o "..\test\textxl.pdf" -t xlPDF</Parameters>
|
||||
<Parameters Name="HostApplication">cmd</Parameters>
|
||||
<Parameters Name="DebugCWD">C:\Users\Toby\Documents\GitHub\DocTo\exe</Parameters>
|
||||
</Parameters>
|
||||
</Delphi.Personality>
|
||||
<Platforms>
|
||||
<Platform value="Win32">True</Platform>
|
||||
</Platforms>
|
||||
</BorlandProject>
|
||||
<ProjectFileVersion>12</ProjectFileVersion>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<BorlandProject>
|
||||
<Transactions>
|
||||
<Transaction>2013/04/24 18:01:01.000.075,C:\Users\Toby\Documents\RAD Studio\Projects\Project2.dproj=C:\Users\Toby\Documents\GitHub\DocTo\XlsTo.dproj</Transaction>
|
||||
<Transaction>2013/04/24 20:20:07.291,=C:\Users\Toby\Documents\GitHub\DocTo\src\New1.txt</Transaction>
|
||||
<Transaction>2013/04/24 20:25:45.964,C:\Users\Toby\Documents\GitHub\DocTo\src\res\xlsFormats.txt=C:\Users\Toby\Documents\GitHub\DocTo\src\New1.txt</Transaction>
|
||||
<Transaction>2013/04/24 20:27:56.086,C:\Users\Toby\Documents\GitHub\DocTo\src\xlsFormats.rc=C:\Users\Toby\Documents\GitHub\DocTo\src\wdFormats.rc</Transaction>
|
||||
</Transactions>
|
||||
</BorlandProject>
|
Binary file not shown.
|
@ -18,7 +18,7 @@ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||
****************************************************************)
|
||||
{$APPTYPE CONSOLE}
|
||||
|
||||
{$R 'wdFormats.res' 'wdFormats.rc'}
|
||||
{$R 'xlsFormats.res' 'xlsFormats.rc'}
|
||||
{$R *.res}
|
||||
uses
|
||||
SysUtils,
|
||||
|
|
|
@ -63,10 +63,10 @@
|
|||
<DelphiCompile Include="docto.dpr">
|
||||
<MainSource>MainSource</MainSource>
|
||||
</DelphiCompile>
|
||||
<RcCompile Include="wdFormats.rc">
|
||||
<RcCompile Include="xlsFormats.rc">
|
||||
<ContainerId>RC</ContainerId>
|
||||
<ContainerId>RC</ContainerId>
|
||||
<Form>wdFormats.res</Form>
|
||||
<Form>xlsFormats.res</Form>
|
||||
</RcCompile>
|
||||
<DCCReference Include="WordUtils.pas"/>
|
||||
<DCCReference Include="MainUtils.pas"/>
|
||||
|
@ -107,7 +107,7 @@
|
|||
<VersionInfo Name="MajorVer">0</VersionInfo>
|
||||
<VersionInfo Name="MinorVer">4</VersionInfo>
|
||||
<VersionInfo Name="Release">2</VersionInfo>
|
||||
<VersionInfo Name="Build">23</VersionInfo>
|
||||
<VersionInfo Name="Build">25</VersionInfo>
|
||||
<VersionInfo Name="Debug">True</VersionInfo>
|
||||
<VersionInfo Name="PreRelease">True</VersionInfo>
|
||||
<VersionInfo Name="Special">False</VersionInfo>
|
||||
|
@ -119,7 +119,7 @@
|
|||
<VersionInfoKeys>
|
||||
<VersionInfoKeys Name="CompanyName">Toflidium Software</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileDescription"/>
|
||||
<VersionInfoKeys Name="FileVersion">0.4.2.23</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="FileVersion">0.4.2.25</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="InternalName"/>
|
||||
<VersionInfoKeys Name="LegalCopyright">Toflidium Software</VersionInfoKeys>
|
||||
<VersionInfoKeys Name="LegalTrademarks"/>
|
||||
|
|
|
@ -17,14 +17,15 @@
|
|||
<Transaction>2012/12/29 15:46:27.000.368,C:\Users\Toby\Documents\GitHub\DocTo\src\res\HelpJSONLog.txt=C:\Users\Toby\Documents\GitHub\DocTo\src\New1.txt</Transaction>
|
||||
<Transaction>2013/01/04 22:59:43.000.114,=C:\Users\Toby\Documents\GitHub\DocTo\src\Unit1.pas</Transaction>
|
||||
<Transaction>2013/01/04 22:59:54.000.160,=C:\Users\Toby\Documents\GitHub\DocTo\src\Unit2.pas</Transaction>
|
||||
<Transaction>2013/01/04 23:01:35.000.511,C:\Users\Toby\Documents\GitHub\DocTo\src\Unit2.pas=C:\Users\Toby\Documents\GitHub\DocTo\src\dmmain.pas</Transaction>
|
||||
<Transaction>2013/01/04 23:01:35.000.511,C:\Users\Toby\Documents\GitHub\DocTo\src\Unit2.dfm=C:\Users\Toby\Documents\GitHub\DocTo\src\dmmain.dfm</Transaction>
|
||||
<Transaction>2013/01/04 23:01:35.000.511,C:\Users\Toby\Documents\GitHub\DocTo\src\Unit2.pas=C:\Users\Toby\Documents\GitHub\DocTo\src\dmmain.pas</Transaction>
|
||||
<Transaction>2013/01/05 00:02:58.000.285,C:\Users\Toby\Documents\GitHub\DocTo\src\dmmain.pas=</Transaction>
|
||||
<Transaction>2013/01/05 10:08:48.000.600,=C:\Users\Toby\Documents\GitHub\DocTo\src\New1.txt</Transaction>
|
||||
<Transaction>2013/01/05 10:08:58.000.358,C:\Users\Toby\Documents\GitHub\DocTo\src\res\HelpWebHook.txt=C:\Users\Toby\Documents\GitHub\DocTo\src\New1.txt</Transaction>
|
||||
<Transaction>2013/04/24 09:35:15.709,=C:\Users\Toby\Documents\GitHub\DocTo\src\docto.todo</Transaction>
|
||||
<Transaction>2013/04/24 09:37:43.874,=C:\Users\Toby\Documents\GitHub\DocTo\src\Unit1.pas</Transaction>
|
||||
<Transaction>2013/04/24 09:41:59.335,C:\Users\Toby\Documents\GitHub\DocTo\src\ExcelUtils.pas=C:\Users\Toby\Documents\GitHub\DocTo\src\Unit1.pas</Transaction>
|
||||
<Transaction>2013/04/24 09:35:15.000.709,=C:\Users\Toby\Documents\GitHub\DocTo\src\docto.todo</Transaction>
|
||||
<Transaction>2013/04/24 09:37:43.000.874,=C:\Users\Toby\Documents\GitHub\DocTo\src\Unit1.pas</Transaction>
|
||||
<Transaction>2013/04/24 09:41:59.000.335,C:\Users\Toby\Documents\GitHub\DocTo\src\ExcelUtils.pas=C:\Users\Toby\Documents\GitHub\DocTo\src\Unit1.pas</Transaction>
|
||||
<Transaction>2013/04/24 20:27:56.100,C:\Users\Toby\Documents\GitHub\DocTo\src\xlsFormats.rc=C:\Users\Toby\Documents\GitHub\DocTo\src\wdFormats.rc</Transaction>
|
||||
</Transactions>
|
||||
<ProjectSortOrder AutoSort="0" SortType="0">
|
||||
<File Path="..\..\DocTo"/>
|
||||
|
@ -37,8 +38,8 @@
|
|||
<File Path="MainUtils.pas"/>
|
||||
<File Path="PathUtils.pas"/>
|
||||
<File Path="ResourceUtils.pas"/>
|
||||
<File Path="wdFormats.rc"/>
|
||||
<File Path="WordUtils.pas"/>
|
||||
<File Path="ExcelUtils.pas"/>
|
||||
<File Path="xlsFormats.rc"/>
|
||||
</ProjectSortOrder>
|
||||
</BorlandProject>
|
||||
|
|
BIN
src/docto.res
BIN
src/docto.res
Binary file not shown.
|
@ -0,0 +1,53 @@
|
|||
xlAddIn=18
|
||||
xlCSV=6
|
||||
xlCSVMac=22
|
||||
xlCSVMSDOS=24
|
||||
xlCSVWindows=23
|
||||
xlCurrentPlatformText=-4158
|
||||
xlDBF2=7
|
||||
xlDBF3=8
|
||||
xlDBF4=11
|
||||
xlDIF=9
|
||||
xlExcel12=50
|
||||
xlExcel2=16
|
||||
xlExcel2FarEast=27
|
||||
xlExcel3=29
|
||||
xlExcel4=33
|
||||
xlExcel4Workbook=35
|
||||
xlExcel5=39
|
||||
xlExcel7=39
|
||||
xlExcel8=56
|
||||
xlExcel9795=43
|
||||
xlHtml=44
|
||||
xlIntlAddIn=26
|
||||
xlIntlMacro=25
|
||||
xlOpenDocumentSpreadsheet=60
|
||||
xlOpenXMLAddIn=55
|
||||
xlOpenXMLTemplate=54
|
||||
xlOpenXMLTemplateMacroEnabled=53
|
||||
xlOpenXMLWorkbook=51
|
||||
xlOpenXMLWorkbookMacroEnabled=52
|
||||
xlSYLK=2
|
||||
xlTemplate=17
|
||||
xlTextMac=19
|
||||
xlTextMSDOS=21
|
||||
xlTextPrinter=36
|
||||
xlTextWindows=20
|
||||
xlUnicodeText=42
|
||||
xlWebArchive=45
|
||||
xlWJ2WD1=14
|
||||
xlWJ3=40
|
||||
xlWJ3FJ3=41
|
||||
xlWK1=5
|
||||
xlWK1ALL=31
|
||||
xlWK1FMT=30
|
||||
xlWK3=15
|
||||
xlWK3FM3=32
|
||||
xlWK4=38
|
||||
xlWKS=4
|
||||
xlWorkbookDefault=51
|
||||
xlWorkbookNormal=-4143
|
||||
xlWorks2FarEast=28
|
||||
xlWQ1=34
|
||||
xlXMLSpreadsheet=46
|
||||
xlPDF=50000
|
|
@ -1,4 +1,4 @@
|
|||
FORMATS TEXT res\wdFormats.txt
|
||||
WORDFORMATS TEXT res\wdFormats.txt
|
||||
HELP TEXT res\HelpLog.txt
|
||||
HELPJSON TEXT res\HelpJSONLog.txt
|
||||
HELPWEBHOOK TEXT res\HelpWebHook.txt
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1,4 @@
|
|||
EXCELFORMATS TEXT res\xlsFormats.txt
|
||||
HELP TEXT res\HelpLog.txt
|
||||
HELPJSON TEXT res\HelpJSONLog.txt
|
||||
HELPWEBHOOK TEXT res\HelpWebHook.txt
|
Binary file not shown.
Binary file not shown.
|
@ -11,18 +11,22 @@ REM %~d0 and %~p0 together give the full directory this batch file is executing
|
|||
REM Individually try each format on Test Document
|
||||
REM FOR /F "eol=; tokens=1,2* delims=, " %%i in (testdata.txt) do "../exe/docto.exe" -f "%~d0%~p0\Inputfiles\pie3.doc" -o "%~d0%~p0GeneratedFiles\pie3out_%%i.%%j" -T %%i
|
||||
|
||||
"../exe/xlsto.exe" -f "%~d0%~p0Inputfiles\" -o "%~d0%~p0GeneratedFiles" -T wdFormatPDF -OX pdf
|
||||
|
||||
|
||||
|
||||
REM Try on Directory
|
||||
"../exe/docto.exe" -f "%~d0%~p0Inputfiles\" -o "%~d0%~p0GeneratedFiles" -T wdFormatPDF -OX pdf
|
||||
REM"../exe/docto.exe" -f "%~d0%~p0Inputfiles\" -o "%~d0%~p0GeneratedFiles" -T wdFormatPDF -OX pdf
|
||||
|
||||
REM Should produce an error
|
||||
"../exe/docto.exe" -f "%~d0%~p0Inputfiles\pie3.doc" -o "%~d0%~p0GeneratedFiles\Pie3.pdf" -T wdFormatTestPDF
|
||||
REM"../exe/docto.exe" -f "%~d0%~p0Inputfiles\pie3.doc" -o "%~d0%~p0GeneratedFiles\Pie3.pdf" -T wdFormatTestPDF
|
||||
|
||||
REM Should produce an error
|
||||
"../exe/docto.exe" -f "%~d0%~p0Inputfiles\pie3_doesntexist.doc" -o "%~d0%~p0GeneratedFiles\Pie3.pdf" -T wdFormatPDF
|
||||
REM"../exe/docto.exe" -f "%~d0%~p0Inputfiles\pie3_doesntexist.doc" -o "%~d0%~p0GeneratedFiles\Pie3.pdf" -T wdFormatPDF
|
||||
|
||||
REM Test Webhook
|
||||
REM *********************************
|
||||
REM To view visit http://toflidium.com/webhooks/docto/docto_test_values.txt
|
||||
REM *********************************
|
||||
"../exe/docto.exe" -f "%~d0%~p0Inputfiles\pie3.doc" -o "%~d0%~p0GeneratedFiles\Pie3.pdf" -T wdFormatPDF -W http://toflidium.com/webhooks/docto/webhook_test.php
|
||||
REM"../exe/docto.exe" -f "%~d0%~p0Inputfiles\pie3.doc" -o "%~d0%~p0GeneratedFiles\Pie3.pdf" -T wdFormatPDF -W http://toflidium.com/webhooks/docto/webhook_test.php
|
||||
|
||||
|
|
Loading…
Reference in New Issue