Zum Hauptinhalt springen
Beschreibung
Repräsentiert ein Element des Arbeitsbereichs. Dies kann ein Batch, ein Dokument oder eine Seite sein.
Methoden

Definition

Description

ApplyAutoLevelsFilter()

Important! This method is applicable only to gray and color images.

Automatically configures settings and applies the AdjustLevels filter.

ApplyPageProfile( name: string, [optional] onlyModificators: bool )

Applies the selected enhancement profile to an image.

Example

An example of a script that applies the Photo enhancement profile to all images of the “photo” type:

foreach( IWorkspaceItem item in Workspace.Selection )
{
if (item.PageInfo.IsPhoto)
{
item.ApplyPageProfile(“Photo”);
}
}

ApplyShadowsHighlightsFilter()

Important! This method is applicable only to gray and color images.

Applies a locally adaptive image contrast enhancement.

ApplySigmaFilter()

Important! This method is applicable only to gray and color images.

Applies a sigma filter to delete digital noise from images.

AutoCrop( [optional] type: string )

Automatically searches for page boundaries on an image, crops the area that contains data for extraction, corrects skews and distortions. Possible values of the optional type are Photo, Scan, Generic.

BackToSourceImage()

Allows you to get back to a source image.

ChangeResolution (int)

Changes image resolution on a page (or all pages) of a document or a batch to the specified value.

ConvertToBW ( )

Converts a page (or all pages) of a document or a batch to black-and-white.

Copy (target: IWorkspaceItem, [optional] inside: bool): IWorkspaceItem

Copies a document or a page after the target item, or inside it. A target can be batch, document or page. Insertion can be made after the target at the same level (if the inside parameter is set to “false”) or inside the target to the beginning of the list (if the inside parameter is set to “true”).

CorrectBrightness( brightness: int )

Important! This method is applicable only to gray and color images.

Corrects brightness of an image. Possible values are from -100 to 100.

CorrectContrast( contrast: int )

Important! This method is applicable only to gray and color images.

Corrects contrast of an image. Possible values are from -100 to 100.

Crop (rect: IPageRect)

Crops an area on a page (or all pages) of a document or a batch.

Deskew ([optional] byLines: bool, [optional] byBlackSquares: bool, [optional] byText: bool)

Deskews a page (or all pages) of a document or a batch. By default, byLines and byBlackSquares parameters are set to “false” while byText parameter is set to “true”.

Despeckle ([optional] garbageSize: VARIANT)

Despeckles a page (or all pages) of a document or a batch.

Erase (rect: IPageRect, [optional] rColor: int, [optional] gColor: int, [optional] bColor: int)

Erases an area on a page (or all pages) of a document or a batch.

FlipHorizontal ( )

Flips a page (or all pages) of a document or a batch horizontal.

FlipVertical ( )

Flips a page (or all pages) of a document or a batch vertical.

FreeScale (newWidth: int, newHeight: int, newResolution: int)

Scales a page (or all pages) of a document or a batch according to specified values.

Invert ([optional] rect: IPageRect)

Inverts a page (or all pages) of a document or a batch.

IsPhoto: bool

Shows whether an image is a photo.

IsSuitableForOcr: bool

Shows whether an image is suitable for OCR.

Move (target: IWorkspaceItem, [optional] inside: bool)

Moves a document or a page after the target item, or inside it. A target can be batch, document or page. Insertion can be made after the target at the same level (if the inside parameter is set to “false”) or inside the target to the beginning of the list (if the inside parameter is set to “true”).

RemoveGeometricalDistortions()

Corrects geometrical distortions of trapeziums and crooked lines on an image.

RemoveMotionBlur()

Important! This method is applicable only to gray and color images.

Detects and removes blur that is caused by moving a document or a camera/scanner.

RemoveScannerShadowFromImage()

Removes shadow from a scanner (for example, in the center spread).

RemoveStamps (colorToFilter: string, [optional] rect: IPageRect)

Wichtig! Diese Methode kann nur auf Farbbilder angewendet werden.

Entfernt Stempel aus Bildern.

  • colorToFilter
    Die Farbe der Stempel, die entfernt werden sollen. Akzeptiert die Zeichenfolgenwerte Red, Green, Blue und Yellow (Groß-/Kleinschreibung nicht beachtet).
  • rect
    Der Bereich des Bildes, aus dem Stempel entfernt werden sollen. Wenn dieser Parameter nicht angegeben wird, werden Stempel aus dem gesamten Bild entfernt.
Beispiel

