Skip to content

Commit 28bdcf0

Browse files
committed
Update Program.cs to use relative path for test PDF file location in examples
1 parent 54290cd commit 28bdcf0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Examples/Workflow/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ static async Task Main(string[] args)
2121
var convertApi = new ConvertApi("api_token");
2222

2323
Console.WriteLine("Converting PDF to JPG and compressing result files with ZIP");
24-
var fileName = Path.Combine(Path.GetTempPath(), "test.pdf");
24+
var examplesDir = Path.GetFullPath(Path.Combine(AppContext.BaseDirectory, "..", "..", "..", ".."));
25+
var fileName = Path.Combine(examplesDir, "TestFiles", "test.pdf");
2526

2627
var firstTask = await convertApi.ConvertAsync("pdf", "jpg", new ConvertApiFileParam(fileName));
2728
Console.WriteLine($"Conversions done. Cost: {firstTask.ConversionCost}. Total files created: {firstTask.FileCount()}");

0 commit comments

Comments
 (0)