feat: fehlende Variablen ergänzen
CI / build-and-test (push) Canceled after 0s

This commit is contained in:
2026-09-15 23:30:22 +02:00
parent 0b5cfc5522
commit 6e57bf407d
6 changed files with 129 additions and 9 deletions
@@ -108,7 +108,7 @@ public sealed class PdfImportPipeline
var blank = templatePath is null ? null : Extract(templatePath);
EnsureCompatible(example, blank);
if (example.Pages.Count > 1)
throw new InvalidDataException("Der automatische Import unterstützt in v1 einseitige Vorlagen. Weitere PDF-Seiten können anschließend als Folgeseitenlayout ergänzt werden.");
throw new InvalidDataException("Der automatische Import unterstützt in v1 einseitige Vorlagen. Weitere PDF-Seiten können anschließend im Reiter „Seiten & Flows“ als zusätzliche Seitenvorlage (page-template continuation) ergänzt werden.");
var candidates = FindCandidates(example, blank);
if (!string.IsNullOrWhiteSpace(username) && !string.IsNullOrWhiteSpace(password))
{
@@ -124,7 +124,7 @@ public sealed class PdfImportPipeline
{
if (document.Pages.Count == 0) throw new InvalidDataException("Das PDF enthält keine Seiten.");
if (document.Pages.Count > 1)
throw new InvalidDataException("Der automatische Import unterstützt in v1 einseitige Vorlagen. Weitere PDF-Seiten können anschließend als Folgeseitenlayout ergänzt werden.");
throw new InvalidDataException("Der automatische Import unterstützt in v1 einseitige Vorlagen. Weitere PDF-Seiten können anschließend im Reiter „Seiten & Flows“ als zusätzliche Seitenvorlage (page-template continuation) ergänzt werden.");
var first = document.Pages[0];
var assets = new Dictionary<string, byte[]>(StringComparer.OrdinalIgnoreCase)
{
@@ -134,6 +134,8 @@ public sealed class PdfImportPipeline
var lines = new List<string>
{
$"PAGE {N(first.Width)} {N(first.Height)} pt",
"#pragma format-version 3",
"#pragma page-template first",
"BG pdf-import-background.png",
};
var definitions = new List<PlaceholderDefinition>();
@@ -157,6 +159,7 @@ public sealed class PdfImportPipeline
definitions.Add(new(name, multiline ? PlaceholderType.Multiline : candidate.Type, false));
candidate.Name = name;
}
lines.Add("#pragma end-page-template");
var manifest = new TemplateManifest
{
Id = "pdf-import", Name = "PDF-Import", Description = "Automatisch aus einem PDF rekonstruiert",