I have a PDF form that I’m converting to tif using the code below. Sometimes some of the values are missing in the fields in the tif. I cannot attach the PDF as it has sensitive information on the form. I haven’t been able to source a PDF that doesn’t have sensitive data.
private ImageData RenderAsposePage()
{
// Using Aspose
var device = new TiffDevice(new Resolution((int)this.Resolution.X, (int)this.Resolution.Y));
try
{
// Do not enforce the color depth here, keep it as default
device.Settings.Depth = ColorDepth.Default;
}
catch (Exception ex)
{
// If we have an exception, we don’t want to rely on Aspose for conversion, return null to indicate this is no good
return null;
}
var pageStream = new MemoryStream();
device.Process(m_parent.AsposeDocument, this.PageNo + 1, this.PageNo + 1, pageStream);
pageStream.Position = 0;
return new BitmapImageData(pageStream);
}