Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
ExtractAnnotations método permite que você extraia anotações de um arquivo PDF. Para extrair anotações, você precisa criar um objeto PdfAnnotationEditor e vincular o arquivo PDF usando o método BindPdf. Depois disso, você precisa criar uma enumeração dos tipos de anotações que deseja extrair do arquivo PDF.
Você pode então usar o método ExtractAnnotations para extrair as anotações para um ArrayList. Depois disso, você pode percorrer essa lista e obter anotações individuais. E finalmente, salve o arquivo PDF atualizado usando o método Save do objeto PdfAnnotationEditor. O seguinte trecho de código mostra como extrair anotações de um arquivo PDF.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ExtractAnnotation()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdfFacades_Annotations();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "AnnotationsInput.pdf"))
{
using (var annotationEditor = new Aspose.Pdf.Facades.PdfAnnotationEditor())
{
// Bind PDF document
annotationEditor.BindPdf(document);
// Extract annotations
var annotationTypes = new[] { Aspose.Pdf.Annotations.AnnotationType.FreeText, Aspose.Pdf.Annotations.AnnotationType.Text };
var annotations = annotationEditor.ExtractAnnotations(1, 2, annotationTypes);
foreach (var annotation in annotations)
{
Console.WriteLine(annotation.Contents);
}
}
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.