Free Support Forum - aspose.com

Converting color TIF to PDF

Received : 2007/12/14 11:05:23

Hi,
I am using Aspose.Pdf to convert TIF images to PDF. It works great with non-color TIF images. While trying to convert color TIF images (scanned by Kodak Image scanners using our custom applicaiton), i am having issues. Is there any limitations/conditions for converting color TIFs to PDF.
Following is the C# code snippet i tried to convert a color tiff file.
Aspose.Pdf.Pdf pdf1 = new Aspose.Pdf.Pdf();
pdf1.PageSetup.PageHeight = Aspose.Pdf.PageSize.LetterHeight;
pdf1.PageSetup.PageWidth = Aspose.Pdf.PageSize.LetterWidth;
Aspose.Pdf.Section sec1 = pdf1.Sections.Add();
Aspose.Pdf.Image image1 = new Aspose.Pdf.Image(sec1);
image1.ImageInfo.FixHeight = Aspose.Pdf.PageSize.LetterHeight;
image1.ImageInfo.FixWidth = Aspose.Pdf.PageSize.LetterWidth;
sec1.Paragraphs.Add(image1);
image1.ImageInfo.TiffFrame = -1;
image1.PositioningType = PositioningType.PageRelative;
image1.ImageInfo.File = txtSecondFile.Text; // Input file name by a text box
image1.ImageInfo.ImageFileType = ImageFileType.Tiff;
image1.ImageInfo.IsAllFramesInNewPage = true;

pdf1.Save(txtSecondFile.Text + ".PDF");
Your help is much appreciated.
Thanks
SG

This message was posted using Aspose.Live 2 Forum

Hi,

Can you please provide us with the TIF images that you are having problems with. Also include the produced PDF accompanied by a detailed description of the problem. This way we can more accurately determine the cause of the problem.

Thanks.

Hi,
Attached is the TIF file I tried to convert. A pdf file was n't created. An error "can't open the file" error was thrown out at the Save method of pdf object.
Thanks
SG
Additional Error info (C# app)
Exception Message:
"Can't open image file C:\\Utility Apps\\AsposePDFMerge\\SampleFiles\\TempDoc_414461_1.tif"
Exception StackTrace:
at Aspose.Pdf.Figure.ଔ.ଖ(Image ܈, ImageFileType ଗ, String ଘ, String ଙ, String ଚ, Int32 ଛ, Int32 ଜ, Boolean ଝ, Boolean ଞ, Byte[] ଟ, Stream ଠ)\r\n at Aspose.Pdf.Xml.ᐪ.ᐯ(Pdf ᇭ, Image ܈)\r\n at Aspose.Pdf.Xml.ᒆ.ᒇ(Pdf ᇭ, Section ᎌ, Table Ԋ, Row ገ, Cell ᆼ, Image ܈, ᅥ ᅷ, Ꮊ ᐴ, Boolean ᐵ)\r\n at Aspose.Pdf.Xml.ᓢ.ᓤ(Pdf ᇭ, Section ᎂ, ᅥ ᅷ)\r\n at Aspose.Pdf.Xml.ճ.፨(Pdf ᇭ)\r\n at Aspose.Pdf.Xml.ᇧ.ᇬ(૩ ૞, Pdf ᇭ)\r\n at Aspose.Pdf.Pdf.Save(String pdfFile)\r\n at MergeDocs.Form1.button1_Click(Object sender, EventArgs e) in C:\\Utility Apps\\AsposePDFMerge\\MergeDocs\\MergeDocs\\Form1.cs:line 185

Hi,

I have tested the file and was able to reproduce the error. I have logged this as PDFNET-4181 in our issue tracking system. We will try our best to resolve this issue as soon as possible.

Thanks.

Hi,
Any updates to this?
Thanks

Hi,

We will try our best to resolve this problem before 15th, Jan.

Best regards.

Hi Hans,
Any updates from your dev team?
Thanks
SG

Hi,

This issue is still under processing at present. I am sorry we can’t fix it in time. We may need about five days more to offer an update. We appreciate your patience.

Best regards.

Hi,
We are approaching the end of our project dev phase and need a solution soon. Appreciate if you could expedite this issue.
Thanks
SG

Hi,

Sorry for the delay of this task. After investigating this problem we found it is not easy to support this image. This image is strage and I can’t open it with MS print. If I open it with some image viewer (such as Acdsee) and resave it, then Aspose.Pdf can support the resaved file. So we still can’t support this image in short time. As a workaround you can resave your image.