how to export data from realbasic to open office word file or compatible software - macos

I use real basic for programming and I want to export some data to a word file that can be opened with "Open Office" or any other word processing software that can work on MAC OSX, any advise?

You didn't indicate what sort of data you're dealing with so I'll just assume text. Take a look at the StyledText class since it can read/write RTF which can be read by most word processors. http://docs.realsoftware.com/index.php/StyledText The drawback is that they only support a subset of RTF and don't support images.
If you have images and want a little more control I would recommend the Formatted Text Control from True North Software. http://www.truenorthsoftware.com/formattedtextcontrol/ It's a little pricey, but it's well worth it. True RTF support as well as a lot of XML options. You can create a very nice looking export via code.
You can always just create a plain old text file using the TextOutputStream which any word processor can open and read. http://docs.realsoftware.com/index.php/TextOutputStream
If you're on Windows, you can export directly to Word using the WordApplication class. http://docs.realsoftware.com/index.php/WordApplication That's not a cross-platform solution though.

TextOutputStream in itself only outputs characters, but if the text is rtfdata and you give it a fileending of .rtf it is interpreted as an RTF-file.
You can actually give the file a .doc, and it will be opended in Word as default (assuming word is default for .doc files)

Related

PDF - Edit raw text without special paid tool

Is there a way to edit the raw text from a PDF without any special paid software?
So there are PDFs with highlightable text. I assume that the text is stored somewhere in the file.
I tried to just drag & drop a PDF into vscode but it just showed me unknown characters; even a little of meta text but if I edit the meta-infos, the file gets mostly corrupted.
Apart from that, I could not find any of the text contents of my desired PDF in vscode-editor.
Does someone know if there is a solution like inspecting and changing the source code somehow without a special software? I want to edit the contents; not the meta-infos.
(I use macOS)
The text you see on a pdf page can be constructed in dozens of different ways, actually there are millions of users, using potentially hundreds if not thousands of different methods.
Update
The question is MacOS but for native cross platform you need to work in mime text/pdf to be universally useful. But by way of example how thats possible specifically in windows its possible to write line by line using say cmd here is a snippet of what was a few dozen lines :-)
echo %%PDF-1.0>demo.pdf
echo %%µ¶µ¶>>demo.pdf
echo/>>demo.pdf
for %%Z in (demo.pdf) do set "FZ1=%%~zZ"
echo 1 0 obj>>demo.pdf
echo ^<^</Type/Catalog/Pages 2 0 R^>^>>>demo.pdf
echo endobj>>demo.pdf
echo/>>demo.pdf
For the fuller "Feature Creep"ing of now over more than a 100 lines and counting see
https://github.com/GitHubRulesOK/MyNotes/raw/master/MAKE-PDF.cmd
However although plain text could be the simplest it is rarely used except to prove a conceptual point that it is possible. The rest of the time "Special Software" as you call it (a pdf generator/editor) will be used to compress the file objects, most frequently as different optimal binary streams.
So some text may be scanned pixels whilst other text may be line shapes that look like letters, or at other times plain letters without fonts but a named style, or even letters with the font included (embedded) in the file (the preferred option).
In many ways each page may be built different to the others and thus no two pdfs generally will use the same structure unless like a bank statement using a format that does not change much from month to month, even if the balance wobbles about.
So in summary the tool that will work best is the one that covers every single permutation that Adobe dreamed of, and still keep the result a valid Adobe PDF.
Thus Acrobat PRO 3D is on my shelf (even if not used from one year to the next)
There are many cheaper editors and ones I will use more often for small mods are Tracker Xchange and FreePDF PRO and both have different limitations.
Your choices for MacOS will be more limited thus search for the best you are willing to pay for.

Windows 10: Simple way to print a PDF-file without the save-dialog

