Quant a GroupDocs.Annotation for Net API

GroupDocs.Annotation for Net API és una biblioteca que us permet afegir anotacions a PDF, Word i altres documents a Mac, Windows o Ubuntu. GroupDocs.Annotation for Net és una API de xarxa nativa per gestionar anotacions amb suport complet per crear, afegir, editar, suprimir, extreure i exportar anotacions d’imatges i altres documents. La llista completa dels formats de document compatibles que podeu veure en aquesta pàgina. Aquesta biblioteca us permet treballar no només amb el document EMLX sinó també amb molts altres tipus de documents com ara Word, Excel, PowerPoint, correus electrònics d’Outlook, Visio, Adobe, OpenDocument, OpenOffice, Photoshop, AutoCad i molts altres. L’API de GroupDocs.Annotation per a Net us permet crear i afegir notes noves, editar anotacions, extreure comentaris i anotacions i eliminar-los dels documents. La biblioteca admet 13 tipus d’anotacions diferents, com ara text, polilínia, àrea, subratllat, punt, filigrana, fletxa, el·lipse, substitució de text, distància, camp de text, redacció de recursos en PDF, HTML, documents de Microsoft Word, fulls de càlcul, diagrames, presentacions, dibuixos, imatges i molts altres formats de fitxer. L’exemple (vegeu a continuació) mostra com es treballa amb el document EMLX, en aquest exemple podeu veure els passos principals de com treballar amb GroupDocs. Anotació: configureu una llicència, obriu un document amb el qual voleu treballar i creeu un anotació, afegint objectes de dades per establir propietats d’anotació segons els vostres requisits i desant el resultat al lloc necessari. També podeu veure més detalladament les funcions admeses a la nostra pàgina github o a la nostra documentació del producte

Passos per afegir anotacions a EMLX a Net

GroupDocs.Annotation facilita que els desenvolupadors de Net puguin afegir diversos tipus d’anotacions als fitxers EMLX dins de qualsevol aplicació basada en Net mitjançant la implementació d’uns quants passos senzills.

  • Creeu objectes de resposta amb comentari i data.
  • Creeu un objecte AreaAnnotation, configureu opcions d’àrea i afegiu respostes.
  • Creeu un objecte Annotator i afegiu una anotació d’àrea.
  • Desa el fitxer de sortida.

Requisits del sistema

GroupDocs.Annotation per a les API de xarxa són compatibles amb totes les plataformes i sistemes operatius principals. Abans d’executar el codi següent, assegureu-vos que teniu els següents requisits previs instal·lats al vostre sistema.

  • Sistemes operatius: Microsoft Windows, Linux, MacOS
  • Entorns de desenvolupament: Visual Studio, Xamarin, MonoDevelop
  • Frameworks: .NET Framework, .NET Standard, .NET Core, Mono
  • Baixeu la darrera versió de GroupDocs.Annotation per a .NET des de NuGet

Vista prèvia de l'anotació i mostra de codi

//Add text field annotation to the document from local disk
using (Annotator annotator = new Annotator("input.bmp"))
{
    TextFieldAnnotation textField = new TextFieldAnnotation
    {
        BackgroundColor = 65535,
        Box = new Rectangle(100, 100, 100, 100),
        CreatedOn = DateTime.Now,
        Text = "Some text",
        FontColor = 65535,
        FontSize = 12,
        Message = "This is text field annotation",
        Opacity = 0.7,
        PageNumber = 0,
        PenStyle = PenStyle.Dot,
        PenWidth = 3,
        FontFamily = "Arial",
        TextHorizontalAlignment = HorizontalAlignment.Center,
        Replies = new List
        {
            new Reply
            {
                Comment = "First comment",
                RepliedOn = DateTime.Now
            },
            new Reply
            {
                Comment = "Second comment",
                RepliedOn = DateTime.Now
            }
        }
    };
    annotator.Add(textField);
    annotator.Save("result.bmp");
}

Annotation preview image

Passos per eliminar les anotacions de EMLX a Net

GroupDocs.Annotation facilita als desenvolupadors de Net eliminar els detalls de les anotacions dels fitxers EMLX dins de qualsevol aplicació basada en Net mitjançant la implementació d’uns quants passos senzills.

  • Creeu objectes de resposta amb comentari i data.
  • Crea una instancia de l’objecte SaveOptions i estableix AnnotationTypes = AnnotationType.None.
  • Truqueu al mètode de desar amb la ruta o flux del document resultant i l’objecte SaveOptions.

// 1- How to remove annotation from document using annotation index

using (Annotator annotator = new Annotator("result.bmp"))
{
    annotator.Remove(0);
    annotator.Save("removed.bmp");
}

// 2- How to remove annotation from document using annotation object

using (Annotator annotator = new Annotator("result.bmp"))
{
    var tmp = annotator.Get();
    annotator.Remove(tmp[0]);
    annotator.Save("removed.bmp");
}

// 3- How to remove some annotations from document using list of ID’s

using (Annotator annotator = new Annotator("result.bmp"))
{
    var idList = new List{1, 2, 3};
    annotator.Remove(idList);
    annotator.Save("removed.bmp");
}

// 4- How to remove some annotations from document using list of annotations

using (Annotator annotator = new Annotator("result.bmp"))
{
    var tmp = annotator.Get();
    annotator.Remove(tmp);
    annotator.Save("removed.bmp");
}

Passos per editar les anotacions de EMLX a Net

