|
We cycle through the pages inserting images as we go.
We set the layer property to ensure that the image gets added in
the background rather than on top of existing content.
The first time we add an image file. Subsequent times we reference
the image ID. This means that we embed only one copy of the image
data and simply reference that data from each page.
Finally we save the modified PDF.
For i = 1 To theCount
theDoc.PageNumber = i
theDoc.Layer = theDoc.LayerCount + 1
If i = 1 Then
theID = theDoc.AddImage("c:\mypics\light.jpg")
Else
theDoc.AddImage theID
End If
Next
theDoc.Save "c:\mypdfs\watermark.pdf"
|