I am creating a PDF file from a Java application. (And it works fine) the problem is that the PDF is created on disk as:
Document documento = new Document(PageSize.A4, 25, 25, 25, 25); PdfWriter writer = PdfWriter.getInstance(documento, new FileOutputStream("/Users/sheldon/Desktop/Registry.pdf")); documento.open(); // Put some images on the PDF for( byte[] imagen : imagenes ) { Image hoja = Image.getInstance(imagen); hoja.scaleToFit(documento.getPageSize().getHeight(), documento.getPageSize().getWidth()); documento.add(hoja); } documento.addTitle("Generated Registry!"); documento.close();
Now that the user will search for the PDF file and print it, I do not need to store them on disk. I need (if possible) to generate them in memory and use the command to open (using acrobat reader) this document.
Is it possible? Any idea.
If not, what suggestions (in your experience) are there.
Thank you in advance.
EDIT:
Used for the standard Java Desktop application.
source share