public static void ConvertFromPDF(IList<PDFAnnotation> source,AnnContainer target,LeadSizeD pdfPageSize)
source
The list of PDFAnnotation objects to fill into AnnContainer. This value must not be null.
target
The target AnnContainer is used to fill into it a list of PDFAnnotation objects. This parameter must not be null.
pdfPageSize
The size of the PDF page with the annotations.
Note:The ConvertToPDF and ConvertFromPDF methods have different signatures for WinRT and WinRTPhone. Refer to the following for the correct signatures:
public static void ConvertToPDF(AnnContainer source, IList<IPDFAnnotation> target, double pdfPageHeight)public static void ConvertFromPDF(IList<IPDFAnnotation> source, AnnContainer target, LeadSizeD pdfPageSize)
using Leadtools.Annotations.Engine;using Leadtools.Pdf.Annotations;using LeadtoolsExamples.Common;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 annotations 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"}