Compare commits
2 Commits
68541621d9
...
d337f94851
| Author | SHA1 | Date | |
|---|---|---|---|
| d337f94851 | |||
| 1922b30ada |
+25
-6
@@ -773,26 +773,37 @@ public partial class MainWindow : Window
|
||||
}
|
||||
|
||||
private async void BtnStartGenerateLabels_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
SavePdfExportOptions();
|
||||
|
||||
var saveDialog = new SaveFileDialog
|
||||
{
|
||||
DefaultExtension = "pdf",
|
||||
Filters = { new FileDialogFilter { Name = "PDF-Dateien", Extensions = { "pdf" } } }
|
||||
Filters =
|
||||
{
|
||||
new FileDialogFilter
|
||||
{
|
||||
Name = "PDF-Dateien",
|
||||
Extensions = { "pdf" }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// hier nach winpafd prüfen
|
||||
var filePath = await saveDialog.ShowAsync(this);
|
||||
|
||||
if (!string.IsNullOrEmpty(filePath))
|
||||
Console.WriteLine($"RAW: {filePath}");
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(filePath))
|
||||
{
|
||||
if (Uri.TryCreate(filePath, UriKind.Absolute, out var uri)
|
||||
&& uri.IsFile)
|
||||
if (filePath.StartsWith("file://"))
|
||||
{
|
||||
filePath = uri.LocalPath;
|
||||
filePath = new Uri(filePath).LocalPath;
|
||||
}
|
||||
|
||||
Console.WriteLine($"PATH: {filePath}");
|
||||
|
||||
var builder = new PdfBuilder(Settings._instance.pdfExport);
|
||||
|
||||
builder.CreateAddressLabelPdfFromAddressSetWithPlaceholder(
|
||||
@@ -800,6 +811,14 @@ public partial class MainWindow : Window
|
||||
"Company Logo/Info",
|
||||
filePath
|
||||
);
|
||||
|
||||
Console.WriteLine("PDF OK");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
File.WriteAllText("crash.txt", ex.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user