PageExtractImages Method |
Namespace: Atalasoft.Imaging.Codec.Pdf
using (FileStream file = new FileStream( string.Format(@"in.pdf", fileName), FileMode.Open, FileAccess.Read)) { Document document = new Document(new BinaryReader(file)); for (int pageIndex=0; pageIndex<document.Pages.Count; pageIndex++) { Page page = document.Pages[pageIndex]; ExtractedImageInfo[] images = page.ExtractImages(); for (int imageIndex=0; null!=images && imageIndex<images.Length; imageIndex++) { images[imageIndex].Bitmap.Save( string.Format(@"..\..\out_{0}_{1}.bmp", pageIndex, imageIndex)); } } }
Dim file As FileStream = New FileStream( _ String.Format("in.pdf", fileName), FileMode.Open, FileAccess.Read)) Document document = New Document(New BinaryReader(file)) For pageIndex As Integer = 0 To document.Pages.Count - 1 Dim page As Page = document.Pages(pageIndex) Dim images() As ExtractedImageInfo = page.ExtractImages() For imageIndex As Integer = 0 To images.Length) images(imageIndex).Bitmap.Save( _ String.Format( "..\..\out_{0}_{1}.bmp", pageIndex, imageIndex)) Next Next file.Close()