Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/378.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java iText PDF无法转换外部图像_Java_Pdf_Timeout_Itext_Ping - Fatal编程技术网

Java iText PDF无法转换外部图像

Java iText PDF无法转换外部图像,java,pdf,timeout,itext,ping,Java,Pdf,Timeout,Itext,Ping,我在java应用程序中使用iText2.08将html转换为pdf。但是当html中有一个指向外部图像的链接时,pdf转换将在下面代码的第7行停止 1. File f = new File(fileName); 2. os = new BufferedOutputStream(new FileOutputStream(f)); 3. String html = getFileAsString(new File(inp

我在java应用程序中使用iText2.08将html转换为pdf。但是当html中有一个指向外部图像的链接时,pdf转换将在下面代码的第7行停止

                    1. File f = new File(fileName);
            2. os = new BufferedOutputStream(new FileOutputStream(f));
        3. String html = getFileAsString(new File(inputFileName));
        4. Document doc = getStringAsXMLDocument(html);
        5. ITextRenderer renderer = new ITextRenderer();
        6. renderer.setDocument(doc, null);
        7. renderer.layout();
        8. renderer.createPDF(os);
在第7行,renderer.layout();没有完全执行,并且我无法查看方法layout()中的哪一行在类文件中被停止。我猜,由于应用程序无法ping(图像的)外部url,它会尝试无数次ping它。那么,有没有办法克服这个问题?在itext ping外部站点图像时,是否有方法设置超时