We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Html to PDF and Wo

I know that theres already a post of this in the fourm link (please dont give me a reply like kindly read that post and that i needed your help and an actual file for this not a referal link.)

  1. I needed an agent that will assist me in buying your product. That is if we manage to overcome those challenges above.


Hi Joebet,

Thanks for your inquiry. I would suggest you please upgrade to the latest version (v13.5.0) from here and use following code snippet to resize large images.

Document doc = new Document(MyDir + "test.html");
foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true))
doc.Save(MyDir + "out.pdf");
public static void ResizeLargeImage(Shape image)
    // Return if this shape is not an image.
    if (!image.HasImage)
    // Calculate the free space based on an inline or floating image. If inline we must take the page margins into account.
    PageSetup ps = image.ParentParagraph.ParentSection.PageSetup;
    double freePageWidth = image.IsInline ? ps.PageWidth - ps.LeftMargin - ps.RightMargin : ps.PageWidth;
    double freePageHeight = image.IsInline ? ps.PageHeight - ps.TopMargin - ps.BottomMargin : ps.PageHeight;
    ImageSize size = image.ImageData.ImageSize;
    Boolean exceedsMaxPageSize = size.WidthPoints > freePageWidth || size.HeightPoints > freePageHeight;
    if (exceedsMaxPageSize)
        // Calculate the ratio to fit the page size based on which side is longer.
        Boolean widthLonger = (size.WidthPoints > size.HeightPoints);
        double ratio = widthLonger ? freePageWidth / size.WidthPoints : freePageHeight / size.HeightPoints;
        // Set the new size.
        image.Width = size.WidthPoints * ratio;
        image.Height = size.HeightPoints * ratio;

Regarding CSS and inline style, please note that upon processing HTML some features of HTML might be lost. You can find a list of limitations upon HTML exporting/importing here:


  1. I needed an agent that will assist me in buying your product. That is if we manage to overcome those challenges above.

Please post your query at Aspose.Purchase forum. My colleagues from sales team will reply you about your query.

great support thanks!

Hi Joebet,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.