Made the suggested modification and that resolved the issue - not sure how I missed that - thank you. I had sent the attachments from another email client because I wasn’t aware attachments were being stripped on the other end.
Thanks again. > On Apr 13, 2016, at 10:43 AM, Tilman Hausherr <thaush...@t-online.de> wrote: > > 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 > > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org For additional commands, e-mail: users-h...@pdfbox.apache.org