Html String to PDF conversion by using HtmlFragment - CSS is not being applied

I am using aspose PDF version 19. and i am facing problem with generating PDF using HtmlFragment. In Our application , we are using external css and images, but external css styles are not apply on generated PDF. is there any solution for the same.
below is my code snippet.
or any other solution with Aspose Html or aspose Words.

com.aspose.pdf.Document doc = new com.aspose.pdf.Document();
PageInfo pageInfo = new PageInfo();
HtmlLoadOptions options = new HtmlLoadOptions(baspath);
options.CustomLoaderOfExternalResources = new LoadOptions.ResourceLoadingStrategy() {

            @Override
            public LoadOptions.ResourceLoadingResult invoke(String resourceURI) {
                LoadOptions.ResourceLoadingResult res = new LoadOptions.ResourceLoadingResult(new byte[] {});
                // Return empty byte array in case i.imgur.com server
                    res.LoadingCancelled = true;
                    return res;
                }
        };
        pageInfo.setHeight(PageSize.getA4().getHeight());
        pageInfo.setWidth(PageSize.getA4().getWidth());
        com.aspose.pdf.Page page = doc.getPages().add();
        options.setPageInfo(pageInfo);
        HtmlFragment htmlFragment = new HtmlFragment(file);
        htmlFragment.setHtmlLoadOptions(options);
        htmlFragment.setHorizontalAlignment(HorizontalAlignment.Left);
        page.getParagraphs().add(htmlFragment);
        doc.save("report.pdf");

@pkr89singh

Your code snippet seems fine and it should generate the output with all resources. In case you are facing some issue, please share your sample HTML in .zip format with us. We will test the scenario in our environment and address it accordingly. Also, please try using 20.10 version of the API if it helps.