Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
O ImagePlacementAbsorber permite que você pesquise entre imagens em todas as páginas de um documento PDF.
O seguinte trecho de código também funciona com a biblioteca Aspose.PDF.Drawing.
Para pesquisar um documento inteiro em busca de imagens:
O seguinte trecho de código mostra como pesquisar um documento por todas as suas imagens.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ExtractImagesFromPDF()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_Images();
    // Open PDF document
    using (var document = new Aspose.Pdf.Document(dataDir + "SearchAndGetImages.pdf"))
    {
        // Create ImagePlacementAbsorber object to perform image placement search
        var abs = new Aspose.Pdf.ImagePlacementAbsorber();
        // Accept the absorber for all the pages
        document.Pages.Accept(abs);
        // Loop through all ImagePlacements, get image and ImagePlacement properties
        foreach (var imagePlacement in abs.ImagePlacements)
        {
            // Get the image using ImagePlacement object
            var image = imagePlacement.Image;
            // Display image placement properties for all placements
            Console.Out.WriteLine("image width: " + imagePlacement.Rectangle.Width);
            Console.Out.WriteLine("image height: " + imagePlacement.Rectangle.Height);
            Console.Out.WriteLine("image LLX: " + imagePlacement.Rectangle.LLX);
            Console.Out.WriteLine("image LLY: " + imagePlacement.Rectangle.LLY);
            Console.Out.WriteLine("image horizontal resolution: " + imagePlacement.Resolution.X);
            Console.Out.WriteLine("image vertical resolution: " + imagePlacement.Resolution.Y);
        }
    }
}
Para obter uma imagem de uma página individual, use o seguinte código:
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ExtractImageFromAnIndividualPage()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_Images();
    // Open PDF document
    using (var document = new Aspose.Pdf.Document(dataDir + "SearchAndGetImages.pdf"))
    {
        // Create ImagePlacementAbsorber object to perform image placement search
        var abs = new Aspose.Pdf.ImagePlacementAbsorber();
        // Accept the absorber for all the pages
        document.Pages[1].Accept(abs);
    }
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.