Method GetObjects
- Namespace
- BitMiracle.Docotic.Pdf
- Assembly
- BitMiracle.Docotic.Pdf.dll
GetObjects()
Retrieves collection of all objects drawn on the page.
public PdfCollection<PdfPageObject> GetObjects()
Returns
- PdfCollection<PdfPageObject>
Collection of all objects drawn on the page.
Remarks
The collection is ordered. Each subsequent object in the collection is drawn after the previous one.
This method is useful if you want to analyze or modify contents of the page. Look at the Copy text, paths and images sample for more detail.
You can check the following conditions to detect whether an extracted page object is visible on the page:
- Layer should be absent or visible.
- The page object should fit into the corresponding ClipRegion. For text and images, you can pass Bounds or Bounds to IsVisible(PdfRectangle) method for this check.
- (Text objects only) RenderingMode should not be equal to NeitherFillNorStroke or AddToPath.
- (Text objects only) If you know the background color of the page, then you may check that the text color is different. You can use Brush and/or Pen properties depending on the RenderingMode.
GetObjects(PdfObjectExtractionOptions)
Retrieves collection of all objects drawn on the page.
public PdfCollection<PdfPageObject> GetObjects(PdfObjectExtractionOptions options)
Parameters
options
PdfObjectExtractionOptionsThe object extraction options.
Returns
- PdfCollection<PdfPageObject>
Collection of all objects drawn on the page.
Remarks
The collection is ordered. Each subsequent object in the collection is drawn after the previous one.
This method is useful if you want to analyze or modify contents of the page. Look at the Copy text, paths and images sample for more detail.
You can check the following conditions to detect whether an extracted page object is visible on the page:
- Layer should be absent or visible.
- The page object should fit into the corresponding ClipRegion. For text and images, you can pass Bounds or Bounds to IsVisible(PdfRectangle) method for this check.
- (Text objects only) RenderingMode should not be equal to NeitherFillNorStroke or AddToPath.
- (Text objects only) If you know the background color of the page, then you may check that the text color is different. You can use Brush and/or Pen properties depending on the RenderingMode.