Das folgende Skript ist ein Ereignishandler, der blaue Stempel aus der linken Hälfte aller Bilder in der Auswahl entfernt.

foreach (IWorkspaceItem item in Workspace.Selection)
{
if (item.IsPage && item.PageInfo.IsColor)
{
IPageRect rect = Workspace.NewPageRect();
rect.Left = 0;
rect.Right = item.PageInfo.Width / 2;
rect.Top = 0;
rect.Bottom = item.PageInfo.Height;
item.RemoveStamps(“blue”, rect);
}
}

RemoveStampsExt (colorsToFilter: string)

Wichtig! Diese Methode ist nur auf Farbbilder anwendbar.

Entfernt Stempel aus Bildern:

colorsToFilter – Farbe der zu löschenden Stempel.

  • String-Werte: Red, Green, Blue, Yellow, Orange, LightBlue, Purple (Groß-/Kleinschreibung wird nicht berücksichtigt).
  • Es können mehrere Werte durch ein Komma getrennt angegeben werden (z. B. “Red, Green”).
  • Es kann auch eine leere Zeichenfolge als Wert angegeben werden (""). In diesem Fall werden die zu löschenden Farben automatisch ausgewählt. Das Programm löscht alle Farben, die auf einem Bild gefunden werden und zu den zulässigen Werten gehören.

Beispiel

Ein Beispiel für ein Skript, das rote und grüne Stempel und Markierungen von allen Dokumentseiten entfernt:

foreach( IWorkspaceItem item in Workspace.Selection )
{
if (item.PageInfo.IsColor)
{
item.RemoveStampsExt(“Red,Green”);
}
}

ResetPageProfile()

Setzt das Bildverbesserungsprofil zurück und verwirft alle Änderungen.

Rotate (angle: int)

Dreht eine Seite (oder alle Seiten) eines Dokuments oder eines Batches.

SaveAs (fileName: string, [optional] options: IImageSavingOptions)

Speichert Seiten/ein Seitenbild/einen Batch in einer Datei.

Beim Speichern eines mehrseitigen Dokuments (oder eines Batches) in einem einseitigen Format wird eine Ausnahme ausgelöst.

Scale (ratio: int)

Skaliert eine Seite (oder alle Seiten) eines Dokuments oder eines Batches relativ zum Grundwert 100.

SplitHorizontal (pos: int)

Teilt eine Seite (oder alle Seiten) eines Dokuments oder eines Batches horizontal.

SplitVertical (pos: int)

Teilt eine Seite (oder alle Seiten) eines Dokuments oder eines Batches vertikal.

SuitabilityForOCR: float

Gibt an, wie gut ein Bild für OCR geeignet ist. Mögliche Werte liegen zwischen 0,0 und 1,0.

Eigenschaften

Attachments

IAttachments

Schreibgeschützt

Anhänge

BatchInfo (DocumentInfo oder PageInfo)

IBatchInfo/ IDocumentInfo / IExportPageInfo

Schreibgeschützt

Eigenschaften des Elements. Wenn die angeforderte Eigenschaft nicht dem Elementtyp entspricht, wird geprüft, ob IsBatch (IsDocument oder IsPage) zutrifft.

Children

IWorkspaceItems

Schreibgeschützt

Untergeordnete Elemente

IsBatch (IsDocument oder IsPage)

bool

Schreibgeschützt

Gibt an, ob das Element ein Batch, ein Dokument oder eine Seite ist

IsExported

bool

Lesen/Schreiben

Gibt an, ob das Element exportiert wird. Kann nur für Batch-Elemente in Pre-Export-Skripten geändert werden.

IsSelected

bool

Lesen/Schreiben

Gibt an, ob das Element ausgewählt ist. Das Ändern dieses Eigenschaftswerts für ein bestimmtes Element wirkt sich nicht auf andere Elemente aus.

Funktioniert nicht, wenn die aktuelle Auswahl aus Elementen eines anderen Typs besteht.

Index

int

Schreibgeschützt

Der Index des Elements in der übergeordneten Sammlung

Name

string

Lesen/Schreiben*

Der Name des Elements

Next

IWorkspaceItem

Schreibgeschützt

Das nächste Element

Parent

IWorkspaceItem

Schreibgeschützt

Das übergeordnete Element

Prev

IWorkspaceItem

Schreibgeschützt

Das vorherige Element

ScriptProperties

IScriptProperties

Schreibgeschützt

Skripteigenschaften

  • Hinweis. Wenn IWorkspaceItem zur Darstellung einer Seite verwendet wird, ist die Eigenschaft Name schreibgeschützt.