Hi there.
I am trying to convert TIFF to PDF with such code:
Pdf doc = new Pdf();
Section section = doc.Sections.Add();
section.PageInfo.Margin.Top = 0;
section.PageInfo.Margin.Left = 0;
section.PageInfo.Margin.Right = 0;
section.PageInfo.Margin.Bottom = 0;
Aspose.Pdf.Image image = new Aspose.Pdf.Image(section);
section.Paragraphs.Add(image);
image.ImageInfo.ImageStream = sourceStream;
image.ImageInfo.ImageFileType = ImageFileType.Tiff;
image.ImageInfo.IsAllFramesInNewPage = true;
image.ImageInfo.TiffFrame = -1;
doc.Save(resultStream);
The input TIFF is a multi-page image and every page has its own width and height.
And the output PDF have pages with similar wifth and height. The input TIFF in attachments.
How can I solve it?
Thank you
Hi,
Thanks for using our products.
Please try using section.IsLandscape = true; following code line to set the page orientation to Landscape so that all the frames of TIFF image are properly displayed. For your convenience, I have also attached the resultant PDF that I have generated. Please take a look.
In case it does not satisfy your requirements or you have any further query, please feel free to contact. We apologize for your inconvenience.
Thanks for your reply.
The problem is that I don’t know why I should set this flag and why not. The input image can contain both album and landscape orientation pages, so the programm should handle this properly (i.e. convert each page according to its orientation).
Hi,
I am afraid in current release version, it's not possible to access specific frame of the TIFF image so we cannot set the page orientation according to the image dimensions. We are looking into the details of this requirement and will keep you update on the status of correction. We apologize for your inconvenience.
This is bad.
Maybe we’ll go another way: is there any other solution of TIFF to PDF convertion?
Thanks
Hi,
We have another product named Aspose.Words which provides the capability to create/edit/manipulate/transform MS word documents. It also provides the capability to insert images into word document and then transform that word file into PDF format. May be you can try using this approach and see if it can resolve your problem. For more related information, please visit How-to: Convert an Image to PDF
We are sorry for your inconvenience.
Hi, Nayyer.
It seems that solution you suggested (via Aspose.Words) works fine.
Thank you very much.
The topic is closed.