I'm trying to print the PDf-file(s) in a certain folder (or alternatively just print the files one-by-one) using for example Micorosft Print to PDF in order to create flattened versions. However when using Microsoft Print to PDF i need to specify the ouput-file's name and path. Is there any way to circumvent this or an alternative virtual printer specialized on such a job?
What I've already tried:
Windows 10 Print to PDF from command-line and Printing PDFs from Windows Command Line
These approches try to use the command prompt (personally favoured by me aswell, as it allows to create a batch-file and automate the process completely), but unfortunately the programs/printers listed in those posts are either not free or show a save-file-dialog aswell. Furthermore they are quite slow (even though this is not my main focus). So far, PDFtoPrinter has been the best solution, though it shows the save-file-dialog aswell...
Another idea I got from this post is to create a (VBA-/PowerShell-)script, but I'm not very experienced at that.
Any way to print just one PDF via the console and then making a loop or maybe even hard-coding the names would suffice aswell. I can easily rename the files for example to 1.pdf, 2.pdf, 3.pdf, ...
At this point I've tried so much but there has to be a way to get this running. Any help would be greatly appreciated!
Microsoft Print to PDF on Windows is not "Free", simply "Leased", however that said you can change the owners designed behavior to a different "port" than "prompt" or use the drivers to print to your desired named file.
To use ONE fixed output filename like %TEMP%OUT.PDF you are best served by cloning/duplicate the "Microsoft Print to PDF" to a printer name of your choice so I call mine "My Print to PDF" as its shorter to type and the Auto printed file goes to MyData folder. For a visual guide see https://stackoverflow.com/a/69169728/10802527 and up vote there if that helps.
The alternative is to use a structure like
CliPdfApp /PrintTo file.pdf "Microsoft Print to PDF" "Microsoft Print to PDF" "C:\MyFavourite Places\FileName.pdf
However few apps follow the required convention, so WordPad will convert Docx or RTF via command line but can not handle a PDF and Edge AFAIK was not designed to make the PDF format CLI print friendly :-). But those links you have in the question will suggest acrord32 /p or /t filename printer printdriver filename and that is probably the best method for flattening acroforms
Disclaimer I support SumatraPDF so can suggest to "Print As Image ONLY" its perfect as one single 32 or 64 bit portable.exe https://www.sumatrapdfreader.org/prerelease so all you need is:-
SumatraPDF -print-to "My Print to PDF" filename.pdf (or other types supported)
There are other print methods/options but BE-AWARE that is NOT flattening forms since "Flattening" means convert the form to plain readable text and SumatraPDF ONLY prints PDF as Imagery.
So combining SumatraPDF with a promptless port will provide a single command to build a known output then you need to monitor that output and rename to one of your choice, that can be tricky if you are submerged and "running silent and deep" without GDI feedback (that the print is spooling/erroring) and time is as variable as the input PDFs complexity.
You use the word "Slow" but that is the innate feature of PDF "Slow and Steady" output are its designed aims.
As an alternative to SumatraPDF two other viewers are more geared towards PDF Command Line printing. One is Acrobat Reader as per above "/Terminate and Stay Resident" and it does that exceptionally well so should be preferred. A good alternative lightweight but powerful PDF handler is Tracker PDF X-change which has both command line printing and its own programmable printer drivers.
Win2PDF has a command line to create image only (flattened) PDF files.

Create Multiple Slides from a List with Common Template

