←Select platform

Images Property

Summary
Gets a list of the embedded images of this PDFDocument.
Syntax
C#
C++/CLI
Java
Python
public IList<PDFImage> Images { get; } 
public java.util.List<PDFImage> getImages(); 
public: 
property IList<PDFImage>^ Images { 
   IList<PDFImage>^ get(); 
} 
Images # get  (PDFDocument) 

Property Value

A list of PDFImage contained in this PDFDocument.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Controls; 
using Leadtools.Pdf; 
using Leadtools.Svg; 
using Leadtools.WinForms; 
 
 
public void PDFDocumentImagesExample() 
{ 
   string pdfFileName = Path.Combine(LEAD_VARS.ImagesDir, @"Leadtools.pdf"); 
   string txtFileName = Path.Combine(LEAD_VARS.ImagesDir, @"LEAD_pdfImageInfo.txt"); 
 
   // Save the results to the text file for examining 
   using (StreamWriter writer = File.CreateText(txtFileName)) 
   using (PDFDocument document = new PDFDocument(pdfFileName)) 
   { 
      // Look for image objects within the PDF 
      document.ParseDocumentStructure(PDFParseDocumentStructureOptions.Images); 
 
      // Output information about each image 
      foreach (PDFImage pdfImage in document.Images) 
         WritePdfImageProperties(writer, pdfImage); 
   } 
} 
 
public void WritePdfImageProperties(StreamWriter writer, PDFImage image) 
{ 
   writer.WriteLine("PDFImage.PageNumber: {0}", image.PageNumber.ToString()); 
   writer.WriteLine("  PDFImage.ObjectNumber: {0}", image.ObjectNumber.ToString()); 
   writer.WriteLine("  PDFImage.ColorDevice: {0}", image.ColorDevice.ToString()); 
   writer.WriteLine("  PDFImage.StreamOffset: {0}", image.StreamOffset.ToString()); 
   writer.WriteLine("  PDFImage.StreamLength: {0}", image.StreamLength.ToString()); 
   writer.WriteLine("  PDFImage.BitsPerComponent: {0}", image.BitsPerComponent.ToString()); 
   writer.WriteLine("  PDFImage.ComponentCount: {0}", image.ComponentCount.ToString()); 
   writer.WriteLine("  PDFImage.BitsPerPixel: {0}", image.BitsPerPixel.ToString()); 
   writer.WriteLine("  PDFImage.Width: {0}", image.Width.ToString()); 
   writer.WriteLine("  PDFImage.Height: {0}", image.Height.ToString()); 
   writer.WriteLine("  PDFImage.ImageType: {0}", image.ImageType.ToString()); 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS22\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 22.0.2023.7.10
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.