[fix?:] trying
This commit is contained in:
+41
-22
@@ -774,32 +774,51 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
private async void BtnStartGenerateLabels_OnClick(object? sender, RoutedEventArgs e)
|
private async void BtnStartGenerateLabels_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
SavePdfExportOptions();
|
try
|
||||||
|
|
||||||
var saveDialog = new SaveFileDialog
|
|
||||||
{
|
{
|
||||||
DefaultExtension = "pdf",
|
SavePdfExportOptions();
|
||||||
Filters = { new FileDialogFilter { Name = "PDF-Dateien", Extensions = { "pdf" } } }
|
|
||||||
};
|
|
||||||
|
|
||||||
// hier nach winpafd prüfen
|
var saveDialog = new SaveFileDialog
|
||||||
var filePath = await saveDialog.ShowAsync(this);
|
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(filePath))
|
|
||||||
{
|
|
||||||
if (filePath.StartsWith("file://"))
|
|
||||||
{
|
{
|
||||||
filePath = new Uri(filePath).LocalPath;
|
DefaultExtension = "pdf",
|
||||||
|
Filters =
|
||||||
|
{
|
||||||
|
new FileDialogFilter
|
||||||
|
{
|
||||||
|
Name = "PDF-Dateien",
|
||||||
|
Extensions = { "pdf" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var filePath = await saveDialog.ShowAsync(this);
|
||||||
|
|
||||||
|
Console.WriteLine($"RAW: {filePath}");
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(filePath))
|
||||||
|
{
|
||||||
|
if (filePath.StartsWith("file://"))
|
||||||
|
{
|
||||||
|
filePath = new Uri(filePath).LocalPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine($"PATH: {filePath}");
|
||||||
|
|
||||||
|
var builder = new PdfBuilder(Settings._instance.pdfExport);
|
||||||
|
|
||||||
|
builder.CreateAddressLabelPdfFromAddressSetWithPlaceholder(
|
||||||
|
((KasAddressList)LstCustomerAdressSets.SelectedItem).ID,
|
||||||
|
"Company Logo/Info",
|
||||||
|
filePath
|
||||||
|
);
|
||||||
|
|
||||||
|
Console.WriteLine("PDF OK");
|
||||||
}
|
}
|
||||||
Console.WriteLine(filePath);
|
}
|
||||||
|
catch (Exception ex)
|
||||||
var builder = new PdfBuilder(Settings._instance.pdfExport);
|
{
|
||||||
|
Console.WriteLine(ex);
|
||||||
builder.CreateAddressLabelPdfFromAddressSetWithPlaceholder(
|
File.WriteAllText("crash.txt", ex.ToString());
|
||||||
((KasAddressList)LstCustomerAdressSets.SelectedItem).ID,
|
|
||||||
"Company Logo/Info",
|
|
||||||
filePath
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user