I have created a certificate design with powerpoint.
Now I have to create 100+ copies of it... each with a different name (the recipent).
I was wondering if there was an easy way to do it...
I can have the list of names in excel or txt.
I am open to other ideas as well, like changing the slide into an images and batch processing it in a simple way
You may also try out SlideMight, a tool for merging hierarchical data with PowerPoint templates. SlideMight supports iteration over data, to generate slides or to populate tables. There is more functionality, but you don't seem to need that. SlideMight is in fact a coding system, like mail merge for Word is.
Input data format is at this time just JSON; you would need to convert your Excel sheets first, e.g. using this Excel to JSON add-in for Excel.
There are versions for Windows and Mac OS X.
More information is at www.SlideMight.com
Disclaimer:
I am the owner of Delftware Technology, the company that developed SlideMight.
And I am one of the developers.
This is a question that really belongs in SuperUser, not StackOverflow (which is intended for coding questions, not software how-to-use questions).
But ...
Save your names to a plain notepad TXT file, one name per line.
Start PowerPoint, choose File, Open and point to your TXT file (you may force the matter by choosing . in Files of type:
Apply whatever template you like to the result.
I have a commercial add-in that'll do this and quite a bit more, but from your description, you don't need it.

How do I reverse engineer Mac OS X language localisation files for natural language learning?

OK, the goal of this question is not strictly programming related but it is a question programmers can answer using programming tools, and programmers may find useful answers here. Bear with me.
I find changing the system language in Mac OS X a useful way to augment my learning of natural languages, eg French. However sometimes I find a menu item or dialog box in French that I can't understand and it's a bore to google the translation or change the system language back to English. But I know that the English translation is hidden away somewhere in the localisation file and maps somehow to the French phrase. So what I want to do is extract all the text from all the localisation files to develop a mapping of this phrase in English = that phrase in French so I can look it up easily.
I know that the localisation files are stored in something like Localizable.strings, lproj files and nib files but I can't make head or tail of how they are stored or how to work with them. I can program but I've never written anything in Xcode. All the information I can find is for Mac OS / iOS programmers to localise their software, not for hackers to extract already made localisation information.
How can I extract the foreign language information as plain text from Mac OS X system and 3rd party software localisation files? Thanks!
Strings files are easy. They're simply dictionaries serialized as property lists. The dictionary keys are used by the program to look up the given string for a particular localization. You can build a mapping from English to another language by loading both dictionaries, iterating over the keys, and using the value from the English dictionary as the key in your output and the value from the other language dictionary as the value in your output.
NIBs are harder. The build process "compiles" NIB files in to a form that's not conduicive to editing or parsing. If you have access to uncompiled NIB files then you can use ibtool --export-strings-file to dump a strings file, which you could then process as per above. If you don't then I think you may have a hard time.

Ruby: Create files with metadata

We're creating an app that is going to generate some text files on *nix systems with hashed filenames to avoid too-long filenames.
However, it would be nice to tag the files with some metadata that gives a better clue as to what their content is.
Hence my question. Does anyone have any experience with creating files with custom metadata in Ruby?
I've done some searching and there seem to be some (very old) gems that read metadata:
https://github.com/kig/metadata
http://oai.rubyforge.org/
I also found: system file, read write o create custom metadata or attributes extended which seems to suggest that what I need may be at the system level, but dropping down there feels dirty and scary.
Anyone know of libraries that could achieve this? How would one create custom metadata for files generated by Ruby?
A very old but interesting question with no answers!
In order for a file to contain metadata, it has to have a format that has some way (implicitly or explicitly) to describe where and how the metadata is stored.
This can be done by the format, such as having a header that says where the "main" data is stored and where the "metadata" is stored, or perhaps implicitly, such as having a length to the "main" data, and storing metadata as anything beyond the "main" data.
This can also be done by the OS/filesystem by storing information along with the files, such as permission info, modtime, user, and more comprehensive file information like "icon" as you would find with iOS/Windows.
(Note that I am using "quotes" around "main" and "metadata" because the reality is that it's all data, and needs to be stored in some way that tools can retrieve it)
A true text file does not contain any headers or any such file format, and is essentially just a continuous block of characters (disregarding how the OS may store it). This also means that it can be generally opened by any text editor, which will merely read and display all the characters it finds.
So the answer in some sense is that you can't, at least not on a true text file that is truly portable to multiple OS.
A few thoughts on how to get around this:
Use binary at the end of the text file with hope/requirements that their text editor will ignore non-ascii.
Store it in the OS metadata for the file and make it OS specific (such as storing it in the "comments" section that an OS may have for a file.
Store it in a separate file that goes "along with" the file (i.e., file.txt and file.meta) and hope that they keep the files together.
Store it in a separate file and zip the text and the meta file together and have your tool be zip aware.
Come up with a new file format that is not just text but has a text section (though then it can no longer be edited with a text editor).
Store the metadata at the end of the text file in a text format with perhaps comments or some indicator to leave the metadata alone. This is similar to the technique that the vi/vim text editor uses to embed vim commands into a file, it just puts them as comments at the beginning or end of the file.
I'm not sure there are many other ways to accomplish what you want, but perhaps one of those will work.

Resources