Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions companion/app/Services/CommandInfoService.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,43 @@ public static function Commands ()
],
"Template" => "ConvertFromXLSToFileUNC.tpl.md"
],

"ConvertXLSSheets" => [
"Description" => "Convert Excel Spreadsheet Sheets to another file type",
"Title" => 'How do I Convert a single sheet in a Microsoft Excel Spreadsheet',
"Template" => "ConvertSheetFromXLStotype.tpl.md",
"Items" => [


[
"FileTypeExt" => 'PDF',
"FileTypeDescription" => 'Adobe PDF Format',
"FileFormat" => 'xlpdf',
"RelatedLinks" => []
],
[
"FileTypeExt" => 'TXT',
"FileTypeDescription" => 'Text File',
"FileFormat" => 'xlTextWindows',
"RelatedLinks" => []
],
[
"FileTypeExt" => 'HTML',
"FileTypeDescription" => 'HTML File',
"FileFormat" => 'xlHtml',
"RelatedLinks" => []
],
[
"FileTypeExt" => 'xls',
"FileTypeTitleExtra" => '9795',
"FileTypeDescription" => 'Excel 97/95 format',
"FileFormat" => 'xlExcel9795',
"RelatedLinks" => []
]


],
],
"ConvertPPTToFile" => [
"Description" => "Convert Microsoft PowerPoint Presentation to another file type",
"Template" => "ConvertFromPPTToFile.tpl.md",
Expand Down
8 changes: 8 additions & 0 deletions companion/resources/generator_templates/AllParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ Do not bitmap missing fonts, fonts will be substituted.

Create PDF to the ISO 19005-1 standard, also know as PDF-A or PDF Archive.

### Enable Macros

By Default (v1.16) Macros are disabled in both Word and Excel. If for
some reason you need them to run you can use these parameters

> --enable-macroautorun



### Special Case Parameters

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
~~~~{
"title" : "{{$Command->Title}} "
}

{{$Command->Title}}
==

How do I Convert a sheet from a Microsoft Excel Spreadsheet to a {{$Command->FileTypeDescription}} ({{$Command->FileTypeExt}}) ?
-

It is very simple to convert a sheet from a Microsoft Excel Spreadsheet to a {{$Command->FileTypeExt}} file
on the command line using [Docto](https://github.com/tobya/docto).
You can also do this easily in Microsoft Excel, but sometimes it helps to be able to do it
from the command line.

You need to add the `--sheets` parameter to specify the sheet you wish to export.

The command line below shows how you can convert a Microsoft Excel Spreadsheet
Document to a {{$Command->FileTypeDescription}} file
- {{$Command->FileTypeExt}} and save it.

Command Line
-

````
docto -XL -f 'c:\path\Spreadsheet.xls' -o 'c:\path\Output\SheetPDF.{{$Command->FileTypeExt}}' -t {{$Command->FileFormat}} --sheets
````

or easier to read

````
docto -XL -f '\\MyServer\path\Spreadsheet.xls'
-o '\\\\myserver\path\Output\Spreadsheet.{{$Command->FileTypeExt}}'
-t {{$Command->FileFormat}}
````

Command Line Explained
-

- `{{$Params->appxl->cmd}}` {{$Params->appxl->desc}}
- `{{$Params->dashf->cmd}}` {{$Params->dashf->desc}}
- `{{$Params->dasho->cmd}}` {{$Params->dasho->desc}}
- `{{$Params->dasht->cmd}}` {{$Params->dasht->desc}}




Some other interesting commands
-

You might find some of the following commands also interesting.

@include('RelatedLinks')

Other File Types Available for Conversion
-

The following values below can be used to convert a Microsoft Excel Spreadsheet to another file type.


````
{{$ResourceFiles['xlsFormats']['contents']}}
````

2 changes: 1 addition & 1 deletion src/ExcelUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ procedure TExcelXLSConverter.SaveAsPDF(OutputFilename : string) ;



logDebug('worksheetxx:' + ws.Name, VERBOSE);
logDebug('worksheet:' + ws.Name, VERBOSE);

ExportWorkSheetasPDF(ws,FileNameGen);

Expand Down
9 changes: 6 additions & 3 deletions src/MainUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface
MSVISIO = 4;


DOCTO_VERSION = '1.16.0'; // dont use 0x - choco needs incrementing versions.
DOCTO_VERSION = '1.16.2'; // dont use 0x - choco needs incrementing versions.
DOCTO_VERSION_NOTE = ' x64 Release ';
type

Expand Down Expand Up @@ -690,7 +690,7 @@ function TDocumentConverter.Execute: string;
begin

// logInfo('File Converted: ' + ConversionInfo.OutputFile);
logInfo('Files Converted: ' + fOutputFiles.Text);
logInfo('Files Converted: ' + sLineBreak + fOutputFiles.Text);

// Check if file needs to be deleted.
if RemoveFileOnConvert then
Expand Down Expand Up @@ -1290,7 +1290,10 @@ procedure TDocumentConverter.LoadConfig(Params: TStrings);
END
else if (id = '--SHEETS') then
begin
fSelectedSheets.DelimitedText := value;
// Sheet Indexs are 1 based.

fSelectedSheets.StrictDelimiter := true;
fSelectedSheets.CommaText := value;
if fSelectedSheets.Count = 0 then
begin
HaltWithConfigError(205,'Expecting > 0 selected sheets: ' + value);
Expand Down
2 changes: 1 addition & 1 deletion src/docto.dpr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
program docto;
(*************************************************************
Copyright © 2012-2016 Toby Allen (https://github.com/tobya)
Copyright © 2012-2026 Toby Allen (https://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
Expand Down
6 changes: 3 additions & 3 deletions src/docto.dproj.local
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<Transaction>2020/05/25 15:25:09.000.399,=D:\Development\GitHub\DocTo\src\res\HelpCompatibilityMode.txt</Transaction>
<Transaction>2020/05/25 15:31:23.000.508,D:\Development\GitHub\DocTo\src\res\WdCompatibilityMode.txt=</Transaction>
<Transaction>2021/12/02 22:25:13.000.761,=D:\Development\GitHub\DocTo\src\New1.bat</Transaction>
<Transaction>2021/12/02 22:25:32.000.527,D:\Development\GitHub\DocTo\src\New1.bat=D:\Development\GitHub\DocTo\test\TestDocTo_Quiet.bat</Transaction>
<Transaction>2021/12/02 22:25:32.000.527,D:\Development\GitHub\DocTo\test\TestDocTo_Quiet.bat=D:\Development\GitHub\DocTo\src\New1.bat</Transaction>
<Transaction>2023/09/11 17:39:20.000.384,=C:\Development\github\docto\src\res\xlsFormats.txt</Transaction>
<Transaction>2025/11/18 17:53:47.000.458,=C:\Development\github\docto\src\Unit1.pas</Transaction>
<Transaction>2025/11/18 17:54:21.000.396,C:\Development\github\docto\src\shared\DynamicFileNameGenerator.pas=C:\Development\github\docto\src\Unit1.pas</Transaction>
<Transaction>2025/11/18 17:54:21.000.396,C:\Development\github\docto\src\Unit1.pas=C:\Development\github\docto\src\shared\DynamicFileNameGenerator.pas</Transaction>
<Transaction>2025/11/19 14:43:02.000.361,=C:\Development\github\docto\src\Unit1.pas</Transaction>
<Transaction>2025/11/19 14:43:31.000.175,C:\Development\github\docto\src\Exceptions\DocToExceptions.pas=C:\Development\github\docto\src\Unit1.pas</Transaction>
<Transaction>2025/11/19 14:43:31.000.175,C:\Development\github\docto\src\Unit1.pas=C:\Development\github\docto\src\Exceptions\DocToExceptions.pas</Transaction>
</Transactions>
<ProjectSortOrder AutoSort="0" SortType="0">
<File Path="..\..\docto"/>
Expand Down
2 changes: 1 addition & 1 deletion src/res/HelpLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Long Parameters:
--enable-xlvbaauto
By Default any autorun vba will not run, use this parameter if you wish vba to Autorun. Word / Excel Only.
--sheets
Select which sheets to save. Can be comma seperated list of sheet names or indexes. Excel Only. PDF Only
Select which sheets to save. Can be comma seperated list of sheet names or indexes. Index 1 Based. Excel Only. PDF Only
--allsheets
If converting to CSV default behaviour is to convert first sheet. This will convert all with appropriate names. PDF, CSV only

Expand Down