Hi,
I'm using the Aspose.PDF.Facades namespace in C# to extract images from PDF documents which will potentially have been created from various sources. The code we are using is working for most images encountered, but we are having issues with PDFs which contain diagrams copied from a Visio diagram. In this case the diagram is being split into many small images which together form the original diagram/image as a whole.
The following code is an example of the functionality I am using...
Document doc = new Document(stream);
PdfExtractor pdfExtractor = new PdfExtractor(doc);
pdfExtractor.StartPage = 1;
pdfExtractor.EndPage = doc.Pages.Count;
pdfExtractor.ExtractImage();
while (pdfExtractor.HasNextImage())
{
MemoryStream mem = new MemoryStream();
pdfExtractor.GetNextImage(mem);
mem.Seek(0, SeekOrigin.Begin());
// Do stuff with mem.....
}
We would like to extract the complete diagram as a single image and not the split images, is there anything I can change in our code to facilitate this? Is the extraction of Visio diagrams like this supported?
Also if I change the ExtractImageMode on the pdfExtractor to ActuallyUsed, then the split images are not extracted but neither is the whole diagram image.
I've attached a PDF which produces the issue I am describing.
Thanks in advance
Tim
I'm using the Aspose.PDF.Facades namespace in C# to extract images from PDF documents which will potentially have been created from various sources. The code we are using is working for most images encountered, but we are having issues with PDFs which contain diagrams copied from a Visio diagram. In this case the diagram is being split into many small images which together form the original diagram/image as a whole.
The following code is an example of the functionality I am using...
Document doc = new Document(stream);
PdfExtractor pdfExtractor = new PdfExtractor(doc);
pdfExtractor.StartPage = 1;
pdfExtractor.EndPage = doc.Pages.Count;
pdfExtractor.ExtractImage();
while (pdfExtractor.HasNextImage())
{
MemoryStream mem = new MemoryStream();
pdfExtractor.GetNextImage(mem);
mem.Seek(0, SeekOrigin.Begin());
// Do stuff with mem.....
}
We would like to extract the complete diagram as a single image and not the split images, is there anything I can change in our code to facilitate this? Is the extraction of Visio diagrams like this supported?
Also if I change the ExtractImageMode on the pdfExtractor to ActuallyUsed, then the split images are not extracted but neither is the whole diagram image.
I've attached a PDF which produces the issue I am describing.
Thanks in advance
Tim