Deletes an object previously added to the document.




Doc.Delete ID



Name Type Description
ID Long The Object ID of the object to be deleted.




Use this method to delete an object previously added to the document.

Deletion is most commonly applied to pages to remove them from the document. For example, to delete the current page, you might use the following code:

theDoc.Delete theDoc.Page




The following code snippet illustrates how one might add an image and then delete it if the image color space is CMYK.

Set theDoc = Server.CreateObject("ABCpdf13.Doc")
theID1 = theDoc.AddImageFile("c:\mypics\mypic.jpg", 1)
theID2 = theDoc.GetInfo(theID1, "XObject")
theComps = theDoc.GetInfo(theID2, "Components")
If theComps = 4 Then theDoc.Delete(theID1)
theDoc.Save "c:\mypdfs\docdelete.pdf"