Configuring CSS/Javascript resources in Aspose.HTML


#1

Hi.

I am using Aspose.HTML for Java/jsp and I try to convert an existing html page to .pdf format without success.

The html code contains references to external stylesheet and javascript resources like images and jquery libs.

Sample code below:

<script language="Javascript" type="" src="<%=segmentPath%>js/jquery-1.12.4.min.js"></script>

<style>
.teamIcon {
		height: 24px;
                width: 24px;
		background: url('img/Team.png');
}
</style>

<body>
            <div>
                <ul>
                    <li class="noBullet">
                        <div class="teamIcon"></div>
                        <div>sample text</div>
                  </li>

etc etc…

I used the following example code: https://github.com/aspose-pdf/Aspose.PDF-for-Java/blob/master/Examples/src/main/java/com/aspose/pdf/examples/AsposePdfExamples/DocumentConversion/ConvertHTMLToPDFFormat.java

Is it possible to explicitly declare the css/javascript resource paths for my html document before the html-to-pdf conversion?
Is it possible for Aspose.HTML to properly convert to pdf that kind of html code?

Thank you in advance for your time.


#2

@karantzad

Thank you for contacting support.

Would you please share the source HTML file along with all necessary resources as a ZIP file, so that we may investigate the scenario and then share our findings with you accordingly.