|
The following code snippet illustrates how one might add an image
and then delete it if the image color space is CMYK.
[C#]
Doc theDoc = new Doc();
string thePath = Server.MapPath("../mypics/mypic.jpg");
int theID1 = theDoc.AddImageFile(thePath, 1);
int theID2 = theDoc.GetInfoInt(theID1, "XObject");
int theComps = theDoc.GetInfoInt(theID2, "Components");
if (theComps == 4) theDoc.Delete(theID1);
theDoc.Save(Server.MapPath("docdelete.pdf"));
theDoc.Clear();
[Visual Basic]
Dim theDoc As Doc = New Doc()
Dim thePath As String = Server.MapPath("../mypics/mypic.jpg")
Dim theID1 As Integer = theDoc.AddImageFile(thePath, 1)
Dim theID2 As Integer = theDoc.GetInfoInt(theID1,"XObject")
Dim theComps As Integer = theDoc.GetInfoInt(theID2,"Components")
If theComps = 4 Then theDoc.Delete(theID1)
theDoc.Save(Server.MapPath("docdelete.pdf"))
theDoc.Clear()

docdelete.pdf
|
|
|