diff --git a/DocumentOperator.Application/Common/Interfaces/IPdfProcessor.cs b/DocumentOperator.Application/Common/Interfaces/IPdfProcessor.cs index d3aad79..ed7c1e3 100644 --- a/DocumentOperator.Application/Common/Interfaces/IPdfProcessor.cs +++ b/DocumentOperator.Application/Common/Interfaces/IPdfProcessor.cs @@ -86,11 +86,12 @@ public interface IPdfProcessor /// /// Type of annotation to add (TextMarkup, FreeText, StickyNote, Circle, Square) /// Page number (1-based) where annotation should be added - /// Annotation bounding rectangle (X1, Y1, X2, Y2) in PDF coordinates + /// Annotation bounding rectangle (X1, Y1, X2, Y2) /// Annotation content/comment text (required for FreeText and StickyNote) /// Optional author name /// Optional annotation color in RGB format (hex string like "FF0000" for red) /// Text markup style (Highlight, Underline, Strikeout) - only for TextMarkup type + /// Coordinate origin (BottomLeft = PDF native, TopLeft = UI-friendly). Default: BottomLeft /// Annotated PDF as byte array /// /// Thrown when stream is empty/invalid/not at Position=0, page number out of range, @@ -104,5 +105,44 @@ public interface IPdfProcessor string? content = null, string? author = null, string? color = null, - Domain.Models.ValueObjects.TextMarkupStyle? textMarkupStyle = null); + Domain.Models.ValueObjects.TextMarkupStyle? textMarkupStyle = null, + Domain.Models.ValueObjects.AnnotationOrigin origin = Domain.Models.ValueObjects.AnnotationOrigin.BottomLeft); + + /// + /// Adds a stamp (text, image, or predefined) to specified pages of a PDF document. + /// + /// Input PDF stream (must support reading and seeking) + /// Type of stamp (Text, Image, or Predefined) + /// Target page numbers (1-based). Null = all pages. + /// Stamp position (X, Y coordinates) + /// Stamp size (Width, Height). Null = auto-size for images. + /// Coordinate origin (BottomLeft or TopLeft) + /// Text content (required for Text stamps) + /// Font name (default: Arial) + /// Font size in points (default: 12) + /// Hex color without # (e.g., "FF0000" for red, default: "000000") + /// Opacity 0.0 (transparent) to 1.0 (opaque, default: 0.5) + /// Rotation angle in degrees 0-360 (default: 0) + /// Foreground (on top) or Background (behind content) + /// Image data (required for Image stamps, PNG/JPEG) + /// Predefined stamp type (required for Predefined stamps) + /// Stamped PDF as byte array + /// Invalid parameters (missing text/image, invalid page numbers, invalid opacity/rotation) + /// DevExpress processing error + Task AddStampAsync( + Stream pdfStream, + Domain.Models.ValueObjects.StampType stampType, + int[]? pageNumbers, + (double X, double Y) position, + (double Width, double Height)? size = null, + Domain.Models.ValueObjects.AnnotationOrigin origin = Domain.Models.ValueObjects.AnnotationOrigin.BottomLeft, + string? text = null, + string? fontName = null, + double? fontSize = null, + string? color = null, + double? opacity = null, + double? rotation = null, + Domain.Models.ValueObjects.StampPlacement placement = Domain.Models.ValueObjects.StampPlacement.Foreground, + byte[]? imageBytes = null, + Domain.Models.ValueObjects.PredefinedStampType? predefinedType = null); } \ No newline at end of file