simplified AspectRatio code, better exception handling for QuestPdf.Examples, fixed Placeholder image

This commit is contained in:
Marcin Ziąbek
2021-03-23 14:43:03 +01:00
parent 5e9ff7ec1e
commit 08126b2fa4
7 changed files with 51 additions and 15 deletions
+11 -4
View File
@@ -62,10 +62,17 @@ namespace QuestPDF.Examples.Engine
methodInfo.Invoke(this, new object[] {container});
Func<int, string> fileNameSchema = i => $"{fileName.ToLower()}-${i}.png";
var document = new SimpleDocument(container, size);
document.GenerateImages(fileNameSchema);
try
{
var document = new SimpleDocument(container, size);
document.GenerateImages(fileNameSchema);
}
catch (Exception e)
{
throw new Exception($"Cannot perform test ${fileName}", e);
}
if (showResult)
Process.Start("explorer", fileNameSchema(0));
}