[NB] Command line RTF->HTML converter Aspose.exe -- how to get it working?

JJ
JJSlote
Posts: 454
Joined: Tue Oct 26, 2010 5:44 pm
Platform: Windows
Location: NY, USA              Docs in Binder: 9800+

Sat Sep 29, 2018 11:00 am Post

Greetings -- The utility aspose.exe, found in the docformats subfolder within Scriv's installation folder, responds to command line invocation as "Scrivener Swiss-Army-Knife File Converter:" with a display of valid usage parameters and file types. But I've not been able to convert files with aspose; it merely reiterates its putative command line arguments. Any insights?

Rgds -- Jerome

User avatar
tiho_d
Posts: 341
Joined: Tue Sep 13, 2011 1:14 pm
Platform: Linux + Windows

Sat Sep 29, 2018 7:04 pm Post

Hi Jerome, how do you try the Aspose conversion. Do you export, compile or use command line?

JJ
JJSlote
Posts: 454
Joined: Tue Oct 26, 2010 5:44 pm
Platform: Windows
Location: NY, USA              Docs in Binder: 9800+

Sat Sep 29, 2018 10:19 pm Post

Hi Tiho -- It's via command line:

aspose.exe [path]content.rtf [path]content.html HTML

I hope Scriv will support command line use of this executable. My intention is to put it in an AutoHotkey script, my own compiler, as there will never be a way to achieve my desired presentation with Scriv's native compiler. I can perform the RTF->HTML conversion with other software. But particularly with style tags now residing in the docs' text fields, I'd prefer to use Scriv's own conversion tool in an automated sequence.

Thanks -- Jerome

User avatar
tiho_d
Posts: 341
Joined: Tue Sep 13, 2011 1:14 pm
Platform: Linux + Windows

Sun Sep 30, 2018 7:48 am Post

Hi JJSLOTE,

Indeed we have deliberately disabled using the embedded Aspose converter from command line. Scrivener is paying a good amount of money to Aspose so that Scrivener and only Scrivener can use the tool. The Scrivener application is having a license, but not the users who buy Scrivener. If we do not do this, every user buying Scrivener is also receiving the Aspose tool licensed and ready to use for free, which cost considerably more and we do not have control on the way they use it outside of Scrivener. In other words using the Aspose tool bundled with Scrivener outside of Scrivener is something which is against the Aspose and Scrivener licenses.
I am sure there are many ways to convert your documents from RTF to HTML. The easiest one that comes to my mind is import your ready to use RTF in Scrivener and use File > Export > HTML to export it via Aspose. Converting multiple RTF documents via a command line script using the Scrivener embedded Aspose converter is something which is against the idea of Scrivener and we do not plan on supporting it. Obviously you can always visit the Aspose web site and buy your personal Aspose license. Hope you understand the difference.

JJ
JJSlote
Posts: 454
Joined: Tue Oct 26, 2010 5:44 pm
Platform: Windows
Location: NY, USA              Docs in Binder: 9800+

Sun Sep 30, 2018 11:23 am Post

Thanks, Tiho. I do understand this limitation with regard to aspose.exe as such. But I think it's fair to say that the rtf docs we're maintaining are far more Scrivener-inflected than in prior versions. No third party tool will make a clean conversion anyway. Hence the wish for more granular access to the authentic Scrivener converter. I'll easily be able to whip up my own from an open-source codebase. Just looking to spare myself some work, and imagining an array of new compiling options for other Scrivener users.

Cheers -- Jerome

User avatar
tiho_d
Posts: 341
Joined: Tue Sep 13, 2011 1:14 pm
Platform: Linux + Windows

Sun Sep 30, 2018 12:32 pm Post

Indeed the "authentic Scrivener converter" i.e. Aspose knows nothing about the Scrivener specific RTF tags. We use Aspose as a general converter, just like any other converter. In Scrivener you can also use Microsoft Office converter, if MS Office is installed. The only reason we chose Aspose was that it is not Java based, does not use Microsoft Office, and the quality of conversion is good enough. So the reasoning of using the embedded Aspose converter from command line to clean Scrivener specific RTF tags is not a valid one, Jerome.

When Scrivener exports and compiles, it also cleans all Scrivener specific tags and uses only the RTF documented tags. Scrivener specific tags are used only within the project RTF documents. Aspose can be exchanged with any other converter just fine inside and outside of Scrivener. It is your own preference to use Aspose for whatever reason outside of Scrivener. Aspose will not do anything extra compared to any other converter in regards to specific Scrivener tags.

Still I am curious to know an exact use case which helps you using Aspose from command line, Jerome which cannot be achieved using Scrivener itself.

JJ
JJSlote
Posts: 454
Joined: Tue Oct 26, 2010 5:44 pm
Platform: Windows
Location: NY, USA              Docs in Binder: 9800+

Mon Oct 01, 2018 10:46 am Post

>Still I am curious to know an exact use case which helps you using Aspose from command line, Jerome which cannot be achieved using Scrivener itself.

Hi Tiho

My “compile” enables me to keep a huge Scrivener docbase viewable on an Android phone. It is based on the Scriv 1 model of maintaining documents in a single folder, identified by an integer Doc ID.

I have an Economics folder in Scrivener with perhaps 1800 HTML docs, typically longer articles, and about 1500 much shorter RTF docs. In Scriv 1, I could view the Docs folder in Windows, sort by date, and drag the newest HTML documents to the phone folder. Once they were on a common style sheet, they rendered beautifully on the phone. Of course I still required an HTML index or binder of some sort, which I generated in AutoHotkey.

My routine makes a single master HTML document that links to all branches that have children, and about 35 accumulator docs that link to HTML content docs at the same level, as nn.html. The accumulator docs also capture and display the smaller RTF docs, but as inline, rather than linked, html. These "on the fly" conversions constitute my use case for granular conversion capability.

Early versions of the routine did indeed use a Scrivener compile for the conversion. I would drag all of the Economics entries into a Collection, and compile that collection into a single HTML, with metadata containing each Doc ID. I then had to decompile, to break out each segment and save as an HTML with the Doc ID name. I’d then inject these segments into the accumulator docs as the routine encountered a matching ID in the binder.

Naturally I’ve looked to save all that setup, and have been experimenting with routines that convert RTF to HTML at the file level. And thus inquired about Aspose.

It’s a terrific boon to have a recent version of my docbase always available and easily updated on my phone. But the network of linking docs created by this method also makes an extremely useful wiki-like reference within Scrivener. Granular file conversion has brought the generation of these 35 accumulator docs, from thousands of source docs, down to a single click.

Rgds — Jerome

User avatar
tiho_d
Posts: 341
Joined: Tue Sep 13, 2011 1:14 pm
Platform: Linux + Windows

Mon Oct 01, 2018 12:01 pm Post

Thank you for your reply, Jerome. It looks like you need badly Scrivener for Android. Don't worry, it's cooking too.

What you describe is very close to the File > Sync > with External folder functionality. In your workflow you can also replace Aspose with any other RTF > HTML command line converter, Jerome. If you have MS Word installed, there are also freely available command line text converters, which use MS Word under the hood. Hope this helps.


All the best,
Tiho