You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using(varreader=newPdfReader(filePath)){for(intpageNumber=1;pageNumber<=reader.NumberOfPages;pageNumber++){// Create a new parser object to extract images from the pagePdfDictionarypageDictionary=reader.GetPageN(pageNumber);PdfDictionaryresourcesDictionary=pageDictionary.GetAsDict(PdfName.Resources);PdfDictionaryxObjectDictionary=resourcesDictionary.GetAsDict(PdfName.Xobject);if(xObjectDictionary==null){continue;}foreach(PdfNamenameinxObjectDictionary.Keys){PdfObjectobj=xObjectDictionary.Get(name);if(!obj.IsIndirect()){continue;}PdfDictionaryimageDictionary=(PdfDictionary)PdfReader.GetPdfObject(obj);if(imageDictionary==null||!imageDictionary.Get(PdfName.Subtype).Equals(PdfName.Image)){continue;}varimage=Image.GetInstance((PrIndirectReference)obj);// TODO: convert to SKBitmap and save as PNG}}}
The text was updated successfully, but these errors were encountered:
I want to export images from PDF as PNGs.
The text was updated successfully, but these errors were encountered: