Class Document
Stellt Methoden rund um ein Document bereit
Inheritance
Inherited Members
Namespace: Simplic.Framework.DocumentProcessing.Document
Assembly: Simplic.Framework.DocumentProcessing.dll
Syntax
public static class Document
Methods
| Improve this Doc View SourceAddImageToImage(Byte[], Byte[], Int32, Int32, Int32, Single, Int32)
Declaration
public static byte[] AddImageToImage(byte[] sourceImage, byte[] imageToAdd, int xpos, int ypos, int pageNumber = 1, float percentImageSize = 1F, int transparency = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | sourceImage | |
System.Byte[] | imageToAdd | |
System.Int32 | xpos | |
System.Int32 | ypos | |
System.Int32 | pageNumber | |
System.Single | percentImageSize | |
System.Int32 | transparency |
Returns
Type | Description |
---|---|
System.Byte[] |
AddImageToPdf(Byte[], Byte[], Single, Single, Int32, Single)
Fügt einem PDF ein Image hinzu Bitte beachten, dass an der angegebenen Position die untere linke Ecke des Images gemalt wird. (Platz wird nach oben verbraucht)
Declaration
public static byte[] AddImageToPdf(byte[] pdf, byte[] image, float posx, float posy, int pageNumber = 1, float percentImageSize = 1F)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | ||
System.Byte[] | image | Image |
System.Single | posx | Abstand zum linken Rand des PDFs in Millimeter |
System.Single | posy | Abstand zum oberen Rand des PDFs in Millimeter |
System.Int32 | pageNumber | Seitennummer auf der das Image eingefügt werden soll |
System.Single | percentImageSize | Größe des Bildes in %, Default 1f = 100% (Originalgröße) |
Returns
Type | Description |
---|---|
System.Byte[] |
CreateNewDocFromPages(Byte[], DocumentType, List<Int32>)
Fügt verschiedene Seiten aus einem Dokument zu einem neuem Dokument zusammen
Declaration
public static byte[] CreateNewDocFromPages(byte[] data, DocumentType docType, List<int> pages)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Das Ursprungsdokument |
DocumentType | docType | Dokumententype |
System.Collections.Generic.List<System.Int32> | pages | Seitenzahlen des neue Dokuments |
Returns
Type | Description |
---|---|
System.Byte[] | neues Dokument (Tif) :byte[] |
CreateNewDocFromPages(Byte[], String, List<Int32>)
Fügt verschiedene Seiten aus einem Dokument zu einem neuem Dokument zusammen
Declaration
public static byte[] CreateNewDocFromPages(byte[] data, string extension, List<int> pages)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Das Ursprungsdokument |
System.String | extension | Dateierweiterung |
System.Collections.Generic.List<System.Int32> | pages | Seitenzahlen des neuen Dokuments |
Returns
Type | Description |
---|---|
System.Byte[] | neues Dokument (Tif):byte[] |
CreateNewTiffDocFromMultiDocs(List<Document_Info>)
Erstellt ein neues Tiff Dokument anhand der eingegebenen Dokumente
Declaration
public static byte[] CreateNewTiffDocFromMultiDocs(List<Document_Info> newDocMeta)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<Document_Info> | newDocMeta | byte[] = Binärdaten, string = Fileextension |
Returns
Type | Description |
---|---|
System.Byte[] | neues Dokument (tif) :byte[] |
CutOff(Byte[], Int32, Int32, Int32, Int32)
Schneidet den ausgewählten Bereich aus dem Bild und gibt anschließend das Bild ohne diesen Bereich zurück
Declaration
public static byte[] CutOff(byte[] image, int left, int top, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | image | |
System.Int32 | left | Position (px) |
System.Int32 | top | Position (px) |
System.Int32 | width | Px |
System.Int32 | height | Px |
Returns
Type | Description |
---|---|
System.Byte[] |
CutOffSide(Byte[], Int32, Document.ImageSide)
Declaration
public static byte[] CutOffSide(byte[] image, int px, Document.ImageSide side)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | image | |
System.Int32 | px | |
Document.ImageSide | side |
Returns
Type | Description |
---|---|
System.Byte[] |
CutOffSides(Byte[], Int32, Int32, Int32, Int32)
Schneidet die Ränder eines Bildes ab
Declaration
public static byte[] CutOffSides(byte[] image, int top, int left, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | image | Bild |
System.Int32 | top | entfernt Zeilen vom oberen Rand |
System.Int32 | left | entfernt Zeilen vom linken Rand |
System.Int32 | right | entfernt Zeilen vom rechten Rand |
System.Int32 | bottom | entfernt Zeilen vom unteren Rand |
Returns
Type | Description |
---|---|
System.Byte[] |
GetContent(Byte[], String, Boolean, String, Int32)
Extrahiert den Inhalt eines Dokuments
Declaration
public static ContentExtractionResult GetContent(byte[] data, string fileExtension, bool optimizeOCRTexts, string language = "deu", int passCount = 2)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | |
System.String | fileExtension | |
System.Boolean | optimizeOCRTexts | |
System.String | language | |
System.Int32 | passCount |
Returns
Type | Description |
---|---|
ContentExtractionResult |
GetContent(Byte[], String, String, Int32)
Declaration
public static string GetContent(byte[] data, string fileExtension, string language = "deu", int passCount = 2)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | |
System.String | fileExtension | |
System.String | language | |
System.Int32 | passCount |
Returns
Type | Description |
---|---|
System.String |
GetDocType(String)
Gibt den Enumerator DocumentType zu einer Dateierweiterung zurück
Declaration
public static DocumentType GetDocType(string fileExtension)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileExtension |
Returns
Type | Description |
---|---|
DocumentType |
GetPageCount(Byte[], DocumentType)
Gibt die Seitenanzahl eines Dokuments zurück
Declaration
public static int GetPageCount(byte[] data, DocumentType docType)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | data | Binaerdaten |
DocumentType | docType | Dokumententyp |
Returns
Type | Description |
---|---|
System.Int32 | Seitenanzahl:int |
MergeToTif(Byte[], String, Byte[], String)
Fügt zwei Dokumente zusammen
Declaration
public static byte[] MergeToTif(byte[] dok1, string extension1, byte[] dok2, string extension2)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | dok1 | Eingangsdokument Nummer 1 |
System.String | extension1 | Dateierweiterung Dokument 1 |
System.Byte[] | dok2 | Eingangsdokument 2 |
System.String | extension2 | Dateierweiterung Dokument 2 |
Returns
Type | Description |
---|---|
System.Byte[] | neues Dokument (tif) :byte[] |
ProcessOCRText(String, String)
Optimize ocr texts
Declaration
public static string ProcessOCRText(string input, string culture = "DE-de")
Parameters
Type | Name | Description |
---|---|---|
System.String | input | Input text |
System.String | culture | Culture |
Returns
Type | Description |
---|---|
System.String | Optimized text |
ResizeImage(Byte[], Single, InterpolationMode)
Skaliert ein Bild-Dokument auf eine andere größe
Declaration
public static byte[] ResizeImage(byte[] image, float percent, InterpolationMode interpolateMode = InterpolationMode.Bicubic)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | image | Das Dokument |
System.Single | percent | Veränderung in % -> 100 - Normalgröße |
System.Drawing.Drawing2D.InterpolationMode | interpolateMode |
Returns
Type | Description |
---|---|
System.Byte[] |
RotateImage(Byte[], Single, Nullable<Color>)
Dreht ein Image um die angegebenen Winkel (im Uhrzeigersinn) Bei Multipage Tiff Dokumenten wird jede Seite entsprechend gedreht
Declaration
public static byte[] RotateImage(byte[] image, float rotateAngle, Color? backColor = null)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | image | Daten des Images |
System.Single | rotateAngle | Winkel |
System.Nullable<System.Drawing.Color> | backColor |
Returns
Type | Description |
---|---|
System.Byte[] |
SetTransparcenyColor(Byte[], Color, Single)
Setzt eine Farbe in einem Image als Transparent
Declaration
public static byte[] SetTransparcenyColor(byte[] image, Color transColor, float treshold = 100F)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | image | Image |
System.Drawing.Color | transColor | Farbe welche als transparent gemarkt werden soll |
System.Single | treshold | 0 - 100f gibt an zu wie viel Prozent die Farbe übereinstimmen muss, damit sie als transparent gesetzt wird |
Returns
Type | Description |
---|---|
System.Byte[] |