Here we highlight a set of images in a source document by drawing a red rectangle around each one.
[C#]
string theSrc =
Server.MapPath("Acrobat.pdf");
string theDst = Server.MapPath("HighlightedImages.pdf");
using (Doc theDoc = new Doc()) {
theDoc.Read(theSrc);
theDoc.Color.SetRgb(255, 0, 0);
theDoc.Width = 0.1;
ImageOperation op = new ImageOperation(theDoc);
op.PageContents.AddPages();
ICollection<ImageProperties> images = op.GetImageProperties();
foreach (ImageProperties pl in images) {
foreach (ImageRendition plc in pl.Renditions) {
plc.Focus();
theDoc.FrameRect();
}
}
theDoc.Save(theDst);
}
[Visual
Basic]
Dim theSrc As String = Server.MapPath("Acrobat.pdf")
Dim theDst As String = Server.MapPath("HighlightedImages.pdf")
Using theDoc As New Doc()
theDoc.Read(theSrc)
theDoc.Color.SetRgb(255, 0, 0)
theDoc.Width = 0.1
Dim op As New ImageOperation(theDoc)
op.PageContents.AddPages()
Dim images As ICollection(Of ImageProperties) = op.GetImageProperties()
For Each pl As ImageProperties In images
For Each plc As ImageRendition In pl.Renditions
plc.Focus()
theDoc.FrameRect()
Next
Next
theDoc.Save(theDst)
End Using
|
|
|