''' <summary>
''' Gets and prints information about PDF image resources.
''' </summary>
''' <param name="pdfFileName">The filename of PDF document.</param>
Public Shared Sub GetImageResourcesInfo(pdfFileName As String)
' open PDF document
Using document As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFileName)
' for each PDF page
For pageIndex As Integer = 0 To document.Pages.Count - 1
' get PDF page
Dim page As Vintasoft.Imaging.Pdf.Tree.PdfPage = document.Pages(pageIndex)
' get a collection of PDF image resources of page
Dim imageResources As Vintasoft.Imaging.Pdf.Tree.PdfImageResource() = page.GetImages()
' print the page index and count of image resources
System.Console.WriteLine("Page {0} Image resources count: {1}", pageIndex + 1, imageResources.Length)
' for each image resource
For Each imageResource As Vintasoft.Imaging.Pdf.Tree.PdfImageResource In imageResources
' print information about image resource
System.Console.WriteLine(vbTab & " {0}x{1} {2,5}bpp {3}", imageResource.Width, imageResource.Height, imageResource.BitsPerPixel, imageResource.Compression)
Next
Next
End Using
End Sub
' This code example produces the following output:
Page 1 Image resources count: 9
157x139 32bpp Zip
157x139 8bpp Jpeg
700x596 24bpp Jpeg
686x585 24bpp Jpeg
459x317 32bpp Jpeg
459x317 8bpp Zip, Predictor
484x487 32bpp Jpeg
484x487 8bpp Zip, Predictor
824x537 24bpp Zip
Page 2 Image resources count: 0