GroupDocs.Annotation facilita que els desenvolupadors de Net actualitzin diverses propietats d’anotació dels fitxers EMLX dins de qualsevol aplicació basada en Net mitjançant la implementació d’uns quants passos senzills.

  • Instancia l’objecte Annotator amb la ruta del document d’entrada o el flux amb LoadOptions instància amb ImportAnnotations = true.
  • Creeu una implementació de AnnotationBase i configureu l’identificador de l’anotació existent (si no es troba l’anotació amb aquest identificador, no es canviarà res) o la llista de camins d’anotacions (s’eliminaran totes les anotacions existents).
  • Truca el mètode d’actualització de l’objecte Annotator amb anotacions passades.
  • Truqueu al mètode de desar amb la ruta o flux del document resultant i l’objecte SaveOptions.

// open annotated document
using (Annotator annotator = new Annotator("result.bmp"))
{
    //assuming we are going to change some properties of existing annotation
        AreaAnnotation updated = new AreaAnnotation
            {
                    // It's important to set existed annotation Id
                    Id = 1,
                    BackgroundColor = 255,
                    Box = new Rectangle(0, 0, 50, 200),
                    CreatedOn = DateTime.Now,
                    Message = "This is updated annotation",
                    Replies = new List
                    {
                        new Reply
                        {
                            Comment = "Updated first comment",
                            RepliedOn = DateTime.Now
                        },
                        new Reply
                        {
                            Comment = "Updated second comment",
                            RepliedOn = DateTime.Now
                        }
                    }
                };
        // update annotation
        annotator.Update(updated);
        annotator.Save("result.bmp");
}

Passos per extreure anotacions de EMLX a Net

GroupDocs.Annotation facilita als desenvolupadors de Net anotar documents i extreure informació d’anotacions dels fitxers EMLX dins de qualsevol aplicació basada en Net mitjançant la implementació d’uns quants passos senzills.

  • Creeu objectes de resposta amb comentari i data.
  • Instancia l’objecte LoadOptions i crida a SetImportAnnotations amb un argument veritable.
  • Definiu variable amb el tipus Llista.
  • Truqueu al mètode get i retorneu el resultat a la variable anterior.

// for using this example input file ("annotated.bmp") must be with annotations
using (Annotator annotator = new Annotator("annotated.bmp"))
{
    List annotations = annotator.Get();
    XmlSerializer formatter = new XmlSerializer(typeof(List));
    using (FileStream fs = new FileStream("annotations.xml", FileMode.Create))
    {
        fs.SetLength(0);
        formatter.Serialize(fs, annotations);
    }
}

Demostracions en directe per afegir, eliminar, editar i extreure anotacions a documents i imatges

Afegiu, suprimiu, editeu i extreu anotacions al fitxer EMLX ara mateix visitant el lloc web GroupDocs.Annotation Live Demos. La demostració en directe té els següents avantatges

No cal descarregar API

No cal escriure cap codi

Només heu de penjar el fitxer d'origen

Obteniu l'enllaç de descàrrega per desar el fitxer

Sobre el format de fitxer EMLX

El format de fitxer EMLX està implementat i desenvolupat per Apple. L’aplicació Apple Mail utilitza el format de fitxer EMLX per exportar els correus electrònics. També hi ha altres aplicacions que poden obrir els fitxers EMLX i convertir-los a altres formats de fitxer.

Llegeix més Sobre el format de fitxer EMLX

Treballar amb altres formats de documents populars

Actualitzeu les propietats d’anotació d’alguns dels formats de fitxer populars, tal com s’indica a continuació.

Annotate PDF document

(Adobe Portable Document Format)

Annotate DOC document

(Microsoft Word Document)

Annotate DOCM document

(Microsoft Word Macro-Enabled Document)

Annotate DOCX document

(Microsoft Word Open XML Document)

Annotate DOT document

(Microsoft Word Document Template)

Annotate DOTX document

(Word Open XML Document Template)

Annotate RTF document

(Rich Text Document)

Annotate ODT document

(Open Document Text)

Annotate XLS document

(Microsoft Excel Binary File Format)

Annotate XLSX document

(Microsoft Excel Open XML Spreadsheet)

Annotate XLSM document

(Microsoft Excel Macro-Enabled Spreadsheet)

Annotate XLSB document

(Microsoft Excel Binary Worksheet)

Annotate ODS document

(Open Document Spreadsheet)

Annotate PPT document

(PowerPoint Presentation)

Annotate PPTX document

(PowerPoint Open XML Presentation)

Annotate PPSX document

(PowerPoint Open XML Slide Show)

Annotate POTM document

(Microsoft PowerPoint Template)

Annotate PPTM document

(Microsoft PowerPoint Presentation)

Annotate PPS document

(Microsoft PowerPoint 97-2003 Slide Show)

Annotate ODP document

(OpenDocument Presentation)

Annotate HTML document

(HyperText Markup Language)

Annotate TIFF document

(Tagged Image File Format)

Annotate PNG document

(Portable Network Graphic)

Annotate EML document

(E-mail Message)

Annotate MSG document

(Microsoft Outlook E-mail Message)

Annotate VSD document

(Microsoft Visio 2003-2010 Drawing)

Annotate VSDX document

(Microsoft Visio Drawing)

Annotate VSS document

(Microsoft Visio 2003-2010 Stencil)

Annotate VST document

(Microsoft Visio 2013 Stencil)

Annotate DWG document

(Autodesk Design Data Formats)

Annotate DXF document

(AutoCAD Drawing Interchange)

Annotate DCM document

(Digital Imaging and Communications in Medicine)

Annotate WMF document

(Windows Metafile)

Annotate EMF document

(Enhanced Metafile Format)

Back to top
 Català