The following code snippet illustrates how one might add an
image and then delete it if the image color space is CMYK.
[C#]
using (Doc doc = new Doc()) {
string thePath = Server.MapPath("../mypics/mypic.jpg");
int theID1 = doc.AddImageFile(thePath, 1);
int theID2 = doc.GetInfoInt(theID1, "XObject");
int theComps = doc.GetInfoInt(theID2, "Components");
if (theComps == 4) doc.Delete(theID1);
doc.Save(Server.MapPath("docdelete.pdf"));
}
[Visual Basic]
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

docdelete.pdf
|