Am 13.04.2016 um 18:37 schrieb Barry Neu:
With attachments.
"upload" isn't "send it again". However as a mod I had a look at the java:
private static PDDocument getTemplate(String urlPath) {
InputStream is = null;
PDDocument doc = new PDDocument();
try {
URL url = new URL(urlPath);
System.out.println("Connecting to " + url.toString() + "
... ");
URLConnection urlConn = url.openConnection();
if
(!urlConn.getContentType().equalsIgnoreCase("application/pdf")) {
System.out.println("FAILED.\n[Sorry. This is not a
PDF.]");
}
else {
is = url.openStream();
doc.load(is);
}
}
catch (Exception e) {
e.printStackTrace();
}
finally {
if (is != null) {
try {
is.close();
}
catch (Exception e2) {
//file close failed
}
}
}
return doc;
}
Please change
PDDocument doc = new PDDocument();
....
doc.load(is);
to this:
PDDocument doc = null;
...
doc = PDDocument.load(is);
and then try it again :-)
Tilman