Skip to content

Commit

Permalink
847303 : Change code example in "Extract images" topic.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sri-hari-haran-g committed Sep 12, 2023
1 parent f503955 commit 26ce356
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
PdfPageBase pageBase = loadedDocument.Pages[0];

//Extract images from first page.
Image[] extractedImages = pageBase.ExtractImages();
Stream[] extractedImages = pageBase.ExtractImages();

//Get each image and save to the separate file.
for(int i=0; i<extractedImages.Length; i++)
{
extractedImages[i].Save(Path.GetFullPath("../../../ExtractedImage" + i.ToString() + ".jpg"), ImageFormat.Jpeg);
File.WriteAllBytes("../../../ExtractedImage" + i.ToString() + ".jpg", (extractedImages[i] as MemoryStream).ToArray());
}

//Close the document.
Expand Down

0 comments on commit 26ce356

Please sign in to comment.