How we Extract Image from pdfSanwar Ranwa8yAsked Jan 23, 2018, 2:55 AM ESTSolvedShareLinkedInXCopy linkSaveHow i extract image from Pdg and display it in Image in Asp.net Webform
How we Extract Image from pdfSanwar Ranwa8yAsked Jan 23, 2018, 2:55 AM ESTSolvedShareLinkedInXCopy linkSaveHow i extract image from Pdg and display it in Image in Asp.net Webform
Vipin MittalRank #482 · 5.1K reputation8y agoPosted Jan 23, 2018, 8:14 PM EST✓ Accepted answer+4below link very help full for this : https://bytescout.com/products/developer/pdfextractorsdk/how-to-extract-images-from-pdf-using-pdf-extractor-sdk-in-asp-net-csharp-vbnet-and-vbscript +4
MAMohamed AbedallahRank #2,074 · 697 reputation8y agoPosted Feb 1, 2018, 5:06 AM EST+3Using LEADTOOLS you can easily extract images from the PDF with a few lines similar to this code:using (PDFDocument document = new PDFDocument(sourceFileName)) { document.Resolution = 200; // Parse the objects in all pages document.ParsePages(PDFParsePagesOptions.Objects, 1, -1); RasterCodecs codecs = new RasterCodecs(); foreach (PDFDocumentPage page in document.Pages) if (page.Objects != null && page.Objects.Count > 0) foreach (PDFObject obj in page.Objects) if (obj.ObjectType == PDFObjectType.Image) using (RasterImage image = document.DecodeImage(obj.ImageObjectNumber)) codecs.Save(image, destinationFileName, RasterImageFormat.TifLzw, image.BitsPerPixel, 1, 1, -1, CodecsSavePageMode.Append); codecs.Dispose(); } If you don't have LEADTOOLS, you can get a free evaluation from this page:https://www.leadtools.com/downloads?category=main+3Rupesh KahaneRank #136 · 16.4K reputation8y agoPosted Jan 23, 2018, 5:47 AM EST+2Please refer below articles 1) https://psycodedeveloper.wordpress.com/2013/01/10/how-to-extract-images-from-pdf-files-using-c-and-itextsharp/2) https://www.aspsnippets.com/Articles/Export-ASPNet-Web-Page-with-images-to-PDF-using-ITextsharp.aspx3) https://bytescout.com/products/developer/pdfextractorsdk/how-to-extract-images-from-pdf-using-pdf-extractor-sdk-in-asp-net-csharp-vbnet-and-vbscriptAll the best +2AYalice yangRank #2,329 · 607 reputation8y agoPosted Jan 23, 2018, 3:32 PM EST+2You can use Spire.PDF to easily extract images from PDF. https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/How-to-Extract-Image-From-PDF-in-C.html +2Sanwar RanwaRank #23 · 44.7K reputation8y agoPosted Jan 23, 2018, 7:20 PM EST+2Thank you @gajendra sir +2Sanwar RanwaRank #23 · 44.7K reputation8y agoPosted Jan 23, 2018, 8:34 PM EST+2thanks+2Gajendra JangidRank #157 · 14.9K reputation8y agoPosted Jan 23, 2018, 7:18 PM EST+1 use this method it will workpublic void ExtractPage(string sourcePdfPath, string outputPdfPath, int pageNumber, string password) { iTextSharp.text.pdf.PdfReader reader = null; iTextSharp.text.Document document = null; iTextSharp.text.pdf.PdfCopy copy = null; iTextSharp.text.pdf.PdfImportedPage iPage = null; try { iTextSharp.text.pdf.PdfReader.unethicalreading = true; reader = new iTextSharp.text.pdf.PdfReader(sourcePdfPath, Encoding.ASCII.GetBytes(password)); document = new iTextSharp.text.Document(reader.GetPageSizeWithRotation(pageNumber)); copy = new iTextSharp.text.pdf.PdfCopy(document, new System.IO.FileStream(outputPdfPath, System.IO.FileMode.Create)); document.Open(); iPage = copy.GetImportedPage(reader, pageNumber); copy.AddPage(iPage); document.Close(); reader.Close(); } catch (Exception exception) { MessageBox.Show(exception.Message); throw exception; } }+1Vipin MittalRank #482 · 5.1K reputation8y agoPosted Jan 23, 2018, 10:45 PM EST+1u can also develop a tool for this using itextsharp..and read full pdf file and extrct images and text all thingss..+1KLKevin Lau3 reputation8y agoPosted Sep 16, 2018, 9:00 PM EDT0also here is another way to extract images from a PDF filehttps://youtu.be/-UngouSPhmM0Join to answer this questionEvery answer you publish earns 20 SHARP.Create free accountSign inKnow the answer?Answer a question in the forums and earn +20 SHARP for every answer.See unanswered questionsForumsTop experts01Arun PottiAnswers in the forums20answers02Tahir AnsariAnswers in the forums5answers03Kamlesh KumarAnswers in the forums5answers04Sam HobbsAnswers in the forums4answers05Željko PerićAnswers in the forums3answers?YouYour name goes here.Every answer: 20 SHARP.JoinFull leaderboard →2026DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rupesh KahaneRank #136 · 16.4K reputation8y agoPosted Jan 23, 2018, 5:47 AM EST+2Please refer below articles 1) https://psycodedeveloper.wordpress.com/2013/01/10/how-to-extract-images-from-pdf-files-using-c-and-itextsharp/2) https://www.aspsnippets.com/Articles/Export-ASPNet-Web-Page-with-images-to-PDF-using-ITextsharp.aspx3) https://bytescout.com/products/developer/pdfextractorsdk/how-to-extract-images-from-pdf-using-pdf-extractor-sdk-in-asp-net-csharp-vbnet-and-vbscriptAll the best +2
AYalice yangRank #2,329 · 607 reputation8y agoPosted Jan 23, 2018, 3:32 PM EST+2You can use Spire.PDF to easily extract images from PDF. https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/How-to-Extract-Image-From-PDF-in-C.html +2
Sanwar RanwaRank #23 · 44.7K reputation8y agoPosted Jan 23, 2018, 7:20 PM EST+2Thank you @gajendra sir +2
Gajendra JangidRank #157 · 14.9K reputation8y agoPosted Jan 23, 2018, 7:18 PM EST+1 use this method it will workpublic void ExtractPage(string sourcePdfPath, string outputPdfPath, int pageNumber, string password) { iTextSharp.text.pdf.PdfReader reader = null; iTextSharp.text.Document document = null; iTextSharp.text.pdf.PdfCopy copy = null; iTextSharp.text.pdf.PdfImportedPage iPage = null; try { iTextSharp.text.pdf.PdfReader.unethicalreading = true; reader = new iTextSharp.text.pdf.PdfReader(sourcePdfPath, Encoding.ASCII.GetBytes(password)); document = new iTextSharp.text.Document(reader.GetPageSizeWithRotation(pageNumber)); copy = new iTextSharp.text.pdf.PdfCopy(document, new System.IO.FileStream(outputPdfPath, System.IO.FileMode.Create)); document.Open(); iPage = copy.GetImportedPage(reader, pageNumber); copy.AddPage(iPage); document.Close(); reader.Close(); } catch (Exception exception) { MessageBox.Show(exception.Message); throw exception; } }+1
Vipin MittalRank #482 · 5.1K reputation8y agoPosted Jan 23, 2018, 10:45 PM EST+1u can also develop a tool for this using itextsharp..and read full pdf file and extrct images and text all thingss..+1
KLKevin Lau3 reputation8y agoPosted Sep 16, 2018, 9:00 PM EDT0also here is another way to extract images from a PDF filehttps://youtu.be/-UngouSPhmM0
Vipin MittalRank #482 · 5.1K reputationPosted Jan 23, 2018, 8:14 PM EST
Mohamed AbedallahRank #2,074 · 697 reputationPosted Feb 1, 2018, 5:06 AM EST
Rupesh KahaneRank #136 · 16.4K reputationPosted Jan 23, 2018, 5:47 AM EST
2) https://www.aspsnippets.com/Articles/Export-ASPNet-Web-Page-with-images-to-PDF-using-ITextsharp.aspx
3) https://bytescout.com/products/developer/pdfextractorsdk/how-to-extract-images-from-pdf-using-pdf-extractor-sdk-in-asp-net-csharp-vbnet-and-vbscript
alice yangRank #2,329 · 607 reputationPosted Jan 23, 2018, 3:32 PM EST
Sanwar RanwaRank #23 · 44.7K reputationPosted Jan 23, 2018, 7:20 PM EST
Sanwar RanwaRank #23 · 44.7K reputationPosted Jan 23, 2018, 8:34 PM EST
Gajendra JangidRank #157 · 14.9K reputationPosted Jan 23, 2018, 7:18 PM EST
Vipin MittalRank #482 · 5.1K reputationPosted Jan 23, 2018, 10:45 PM EST
Kevin Lau3 reputationPosted Sep 16, 2018, 9:00 PM EDT
also here is another way to extract images from a PDF file
https://youtu.be/-UngouSPhmM
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts