Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
fd41110
Add `ConverterCatalog` service and demo project for handling ConvertA…
tomasr78 Nov 25, 2025
bbeb1fd
Merge branch 'release/3.1.6' into develop
tomasr78 Nov 25, 2025
8a179bb
Start 3.1.7-dev development cycle; update version and changelog
tomasr78 Nov 25, 2025
16524cc
Fix Representation parameter #67
Nov 26, 2025
c610703
Downgrade target framework for GetConverterInfoDemo to .NET 6.0
tomasr78 Nov 26, 2025
59c6acf
Start 3.1.8-dev development cycle; update version and changelog
tomasr78 Nov 26, 2025
ee5a352
build 3.1.9-dev
tomasr78 Nov 26, 2025
560e7f3
Fix Representation parameter #67
Nov 27, 2025
51a526e
build 3.1.10-dev
tomasr78 Nov 27, 2025
89b5c2c
Extend OpenAPI support #66
Dec 2, 2025
a86c94f
build 3.1.11-dev
tomasr78 Dec 2, 2025
54290cd
Enhance `ConvertApiParam` to support FileId alongside local file paths.
tomasr78 Dec 3, 2025
28bdcf0
Update `Program.cs` to use relative path for test PDF file location i…
tomasr78 Dec 3, 2025
69fc4ee
build 3.1.12-dev
tomasr78 Dec 3, 2025
d728899
Update the SearchConverters() method #68
Jan 5, 2026
5044464
Merge pull request #70 from ConvertAPI/search-algorythm
tomasr78 Jan 5, 2026
9001053
build 3.1.13-dev
tomasr78 Jan 6, 2026
abbd544
Parse tag category #71
Jan 6, 2026
b1cf6bb
Merge remote-tracking branch 'origin/develop' into develop
Jan 6, 2026
4039c79
build 3.1.14-dev
Jan 6, 2026
8c43a53
Parameters of type Collection are missing value descriptions #69
kostas-jonauskas Mar 18, 2026
b8dd358
build 3.1.15-dev
kostas-jonauskas Mar 18, 2026
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
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,24 @@ All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

## [3.1.8-dev] — 2025-11-26

### Changed
- Start next development cycle as `-dev` prerelease: bump version to `3.1.8-dev` (assembly/file version `3.1.8.0`).

## [3.1.7-dev] — 2025-11-25

### Added
- Add `ConverterCatalog` service and demo project for handling ConvertAPI converters.

### Changed
- Downgrade `GetConverterInfoDemo` target framework to .NET 6.0.
- Start next development cycle as `-dev` prerelease: bump version to `3.1.7-dev` (assembly/file version `3.1.7.0`).
- This is a development snapshot; entries will accumulate here until the next stable release.

