I'm working on a Java project that sounds easy, but I'm running into one major issue.The basic idea is two programs (and a simple Perl script). One takes an Open Document Text file, converts it into whatever format I eventually decide to use, then encrypts it and uploads it to a server.The other program would download the encrypted file, decrypt the file and display it.I've looked at some different formats and options for displaying a document, and found problems with each format. I'm wondering if there might be other options I don't know about.Here are the requirements for the reading/viewing program:[*]The file must stay encrypted, even on the disk. (My client is not so much concerned about the people running the program, but is concerned about malware and other issues in terms of copyrights and such, so the file must stay encrypted.) The document can only be decrypted when read into memory.[*]The original document will be written in LibreOffice. Preserving as much of the formatting as possible is preferred. Many documents will be video scripts, so there are many margin changes. If at all possible, including images from the original document is preferred.[*]Anything that can be done to make it difficult or impossible to reproduce this document from the reading/viewing program is a plus. For instance, not allowing cut and paste of text or saving of text. (I know screenshots can't be stopped, though.)[*]The viewer needs to be in Java (due to WORA). I've never worked on Android and haven't even had time to look at it, but the client is hoping if it's in all Java, it will be transportable to Android (as well as Windows, OS X, and Linux for the original program). This is a low priority, but would be great if possible.I've looked at these formats (and the list is in my order of preference for format choice):
- ODT: The problem here is finding any library that actually displays ODT. jOpenDocument can do spreadsheets, but I can't find any Java program that displays ODT. (If it's possible to control LibreOffice so it can be made to display a document only, that might be acceptable. Since the documents to be displayed will be written in this format, it'd be the first choice.
- PDF: There are some different libraries that handle PDF. I've looked mostly at jPedal, but that requires random access files in the viewer, which pretty much rules out encryption without some serious work. There are libraries that work with PDF files in Java, but most are for rendering but not for display.
- HTML: This would be just fine, but the problem is a JEditerPane handles up to HTML 3.2 (and some higher levels in some things, but there's no guarantee). This would preserve the needed formatting, but I'm having serious problems with margins. I can't specify a maximum line width or a page width in a JEditorPane and formatting is not always reliable. I've started looking at some libraries that handle HTML in Java, but they seem to depend on lots of other libraries or don't seem to have simple demos that let me load my own files without me first spending hours on building them.
- PNG or JPG: Yes, I considered creating images. jPedal gave me this idea because it could convert each page to a separate graphic image, but in both JPG and PNG formats, going up to 216 DPI (the highest resolution possible with the open source jPedal), many lines still blur slightly - but enough to create a headache while reading. If I could generate non-fuzzy text in images like this, I'd still seriously consider it - but I know it'd have to be one image file per page.
- RTF: This might work, but I'd really rather be able to include images, and LibreOffice won't export images with graphics to RTF files.