You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2019/11/29 04:33:00 UTC
[jira] [Commented] (PDFBOX-4700) Error: java.net.ConnectException:
Operation timed out (Connection timed out)
[ https://issues.apache.org/jira/browse/PDFBOX-4700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16984735#comment-16984735 ]
Tilman Hausherr commented on PDFBOX-4700:
-----------------------------------------
This is not a PDFBox problem. You can't download from an URL (that works for me). You would get that error without PDFBox. My guess is that you're behind a corporate proxy => see on stackoverflow on how to fix this. Or you have a network problem.
> Error: java.net.ConnectException: Operation timed out (Connection timed out)
> ----------------------------------------------------------------------------
>
> Key: PDFBOX-4700
> URL: https://issues.apache.org/jira/browse/PDFBOX-4700
> Project: PDFBox
> Issue Type: Bug
> Reporter: Richard
> Priority: Major
>
> This is the Java Class:
> +++++++++++++++++++++++++++
> package com.pdfTrial;
> import java.io.BufferedInputStream;
> import java.net.MalformedURLException;
> import java.net.URL;
> import java.io.InputStream;
> import org.apache.pdfbox.pdmodel.PDDocument;
> import org.apache.pdfbox.text.PDFTextStripper;
> public class pdfBoxRead {
> public String readPDF() throws MalformedURLException {
> String pdfContent = "";
> URL url = new URL("http://www.africau.edu/images/default/sample.pdf");
> try {
> url.openConnection().setConnectTimeout(30000);
> InputStream is = url.openStream();
> BufferedInputStream fileParse = new BufferedInputStream(is);
> PDDocument document = null;
> document = PDDocument.load(fileParse);
> pdfContent = new PDFTextStripper().getText(document);
> System.out.println(pdfContent);
> } catch (Exception e) {
> System.out.println("Error" + e);
> }
> return pdfContent;
> }
> }
>
> *Expected Result*:
> Return the string value of PDF
>
> *Actual Result*:
> java.net.ConnectException: Operation timed out (Connection timed out)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org