Aspose PDF Update Vesion issues

I am now updating Aspose PDF version from 11.7 to 18.5 or latest version and received following build errors. Could you please suggest the replacement/alternatives for same in new version? I am using .NET.

  • Aspose.Pdf.Generator namespace no more exist so it gives error for below class/objects/peoperty
  1. Section class
  2. Text class
  3. Row, Table, BorderInfo, BorderSide, Cell, Color, HeaderFooter, MarginInfo classes
  4. SaveType.OpenInAcrobat property
  • Also it gives error with insert the multipage tiff into the pdf like. Please suggest solution.
    ImageInfo.ImageFileType = ImageFileType.Tiff;
    ImageInfo.TiffFrame = -1;

@informit123

Thank you for contacting support.

We would like to share with you that new Document Object Model (DOM) of Aspose.PDF for .NET API includes Pages instead of Sections. You can manipulate any page as per your requirements. Text Class is present and can be used to work with text. SaveType enumeration is now obsolete and no overload of Document.Save method accepts such an argument. Moreover, please refer to below documentation articles for your kind reference.

We hope these will be helpful. Please feel free to contact us if you need any further assistance.

Thanks,

But still not able to found replacement for following, Kindly help for same.

section.PageInfo.PageWidth = PageSize.A4;
section.PageInfo.PageHeight = PageSize.A4;

var img = new Image(sec);

img.ImageInfo.ImageFileType = ImageFileType.Tiff;

sec.Paragraphs.Add(img);

img.ImageInfo.TiffFrame = -1;

@informit123

You can set PageSize for any Page as in the lines of code below:

            page.PageInfo.Height = PageSize.A4.Height;
            page.PageInfo.Width = PageSize.A4.Width;

Moreover, an image can be added on a PDF page by using below code snippet:

        Aspose.Pdf.Document doc = new Aspose.Pdf.Document();
        doc.Pages.Add();
        Aspose.Pdf.Image image = new Aspose.Pdf.Image();
        image.File = dataDir + @"\Test.tiff";
        doc.Pages[1].Paragraphs.Add(image);
        doc.Save(dataDir + @"Test_18.5.pdf");

We hope this will be helpful. Please feel free to contact us if you need any further assistance.