Defines a class that converts between AnnObject annotation objects and PDFAnnotation annotation objects.
public static class AnnPDFConvertorPublic MustInherit NotInheritable Class AnnPDFConvertorpublic sealed static class AnnPDFConvertorfunction Leadtools.Annotations.Documents.AnnPDFConvertor()AnnPDFConvertor loads a PDF file with its annotations to allow conversion into AnnObject. Conversely, loads AnnObject to allow embedding core annotation objects into a PDF file by converting it to PDFAnnotation.
This example demonstrates how to convert from AnnObject objects to PDFAnnotation objects and vice versa.
Imports LeadtoolsImports Leadtools.Annotations.CoreImports Leadtools.Annotations.DocumentsImports Leadtools.Pdf<TestMethod()> _Public Sub AnnPDFConvertor_AnnPDFConvertor()'Create some annotation objects and add it to containerDim rectangle As AnnRectangleObject = New AnnRectangleObject()Dim text As AnnTextObject = New AnnTextObject()'Create new container and annotation object to itDim container As AnnContainer = New AnnContainer()container.Children.Add(rectangle)container.Children.Add(text)'Create list of PDFAnnotation as target of our conversionDim pdfAnnotations As List(Of PDFAnnotation) = New List(Of PDFAnnotation)()'Convert fro core annotation object to PDF annotation objectsAnnPDFConvertor.ConvertToPDF(container, pdfAnnotations, 800)'Print the count of converted objectsDebug.WriteLine(pdfAnnotations.Count) ' the result will be "2"'Now convert from PDF annotation objects to our core annotation objectsDim newContainer As AnnContainer = New AnnContainer()'Assume the size of pdf page that we want to add anotations to is 600*800AnnPDFConvertor.ConvertFromPDF(pdfAnnotations, newContainer, LeadSizeD.Create(600, 800))'Print the count of converted objectsDebug.WriteLine(newContainer.Children.Count) ' the result will be "2"End Sub
using Leadtools.Annotations.Core;using Leadtools.Annotations.Documents;using Leadtools.Pdf;public void AnnPDFConvertor_AnnPDFConvertor(){//Create some annotation objects and add it to containerAnnRectangleObject rectangle = new AnnRectangleObject();AnnTextObject text = new AnnTextObject();//Create new container and annotation object to itAnnContainer container = new AnnContainer();container.Children.Add(rectangle);container.Children.Add(text);//Create list of PDFAnnotation as target of our conversionList<PDFAnnotation> pdfAnnotations = new List<PDFAnnotation>();//Convert fro core annotation object to PDF annotation objectsAnnPDFConvertor.ConvertToPDF(container, pdfAnnotations, 800);//Print the count of converted objectsDebug.WriteLine(pdfAnnotations.Count); // the result will be "2"//Now convert from PDF annotation objects to our core annotation objectsAnnContainer newContainer = new AnnContainer();//Assume the size of pdf page that we want to add anotations to is 600*800AnnPDFConvertor.ConvertFromPDF(pdfAnnotations, newContainer, LeadSizeD.Create(600, 800));//Print the count of converted objectsDebug.WriteLine(newContainer.Children.Count); // the result will be "2"}
|
Products |
Support |
Feedback: AnnPDFConvertor Class - Leadtools.Annotations.Documents |
Introduction |
Help Version 19.0.2017.3.22
|

Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.