Hi,
I’m trying to add Javascript to an existing Pdf document in a servlet. It doesn’t fail or give me any errors, but the returned Pdf doesn’t open the print dialog on open. It does have the watermark, “Evaluation Only. Created with Aspose.Pdf…”. I’m using a trial version to see if it will meet my project requirements. Is this functionality disabled in the trial version, or is something wrong with my code?
response.setContentType(“application/pdf”);
Part filePart = request.getPart(“file”);
InputStream fileContent = filePart.getInputStream();
Document doc = new Document(fileContent);
JavascriptAction javaScript=new JavascriptAction(“this.print({bUI:true,bSilent:false});”);
doc.setOpenAction(javaScript);
doc.save(response.getOutputStream());
Thanks in advance
Jeff