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;

timePDFDone = System.currentTimeMillis();

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);<o:p></o:p>

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);

May 05, 2016 1:40:30 PM org.apache.catalina.core.StandardWrapperValve invoke

INFO: ___________________START___________________

GOT IN VARIABLE : TIME TAKEN = 2

GOT IN HTML FILE : TIME = 0

>>>>TOTAL PDF CONVERSION (In below 3 parts) TiME TAKEN = hour=0: min = 0 : sec= 32

>>>>PART 1 : To load html Options = hour=0: min = 0 : sec= 0

>>>>PART 2 :TOTAL New Doc Creation = hour=0: min = 0 : sec= 32

>>>>PART 3 :TOTAL time to doc Save = hour=0: min = 0 : sec= 0

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.