Display PDF document stored in a ByteArrayOutputStream (not in a file)
问题 I've created a PDF document (with iText) in a file and can diplay it on the screen with: Document document = new Document(); PdfWriter.getInstance(document, filename); document.open(); // ... write something to document document.close(); Desktop.getDesktop().open(new File(filename)); // works fine :-) But on the machine of the customer my program will not have access to the filesystem, so I tried this: Document document = new Document(); ByteArrayOutputStream baos = new ByteArrayOutputStream(