We have an application that we want to start to allow people to upload PDF, AI, and EPS files. So far so god but I can't figure out how to get the info such as colorspace of the file. We want to get this before processing and creating thumbnails so that we can provide appropriate alerts to the user, based on the colorspace of the file.
This is what we are using which has worked fine rasterized images but not postscript or vector based files. We have tried converting the file to a JPG first to but that ends up also converting it to an RGB file.
public string GetImageInfo(string vFilePath)
" w3wp.exe: UnableToCreateTemporaryFile ': No such file or directory @ error/pdf.c/ReadPDFImage/462"
I will appreciate any insight.
This is what we are using which has worked fine rasterized images but not postscript or vector based files. We have tried converting the file to a JPG first to but that ends up also converting it to an RGB file.
public string GetImageInfo(string vFilePath)
{
// Read from file
MagickImageInfo info = new MagickImageInfo();
// Read from stream
using (MemoryStream memStream = LoadMemoryStreamImage(vFilePath))
{
info = new MagickImageInfo(memStream);
}
// Read from byte array
byte[] data = LoadImageBytes(vFilePath);
info = new MagickImageInfo(data);
info = new MagickImageInfo();
info.Read(vFilePath);
using (MemoryStream memStream = LoadMemoryStreamImage(vFilePath))
{
info.Read(memStream);
}
info.Read(data);
string ReturnInfo = "&Width=" + info.Width;
ReturnInfo += "&Height=" + info.Height;
ReturnInfo += "&ColorSpace=" + info.ColorSpace;
ReturnInfo += "&Format=" + info.Format;
ReturnInfo += "&ResolutionX=" + info.ResolutionX;
ReturnInfo += "&ResolutionY=" + info.ResolutionY;
return ReturnInfo;
}
The error it generates indicates " w3wp.exe: UnableToCreateTemporaryFile ': No such file or directory @ error/pdf.c/ReadPDFImage/462"
I will appreciate any insight.