Rendering a given PDF, renders the image of the signature as black (I guess the image is a transparent PNG image)test.pdf (104.1 KB)
Test.png (155.0 KB)
using (Document doc = new Document(@"C:\Test.pdf"))
{
PngDevice device = new PngDevice();
Page page = doc.Pages[1];
using (MemoryStream ms = new MemoryStream())
{
device.Process(page, ms);
File.WriteAllBytes(@"C:\Test.png", ms.ToArray());
}
Resources resources = page.Resources;
XForm xform = resources.Forms[1];
Resources xFormResources = xform.Resources;
XImage xImage = xFormResources.Images[1];
// Try to extract the problematic image fails, because xImage.ToStream() returns a truncated stream;
Stream stream = xImage.ToStream();
}