Free Support Forum - aspose.com

Multi-page TIFF's into PDF

Does aspose.imaging or any other products support the conversion of mutli-page tiff's into PDF files?

Thanks

Hi John,


Thanks for your inquiry. You can easily convert multi-page Tiff image to Pdf using Aspose.Pdf. Please check following documentation link for details/code snippet.


Please feel free to contact us for any further assistance.

Best Regards,

Thanks, however, I'm being told by development that this approach will not work becuase it is paragraph based and we need page based. We need a single TIFF page to equal a single PDF page. With the approach mentioned in the link, there is a chance that multiple TIFF's are applied to a single PDF page becuase of the TIFF image size.

Hi John,


Thanks for your feedback. You can easily achieve your requirements using IsAllFramesInNewPage property of ImageInfo class. Please refer to the following code snippet for the purpose.

string filename = myDir + “Multi_page.tif”;
image.ImageInfo.File = filename; ;
image.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Tiff;
image.ImageInfo.IsAllFramesInNewPage = true;

Please feel free to contact us for any further assistance.

Best Regards,

We are still having issues with multi-page tiff files.

Questions:<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />

· If the source tiff is the same XY proportion as the page, how do I scale the image to exactly fit the page, with no margins?

· Also, how do I scale the page to exactly fit the image?

Here’s the code used to convert the image:<o:p></o:p>

var pdf = new Pdf();<o:p></o:p>

var section = pdf.Sections.Add();<o:p></o:p>

var image = new
Image( section )<o:p></o:p>

{<o:p></o:p>

ImageInfo =<o:p></o:p>

{

ImageStream = sourceStream,

ImageFileType = ImageFileType.Tiff,<o:p></o:p>

IsAllFramesInNewPage = true,<o:p></o:p>

}

};

section.Paragraphs.Add( image );

pdf.Save( targetStream );

Hi John,


Sorry for the delayed response. Please check following code snippet for the requirements. Hopefully it will serve the purpose.

//scale image according to page width/height
//myImage.ImageInfo.FixWidth = section.PageInfo.PageWidth;
//myImage.ImageInfo.FixHeight= section.PageInfo.PageHeight;

Bitmap myimage = new Bitmap(path);
// scale page according to Image width and height
section.PageInfo.PageWidth=myimage.Width;
section.PageInfo.PageHeight=myimage.Height;

Please feel free to contact us for any further assistance.

Best Regards,