Hi,
With Aspose.Total 17.2 I used the Aspose.Pdf.Generator.Pdf to create a PDF from TIFF files. In the latest version the Aspose.Pdf.Generator.Pdf is removed. How can I produce the same result with the new Aspose.Pdf?
See the code below. I use GetAllPages to return a list of all pages/images from the TIFF file as System.Drawing.Image.
Aspose.Pdf.Generator.Pdf doc = new Aspose.Pdf.Generator.Pdf();
List<System.Drawing.Image> imagePages = GetAllPages(inputFileName);
foreach (System.Drawing.Image imagePage in imagePages)
{
Aspose.Pdf.Generator.Section section = doc.Sections.Add();
Aspose.Pdf.Generator.Image image = new Aspose.Pdf.Generator.Image(section);
section.PageInfo.Margin.Bottom = 0;
section.PageInfo.Margin.Top = 0;
section.PageInfo.Margin.Left = 0;
section.PageInfo.Margin.Right = 0;
image.ImageInfo.SystemImage = imagePage;
image.ImageInfo.ImageFileType = Aspose.Pdf.Generator.ImageFileType.Tiff;
section.PageInfo.PageWidth = (imagePage.Width / imagePage.HorizontalResolution) * 72;
section.PageInfo.PageHeight = (imagePage.Height / imagePage.VerticalResolution) * 72;
section.Paragraphs.Add(image);
}
string outputFileName = Path.Combine(outputPath, Path.ChangeExtension(Path.GetFileName(inputFileName), ".pdf"));
doc.Save(outputFileName);