diff --git a/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs b/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs index 2d6c23d4..e72e5f84 100644 --- a/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs +++ b/src/UglyToad.PdfPig.Tests/PublicApiScannerTests.cs @@ -84,6 +84,9 @@ "UglyToad.PdfPig.Graphics.Operations.General.SetMiterLimit", "UglyToad.PdfPig.Graphics.Operations.IGraphicsStateOperation", "UglyToad.PdfPig.Graphics.Operations.InvokeNamedXObject", + "UglyToad.PdfPig.Graphics.Operations.MarkedContent.BeginMarkedContent", + "UglyToad.PdfPig.Graphics.Operations.MarkedContent.DesignateMarkedContentPoint", + "UglyToad.PdfPig.Graphics.Operations.MarkedContent.EndMarkedContent", "UglyToad.PdfPig.Graphics.Operations.PathConstruction.AppendDualControlPointBezierCurve", "UglyToad.PdfPig.Graphics.Operations.PathConstruction.AppendEndControlPointBezierCurve", "UglyToad.PdfPig.Graphics.Operations.PathConstruction.AppendRectangle", diff --git a/src/UglyToad.PdfPig/Graphics/Operations/MarkedContent/DesignateMarkedContentPoint.cs b/src/UglyToad.PdfPig/Graphics/Operations/MarkedContent/DesignateMarkedContentPoint.cs new file mode 100644 index 00000000..e9c9a12d --- /dev/null +++ b/src/UglyToad.PdfPig/Graphics/Operations/MarkedContent/DesignateMarkedContentPoint.cs @@ -0,0 +1,128 @@ +namespace UglyToad.PdfPig.Graphics.Operations.MarkedContent +{ + using System.IO; + using Tokens; + using Writer; + + /// + /// + /// Designate a single marked-content point in the content stream. + /// + public class DesignateMarkedContentPoint : IGraphicsStateOperation + { + /// + /// The symbol for this operation in a stream. + /// + public const string Symbol = "MP"; + + /// + public string Operator => Symbol; + + /// + /// A name indicating the role or significance of the point. + /// + public NameToken Name { get; } + + /// + /// Create a new . + /// + /// The name of the marked-content point. + public DesignateMarkedContentPoint(NameToken name) + { + Name = name; + } + + /// + public void Run(IOperationContext operationContext) + { + } + + /// + public void Write(Stream stream) + { + TokenWriter.WriteToken(Name, stream); + stream.WriteWhiteSpace(); + stream.WriteText(Symbol); + stream.WriteNewLine(); + } + } + + /// + /// + /// Begin a marked-content sequence terminated by a balancing EMC operator. + /// + public class BeginMarkedContent : IGraphicsStateOperation + { + /// + /// The symbol for this operation in a stream. + /// + public const string Symbol = "BMC"; + + /// + public string Operator => Symbol; + + /// + /// A name indicating the role or significance of the sequence. + /// + public NameToken Name { get; } + + /// + /// Create a new . + /// + /// The name of the marked-content sequence. + public BeginMarkedContent(NameToken name) + { + Name = name; + } + + /// + public void Run(IOperationContext operationContext) + { + } + + /// + public void Write(Stream stream) + { + TokenWriter.WriteToken(Name, stream); + stream.WriteWhiteSpace(); + stream.WriteText(Symbol); + stream.WriteNewLine(); + } + } + + /// + /// + /// End a marked-content sequence. + /// + public class EndMarkedContent : IGraphicsStateOperation + { + /// + /// The symbol for this operation in a stream. + /// + public const string Symbol = "EMC"; + + /// + /// The instance of the operation. + /// + public static readonly EndMarkedContent Value = new EndMarkedContent(); + + /// + public string Operator => Symbol; + + private EndMarkedContent() + { + } + + /// + public void Run(IOperationContext operationContext) + { + } + + /// + public void Write(Stream stream) + { + stream.WriteText(Symbol); + stream.WriteNewLine(); + } + } +}