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

Free Support Forum - aspose.com

Html with js to Image not working- reposting to HTML

Hi team,
Good Day.

I have a requirement , where in I have to convert an html file, having js, to image without rendering the html in the browser via JAVA. Basically like a screenshot from a static html page which has js.

Does aspose support any such functionality ??
I found this code in the aspose forum , but it gives image of static html without JavaScript

Document doc = new 
       Document(ImageConvert.class.getResourceAsStream("index.html"));

        for (int page = 0; page < doc.getPageCount(); page++)
        {
            Document extractedPage = doc.extractPages(page, 1);
            extractedPage.save(String.format("Output_%d.jpg", page + 1));
        }

        } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }

@mrajgopal.22

Please refer to the following article about HTML to image conversion.
HTML to Image Conversion

If you still face problem, please share your input HTML and expected output image file here for testing. We will investigate the issue and provide you more information on it.