Hi,
I'm trying to convert .TIF file to PDF. We're using the 5.2 version of the Aspose.Pdf product. This works fine on my Windows 7 development machine, but doesn't work on Windows XP or Window 2003 or Windows 2008 machines.
I an error stating "A generic error occured in GDI+"
I used the provided C# example code provided in converting an image to PDF. Also the image I am trying to convert is attached.
Initially I posted this under Aspose.Word product family by mistake. Please ignore the other post.
Please let me know if there is a workaround for this issue.
Thanks
Suhas
string tempFileName = Path.GetTempFileName();
//Instantiate a Pdf object by calling its empty constructor
Pdf pdf1 = new Pdf();
//Create a section in the Pdf object
Aspose.Pdf.Section sec1 = pdf1.Sections.Add();
//Create an image object in the section
Aspose.Pdf.Image image1 = new Aspose.Pdf.Image(sec1);
//Add image object into the Paragraphs collection of the section
sec1.Paragraphs.Add(image1);
//Set the path of image file
image1.ImageInfo.File = txtSourcePath.Text;
//Set the type of image using ImageFileType enumeration
try
{
using (System.Drawing.Image img = System.Drawing.Image.FromFile(txtSourcePath.Text))
{
if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Jpeg))
{
image1.ImageInfo.ImageFileType = ImageFileType.Jpeg;
}
else if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Bmp))
{
image1.ImageInfo.ImageFileType = ImageFileType.Bmp;
}
else if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Gif))
{
image1.ImageInfo.ImageFileType = ImageFileType.Gif;
}
else if (img.RawFormat.Equals(System.Drawing.Imaging.ImageFormat.Tiff))
{
image1.ImageInfo.ImageFileType = ImageFileType.Tiff;
}
}
}
catch { }
//Save the Pdf
pdf1.Save(tempFileName);
v