Resized Pdf to Html


We’re getting “Invalid type of object” on saving to html when we’ve resized the pdf.
Aspose.Pdf version 17.6, .Net, Windows 7


var pdfEditor = new PdfPageEditor();

var page = pdfEditor.Document.Pages[1];
var ImageWidth = 640;

var coefficient = ImageWidth / (float)page.GetPageRect(true).Width;
var newHeight = (float)page.GetPageRect(true).Height * coefficient;
pdfEditor.PageSize = new PageSize(ImageWidth, newHeight);
pdfEditor.VerticalAlignmentType = VerticalAlignment.Center;
pdfEditor.HorizontalAlignment = HorizontalAlignment.Center;
pdfEditor.Zoom = coefficient;

var stream = new MemoryStream();
new Document(stream).Save(“skanner.html”, new Aspose.Pdf.HtmlSaveOptions());

skanner.pdf (876.7 KB)

Thank you for posting the source PDF document and code. We managed to replicate the said error in our environment. It has been logged under the ticket ID PDFNET-42975 in our bug tracking system. We have linked your post to this ticket and will keep you informed regarding any available updates. We are sorry for the inconvenience caused.

Best Regards,
Imran Rafique