Need cross-platform mixed data type file format ideas

I need ideas for a report file format for my scientific analysis program that meets ALL of the following criteria:

  1. Cross-platform (i.e. Mac and Windows).
  2. Can hold text, images and graphics.
  3. Must be user editable in native types (text may be cut/pasted, graphics modified, images edited).
  4. Must not use require any third-party Xojo plug-ins.

I have looked at PDF (very complex, only cross-platform solution requires very expensive plug-ins), RTF (not interpreted correctly on Mac [drawn graphics not shown]), Xojo Reports (results in PNG images which are not user editable as noted in [3] above.

Any ideas?

Have you tried with Html? Doesn’t print too well, though. And you need an editing toolbar. Valentina might be worth a look. But it requires a plugin. Bkeeney Shorts is another solution for reporting. Haven’t looked at it. So I don’t know if you can do editing. Might require DynaPDF.

In which application on OS X?

TextEdit for example.

Nota: I think Robin talks about embedded images (not images stored in rtfd, format that does not exists on WIndows).

On a recent conversation, someone provided a link for RTF stuff and there was examples of embedded images in RTF.

Robin, why do’nt you create your own (custom) binary file format ?

Something like…

0000 TEXT PSTring File definition 000a Long Index Position of the next object (the PString) 000b Image PNG or JPG Image stored using Picture Class 000c TEXT PSTring More Text 000d Long Index Position of the next object 000e

etc.

You use BinaryStream to read / write these data. An a window with fields to display them is welcome.

Without real data knowledge of what you need, it is not easy to give a file format.

Or you can simply use xml for read / write…

LibreOffice: Text OK, Images OK, Graphics drawn but sometimes incorrectly located.
NeoOffice: Text OK, Images incorrectly located, Graphics not drawn
OpenOffice: Text OK, Images incorrectly located, Graphics show as outlines only (no fill)
Pages 2009: Text OK, Images not drawn, Graphics not drawn
Pages 2015: RTF not opening
TextEdit: Text OK, Images not drawn, Graphics not drawn

The only application which comes the closest to interpreting an RTF file properly, with the exception of the graphics locations.

Only RTFD files work on Mac, but they are not processed by Windows so they fail my cross-platform criterion.

Creating my own binary file format fails criterion 3 which requires that my users be able to edit the files on either platform. They need the ability to rearrange the layout to fit their own criteria and to edit the data.

Any ideas?

Oops, I meant the second paragraph to be:

The only application which comes the closest to interpreting an RTF file properly is LibreOffice, with the exception of the graphics locations.

Well, are your sure your RTF are created properly? Have you tried creating the same RTF manually in all these apps and compared the RTF source to see where the differences are? I successfully export RTF from my apps for Word (Win & Mac) and Pages (and even TextEdit). But I must admit it took a while to get it right.

I created the RTF test files in each application, then saved them as RTF, then opened the saved file. Each one contained the same two images, a TIFF and a JPEG, some text, and a rounded corner rectangle filled with a color. I tried each file with the other applications. For a final test, I created the RTF file in Word 98 on an older Mac, then opened this file with all the other programs. The Apple produced programs only displayed the text. The applications that attempted to duplicate the functions of Microsoft Office did better, but none did a perfect job. I do not have any later versions of Word so I could not test it.

For Mr. Schwartz:

My need for this file is for reports generated from my color science application. This is a program that analyzes color spectra, calculates various color values, creates graphs from the data, compares light sources, and much more. My clients want to get printed reports with the data that they can then edit. They want the reports to have their company logos (one image to each page), along with the color and metadata (here is the text), along with the spectral graphs (another image) and color patches simulating the specimens (the graphic requirement). Other reports will be more elaborate with graph images and many more color patches. The reports need to be generated directly from my application, hence my search for a truly cross-platform document format. I am very budget constrained so using something like the Monkeybread PDF plug-in is out of the question.

For Mr. Ott:

Do you export RTF with text, images and graphics on the same page?

Yes. But it is not very complex, like a list of inventory products, consisting of jpgs, pngs or tifs and of course text.

Graphics (drawing instructions in RTF) are not supported by LibreOffice and others as far as I know. But images should work. Have you tested with images with no color profile, 8-bit (not 16-bit) and no layers. Transparency might also pose problems. I know it is not easy…

I’ve tried some for my project and ended up with HTML and the HTML-edit control of @Tim Parnell .

Is the unstated issue that your app only runs on one platform, and they must be able to take away your document and edit it using some other app on either platform?

If your app runs on both Windows and Mac, no problem: use your app on both and use a custom format.

If your app only runs on Windows, you might be able to use OLE to embed a Word document for editting.
Cant think of anything similar on the Mac side.

(hey… just realised … you actually cant do THAT on a Mac… dang those adverts! : > )

AFAIK, apple programs don’t expect to have graphics in RTF documents, but they expect it in RTFD documents.
if you paste an image in Textedit, it requires you to save it as rtfd, or it simply ignores the image.

Mr. Ott:

LibreOffice does support drawing objects, as mentioned in an earlier message. They just do not always appear in their assigned position on the page.

My program runs on both Mac and Windows, with many clients using both; one platform to measure colors and the other platform where they perform the analyses.

All:

In addition to RTF, I have also looked at PDF, Office Object XML, Open Document, Postscript and Xojo Reports. None of these meet all the criteria on both platforms. Are there any formats I have not tried?

With all the requirements you defined, it looks very much like you cannot go on the cheap.

So as long as they only use your app to edit, you dont have a problem.
XML was my choice for this, faced with a similar requirement.

You can add as many elements as you like, storing text, rtf, co-ordinates of vector objects, and images as strings (encodebase64)

IFF, the basis for TIFF and AIFF. Really simple binary format.

It uses ‘tags’ as data identifiers, as well data format identifiers.

I would recommend writing image data as the first segments and then the smaller data after; this way the app doesn’t need to shift all the large chunks of when they change something small.

You might be able to find a pre existing parser or write you own fairly quickly and it will be 100% cross-platform with pure Xojo code.

Not to mention that a binary format is probably the fastest you’re going to get.

Oh sorry… Retread the OP and realise that you’re talking about a format for a report that is editable in a 3rd party program (not one created by you).

How about Word? I seem to recall that you can create Word documents in Xojo (is this still true?).

PDF can be edited, but requires the user to have the paid Acrobat installed.

Perhaps; figuring out what apps the majority of your audience are likely to have already, will give you a clue as to what might a sutible format. Even then I don’t think you can go too wrong with Word format, most PC’s have some kind of Word, most Macs have Pages if not Word and Linux has OpenOffice.

This is one of the best answer. The otehr one is to provide an application (your application) that is able to create a folder, store the data into files inside that “master folder”; files of type Text / Images, etc.

So, you have a built in solution and the user can load/modify/save the files from the “document” Folder, and still present them in a convenient way via your application.

Your application can even print the document in a PDF file (built in with OS X and Windows 10, need a third party pdf solution - sometimes free), so the client can display it / print it, whatever his/her needs is.

you could also buy bob keeney FTC : http://www.bkeeney.com/formatted-text-control/
it is not a plugin but a full source code xojo project
then you can make your own text/image editor and the file format you choose.
will cost you $150 but will answer all your problems.

also ask bob before, but it may not be 64bits ready.