Deletes an object previously added to the document.

 

   

Syntax
 

Doc.Delete ID

 

   

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

 

   

Notes
 

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

 

   

Example
 

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("ABCpdf10.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"


docdelete.pdf