### Fixed
- Fix `Representation` parameter handling in `ConverterCatalog` (#67).

## [3.1.6] — 2025-11-12

### Added
Expand Down
9 changes: 8 additions & 1 deletion ConvertApi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConvertPdfToPdfA", "Example
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UploadOnceReuseTwice", "Examples\UploadOnceReuseTwice\UploadOnceReuseTwice.csproj", "{BDF6CFA4-56C1-4F23-9D65-5D0B7A5C2E0A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConverterCatalogDemo", "Examples\ConverterCatalogDemo\ConverterCatalogDemo.csproj", "{DFEC8F03-E140-488A-B457-59715605F5CA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -147,6 +149,10 @@ Global
{C3C2C6C0-9F6E-4B9F-A6A9-1C0D7E4CB8B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3C2C6C0-9F6E-4B9F-A6A9-1C0D7E4CB8B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3C2C6C0-9F6E-4B9F-A6A9-1C0D7E4CB8B1}.Release|Any CPU.Build.0 = Release|Any CPU
{DFEC8F03-E140-488A-B457-59715605F5CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFEC8F03-E140-488A-B457-59715605F5CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFEC8F03-E140-488A-B457-59715605F5CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFEC8F03-E140-488A-B457-59715605F5CA}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -173,7 +179,8 @@ Global
{BDF6CFA4-56C1-4F23-9D65-5D0B7A5C2E0A} = {139F9822-4A90-475F-BAA5-F0471A85461B}
{C3C2C6C0-9F6E-4B9F-A6A9-1C0D7E4CB8B1} = {139F9822-4A90-475F-BAA5-F0471A85461B}
{5C7E3B2A-0D7B-4D3F-9C64-2EA2F2E0E5C1} = {139F9822-4A90-475F-BAA5-F0471A85461B}
EndGlobalSection
{DFEC8F03-E140-488A-B457-59715605F5CA} = {139F9822-4A90-475F-BAA5-F0471A85461B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {337A0F6F-40A9-4993-BF66-05E4E374871F}
EndGlobalSection
Expand Down
1 change: 1 addition & 0 deletions ConvertApi/ConvertApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public async Task<ConvertApiResponse> ConvertAsync(string fromFormat, string toF
/// <param name="dst">Destination format, e.g. "pdf".</param>
/// <param name="ct">Cancellation token.</param>
/// <returns>Returns converter metadata model to build dynamic forms/UI.</returns>
[Obsolete("Use ConverterCatalog instead")]
public async Task<Converter> GetConverterInfo(string src, string dst, System.Threading.CancellationToken ct = default)
{
if (string.IsNullOrWhiteSpace(src)) throw new ArgumentNullException(nameof(src));
Expand Down
12 changes: 6 additions & 6 deletions ConvertApi/ConvertApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>3.1.6</Version>
<Company>Baltsoft</Company>
<Version>3.1.15-dev</Version>
<Company>ConvertApi</Company>
<Authors>ConvertApi</Authors>
<PackageProjectUrl>https://www.convertapi.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/ConvertAPI/convertapi-dotnet</RepositoryUrl>
Expand All @@ -17,11 +17,11 @@
<Product>ConvertApi</Product>
<AssemblyName>ConvertApi</AssemblyName>
<RootNamespace>ConvertApiDotNet</RootNamespace>
<AssemblyVersion>3.1.6.0</AssemblyVersion>
<FileVersion>3.1.6.0</FileVersion>
<PackageReleaseNotes>New examples (UploadOnceReuseTwice, GetConverterInfoDemo, DeleteFiles); new APIs (GetConverterInfo, DeleteFilesAsync); make CopyToAsync awaitable; rename GetValueAsync to GetUploadedFileAsync (obsolete alias kept); improve ConvertApiFileParam validation; examples upgraded to .NET 6.</PackageReleaseNotes>
<AssemblyVersion>3.1.15.0</AssemblyVersion>
<FileVersion>3.1.15.0</FileVersion>
<PackageReleaseNotes>Development snapshot (-dev prerelease). Changelog will evolve during the development cycle.</PackageReleaseNotes>
<TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks>
<PackageVersion>3.1.6</PackageVersion>
<PackageVersion>3.1.15-dev</PackageVersion>
<Description>ConvertAPI for .NET — one call to turn Office files into PDF or back again (DOCX ⇄ PDF, XLSX ⇄ PDF, PPTX ⇄ PDF). Convert HTML, images, ebooks, email, zip; merge, split, watermark, compress, OCR, redact, protect or repair PDF. Async, cross-platform, .NET Standard 2.0+ / .NET Core 5-9</Description>
</PropertyGroup>

Expand Down
45 changes: 37 additions & 8 deletions ConvertApi/ConvertApiParam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public ConvertApiFileParam(string name, Uri url) : base(name)
}

/// <summary>
/// Convert local file.
/// Convert a local file or reference an already uploaded file by its FileId.
/// </summary>
/// <param name="path">Path to a local file.</param>
/// <param name="path">Path to a local file or a 32-character lowercase FileId.</param>
public ConvertApiFileParam(string path) : this("file", path)
{
}
Expand All @@ -99,15 +99,27 @@ public ConvertApiFileParam(string name, string path) : base(name)
{
if (string.IsNullOrWhiteSpace(path))
throw new ArgumentException(
"Path must be a non-empty path to an existing local file. To use a FileId, pass new ConvertApiParam(\"FileId\", fileId).",
"Value must be a non-empty local file path or a 32-character lowercase FileId.",
nameof(path));

if (!File.Exists(path))
throw new FileNotFoundException(
$"File not found at path '{path}'. To use a FileId, pass new ConvertApiParam(\"FileId\", fileId).",
path);
// Prefer an existing local file path
if (File.Exists(path))
{
Tasks = Upload(new FileInfo(path));
return;
}

Tasks = Upload(new FileInfo(path));
// If it looks like a FileId, pass it as-is (no upload)
if (LooksLikeFileId(path))
{
Value = new[] { path };
return;
}

// Neither a file on disk nor a valid FileId
throw new FileNotFoundException(
$"Value '{path}' is neither an existing local file nor a valid FileId (32 lowercase alphanumeric characters).",
path);
}

/// <summary>
Expand Down Expand Up @@ -222,5 +234,22 @@ public async Task<ConvertApiFile> GetValueAsync()
{
return await GetUploadedFileAsync();
}

private static bool LooksLikeFileId(string value)
{
if (string.IsNullOrEmpty(value) || value.Length != 32)
return false;

for (int i = 0; i < value.Length; i++)
{
var ch = value[i];
var isDigit = ch >= '0' && ch <= '9';
var isLower = ch >= 'a' && ch <= 'z';
if (!isDigit && !isLower)
return false;
}

return true;
}
}
}
10 changes: 10 additions & 0 deletions ConvertApi/Helpers/Helper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;

namespace ConvertApiDotNet.Helpers
{
public static class Helper
{
public static bool ContainsIgnoreCase(string source, string token) =>
source?.IndexOf(token, StringComparison.OrdinalIgnoreCase) >= 0;
}
}
43 changes: 43 additions & 0 deletions ConvertApi/Interface/IConverterCatalog.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using ConvertApiDotNet.Model;

namespace ConvertApiDotNet.Interface
{
/// <summary>
/// Provides access to ConvertAPI converters and tags by parsing the OpenAPI specification.
/// </summary>
public interface IConverterCatalog
{
/// <summary>
/// Gets the complete list of available converters.
/// </summary>
List<ConverterDto> GetAllConverters();

/// <summary>
/// Gets a single converter definition by source and destination formats.
/// </summary>
ConverterDto GetConverter(string sourceFormat, string destinationFormat);

/// <summary>
/// Gets converters filtered by the specified tags.
/// If tags is null or empty, returns all converters.
/// </summary>
List<ConverterDto> GetConvertersByTags(List<string> tags = null);

/// <summary>
/// Searches for converters by the provided search terms.
/// </summary>
List<ConverterDto> SearchConverters(string[] terms);

/// <summary>
/// Gets the list of available tags.
/// </summary>
List<TagDto> GetTags();

/// <summary>
/// Reloads converter and tag information from the service and updates the cache.
/// </summary>
Task Reload();
}
}
4 changes: 3 additions & 1 deletion ConvertApi/Model/Converter.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;

namespace ConvertApiDotNet.Model
{
/// <summary>
/// Strongly typed metadata for a converter endpoint, derived from OpenAPI.
/// </summary>
[Obsolete("Use ConverterDto instead")]
public class Converter
{
public string Title { get; set; }
Expand Down
Loading
Loading