On Tuesday, 21 January 2025 04:48:30 GMT G. Branden Robinson wrote: > [replying to list instead of privately, with consent] > > Hi Marc, > > ...finally getting back to you... > [...] > > [1] https://savannah.gnu.org/bugs/?66653 > > (I owe him some feedback on that ticket.)
:-) Just a brief statement of where I am with this. Most people will know Keith's spdf.tmac which added pdf features to ms documents, but which is now developed separately (a lot of new stuff as well) and is not part of groff any more. The roff way of:- .startmacro text ... .endmacro | .startanother Causes a problem when trying to interface to the .pdf... macros which all expect text to be part of the macro call, often with flags, since the "text" has already been captured into a diversion and converted to nodes. For this reason -mspdf changed some ms syntax (i.e.:- .AU Larry Kollar .AI kol...@alltel.net .AU G.\& Branden Robinson .AI g.branden.robin...@gmail.com Would have to become:- .AU Larry Kollar, G. Branden Robinson And TOC entries had to use .XN/.XH rather than the older form of .XS/.XA/.XE. So most existing ms documents would need at least some editing when being used with -mspdf. Fortunately groff has the .asciify request which will "Unformat the diversion div in a way such that Unicode basic Latin (ASCII) characters, characters translated with the trin request, space characters, and some escape sequences, that were formatted and diverted into div are treated like ordinary input characters when div is reread.". So, theoretically, using .asciify may solve the problem by converting the appropriate diversion back to text, but it can sometimes cause a crash dump and unfortunately it does not cope with input of the form \[uXXXX], possibly the code was written before preconv became available, so is useless when input includes non-ascii characters. The bug Branden refers to above includes a patch which allows non-ascii glyph nodes to be passed back as the ascii string \[uXXXX], the same as Branden's changed code for \X. It also may fix the crash dump (it certainly does for our current reproducer). With the patch any ms document in any language (with suitable fonts installed), without modification can include pdf features such as the overview panel, relocated clickable TOC and meta-data such as Author and Title included in the pdf. Cheers Deri