Very Very long time converting HTML to PDF

long htmlLoadOptTimeStart = System.currentTimeMillis();

com.aspose.pdf.HtmlLoadOptions htmloptions = new com.aspose.pdf.HtmlLoadOptions(basePath);

long newDocCreateTimeStart = System.currentTimeMillis();

com.aspose.pdf.Document doc = new com.aspose.pdf.Document(basePath + "Study_App_Ex.html", htmloptions);

long docSaveTimeStart = System.currentTimeMillis();

doc.save(basePath + "/Study_App_Example.pdf");

long docSaveTimeEnd = System.currentTimeMillis();

long totalTime_htmlLoadOptT = newDocCreateTimeStart - htmlLoadOptTimeStart;
long totalTime_NewDocCreate = docSaveTimeStart - newDocCreateTimeStart;
long totalTime_docSave = docSaveTimeEnd - docSaveTimeStart;

long timePDFDone = System.currentTimeMillis();
long TOTAL_timePDFDone = timePDFDone - timeHtmlCreated;

int h = (int) ((TOTAL_timePDFDone / 1000) / 3600);
int m = (int) (((TOTAL_timePDFDone / 1000) / 60) % 60);
int s = (int) ((TOTAL_timePDFDone / 1000) % 60);
System.out.println(">>>>TOTAL PDF CONVERSION (In below 3 parts) TiME TAKEN = hour=" + h + ": min = " + m + " : sec= " + s);

h = (int) ((totalTime_htmlLoadOptT / 1000) / 3600);
m = (int) (((totalTime_htmlLoadOptT / 1000) / 60) % 60);
s = (int) ((totalTime_htmlLoadOptT / 1000) % 60);
System.out.println(">>>>PART 1 : To load html Options = hour=" + h + ": min = " + m + " : sec= " + s);

h = (int) ((totalTime_NewDocCreate / 1000) / 3600);
m = (int) (((totalTime_NewDocCreate / 1000) / 60) % 60);
s = (int) ((totalTime_NewDocCreate / 1000) % 60);
System.out.println(">>>>PART 2 :TOTAL New Doc Creation = hour=" + h + ": min = " + m + " : sec= " + s);

h = (int) ((totalTime_docSave / 1000) / 3600);
m = (int) (((totalTime_docSave / 1000) / 60) % 60);
s = (int) ((totalTime_docSave / 1000) % 60);
System.out.println(">>>>PART 3 :TOTAL time to doc Save = hour=" + h + ": min = " + m + " : sec= " + s);

System.out.println("New pdf document creation takes 99% of the overall time. (com.aspose.pdf.Document doc = new com.aspose.pdf.Document(basePath + \"Study_App_Ex.html\", htmloptions))");

Hi William,


Thanks for using our API’s.

The time taken by API depends upon the structure and complexity of input file. Therefore we request you to please share the resource file, so that we can test the scenario in our environment. We are sorry for this inconvenience.