Hello,
I am using Java Embedding APIs of XULRUNNER 1.9 to save a loaded HTML
file to a PDF file (print as PDF). The problem is that few of my
images (random every time) disappears in my PDF. It looks as though
the PDF is generated even before all the images are loaded completely.
I am not sure about the method I am using to check the end of loading
is correct or am I missing anything in <b>all.js</b>? (using
network.http.pipelining=false)
Here is my code:
....
webNavProxy.loadURI (urlToLoad,
nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE,
null, null, null); // where
webNavProxy is a proxy object of nsIWebNavigation
while(!loadingComplete){
// sleep for 1 sec
}
.....
and ..
public class WebProgressListener implements
nsIWebProgressListener,nsISupports
{
....
public void onStateChange(nsIWebProgress wp, nsIRequest req,
long sflag, long status)
{
boolean isLoading = wp.getIsLoadingDocument();
boolean isDocument = (sflag &
nsIWebProgressListener.STATE_IS_DOCUMENT) != 0;
boolean start = (sflag &
nsIWebProgressListener.STATE_START) !=0;
boolean stop = (sflag &
nsIWebProgressListener.STATE_STOP) !=0;
if((!isLoading) && (!start) && (!isDocument) && stop)
{
loadingComplete = true;
... //process the loaded document and print
as pdf
}
}
}
Please help.
Thanks in advance.
-Saravanan-
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding