-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExtractAssets.cs
More file actions
28 lines (24 loc) · 882 Bytes
/
Copy pathExtractAssets.cs
File metadata and controls
28 lines (24 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using System.Threading.Tasks;
using Api2Convert;
using Api2Convert.Models;
namespace Api2Convert.Examples;
// Guide: Extract Assets — pull the embedded assets out of a DOCX document.
// Run: API2CONVERT_API_KEY=your-key dotnet run --project examples/Examples -- extract-assets
internal static class ExtractAssets
{
public static async Task RunAsync()
{
using Api2ConvertClient client = Shared.NewClient();
ConversionResult result = await client.ConvertAsync(
Shared.Docx,
"extract-assets",
options: null,
opts: new ConvertOptions { Category = "operation" });
Console.WriteLine($"Status: {result.Job.Status.Code}, outputs: {result.Outputs.Count}");
foreach (OutputFile output in result.Outputs)
{
Console.WriteLine($" {output.Uri}");
}
}
}