fix: import DOCX body without source layout
This commit is contained in:
@@ -53,6 +53,48 @@ public sealed record InsertionPointInfo
|
||||
public string? Location { get; init; }
|
||||
}
|
||||
|
||||
public enum SectionBreakPolicy { Remove, ConvertToParagraph, ConvertToPageBreak }
|
||||
public enum RevisionImportPolicy { PreserveAndWarn, AcceptAll, RejectAll, BlockImport }
|
||||
public enum CommentImportPolicy { PreserveAndWarn, Exclude, BlockImport }
|
||||
public enum StyleConflictPolicy { KeepSourceFormatting, UseDestinationStyles, MapKnownStyles }
|
||||
|
||||
public sealed record WordOperationProgress
|
||||
{
|
||||
public required string Stage { get; init; }
|
||||
public string? Message { get; init; }
|
||||
public int? Percent { get; init; }
|
||||
}
|
||||
|
||||
public sealed record BodyImportPlan
|
||||
{
|
||||
public required int ParagraphCount { get; init; }
|
||||
public required int TableCount { get; init; }
|
||||
public required int InlineShapeCount { get; init; }
|
||||
public required int FloatingShapeCount { get; init; }
|
||||
public required int InternalSectionBreakCount { get; init; }
|
||||
public required int PageBreakCount { get; init; }
|
||||
public required IReadOnlyList<string> IncludedStories { get; init; }
|
||||
public required IReadOnlyList<string> ExcludedStories { get; init; }
|
||||
public required IReadOnlyList<string> Warnings { get; init; }
|
||||
}
|
||||
|
||||
public sealed record DocxBodyImportRequest
|
||||
{
|
||||
public required string SourcePath { get; init; }
|
||||
public required object DestinationRangeHandle { get; init; }
|
||||
public SectionBreakPolicy SectionBreakPolicy { get; init; } = SectionBreakPolicy.ConvertToPageBreak;
|
||||
public RevisionImportPolicy RevisionPolicy { get; init; } = RevisionImportPolicy.PreserveAndWarn;
|
||||
public CommentImportPolicy CommentPolicy { get; init; } = CommentImportPolicy.Exclude;
|
||||
public StyleConflictPolicy StyleConflictPolicy { get; init; } = StyleConflictPolicy.KeepSourceFormatting;
|
||||
}
|
||||
|
||||
public sealed record BodyImportResult
|
||||
{
|
||||
public required BodyImportPlan Plan { get; init; }
|
||||
public required string InsertionMode { get; init; }
|
||||
public required IReadOnlyList<string> Warnings { get; init; }
|
||||
}
|
||||
|
||||
public sealed record DocumentInspectionResult
|
||||
{
|
||||
public required string FilePath { get; init; }
|
||||
@@ -77,6 +119,7 @@ public sealed record DocumentInspectionResult
|
||||
public IReadOnlyList<DocumentStyleInfo> StyleDetails { get; init; } = [];
|
||||
public IReadOnlyList<SectionPartAssignment> SectionAssignments { get; init; } = [];
|
||||
public InsertionPointInfo InsertionPoint { get; init; } = new() { Type = "None" };
|
||||
public BodyImportPlan? BodyImportPlan { get; init; }
|
||||
public IReadOnlyList<InspectionWarning> Warnings { get; init; } = [];
|
||||
public IReadOnlyList<string> Styles => StyleDetails.Select(x => x.StyleId).ToArray();
|
||||
}
|
||||
@@ -98,6 +141,7 @@ public sealed record WordDocumentResult
|
||||
public required string LogPath { get; init; }
|
||||
public required TimeSpan Duration { get; init; }
|
||||
public required string InsertionPoint { get; init; }
|
||||
public BodyImportResult? BodyImport { get; init; }
|
||||
}
|
||||
|
||||
public sealed record WordPreviewResult
|
||||
|
||||
Reference in New Issue
Block a user