The following code snippet illustrates how one might add an
image and then delete it if the image color space is CMYK.
using var doc = new Doc();
string path = Server.MapPath("../mypics/mypic.jpg");
int id1 = doc.AddImageFile(path, 1);
int id2 = doc.GetInfoInt(id1, "XObject");
int comps = doc.GetInfoInt(id2, "Components");
if (comps == 4) doc.Delete(id1);
doc.Save(Server.MapPath("docdelete.pdf"));
Using doc As New Doc()
Dim thePath As String = Server.MapPath("../mypics/mypic.jpg")
Dim theID1 As Integer = doc.AddImageFile(thePath, 1)
Dim theID2 As Integer = doc.GetInfoInt(theID1, "XObject")
Dim theComps As Integer = doc.GetInfoInt(theID2, "Components")
If theComps = 4 Then
doc.Delete(theID1)
End If
doc.Save(Server.MapPath("docdelete.pdf"))
End Using