[cups] rtf to pdf conversion using cupsfilter

Michael Sweet msweet at apple.com
Tue Sep 27 16:55:56 PDT 2016


Brian,

It isn't cupsfilter that is doing the work, it is the old nstexttopdf filter in /usr/libexec/cups/filter that did it (and is no longer provided with the OS - basically the filter relied things in Cocoa that no longer exist, so even copying a copy of the old filter to a new system will not work...)


> On Sep 27, 2016, at 7:21 PM, Paquin, Brian <brian.paquin at yale.edu> wrote:
> 
> I need a server-friendly solution... We have developers who created interfaces between clinical systems. They grab the RTF-based Operating Room notes from one system and save a PDF version of the note in a Mongo database for the other system to use. 
> 
> So the ideal solution (like cupsfilter) will do the conversion directly. 
> 
> I read about using unRTF and Ghostscript but the programmers are looking for something closer to cupsfilter.
> 
> Could we compile a version of cupsfilter for 10.11 that included the RTF support?
> 
> Thank you,
> 
> Brian
> Sent from my iPhone
> 
>> On Sep 27, 2016, at 4:30 PM, Mike Sweet <msweet at apple.com> wrote:
>> 
>> Brian,
>> 
>> The old filter that provided (very crude) rtf support was removed in 10.10. There is no replacement with cupsfilter but I believe you can use AppleScript to open the rtf in TextEdit and export to PDF...
>> 
>> Sent from my iPhone
>> 
>>> On Sep 27, 2016, at 12:49 PM, Paquin, Brian <brian.paquin at yale.edu> wrote:
>>> 
>>> In Mac OS X 10.9, we were able to convert RTF documents into PDF using:
>>> 
>>> cupsfilter my_document.rtf > my_document.pdf
>>> 
>>> This spits back some basic debug info, but works (see below).
>>> 
>>> But cupsfilter on OS 10.11 is missing that functionality, and returns:
>>> 
>>> cupsfilter: No filter to convert from text/rtf to application/pdf.
>>> 
>>> Any ideas how we can get this functionality back?
>>> (we hoped it would come back in 10.12, but we get the same behavior as 10.11)
>>> 
>>> If not something simple (to add/configure), what other solutions would you recommend to convert RTFs into PDFs (the documents have complex formatting but cupsfilter worked well)?
>>> 
>>> Thank you,
>>> 
>>> Brian
>>> 
>>> $ cupsfilter ~/Desktop/my_document.rtf > my_document.pdf
>>> DEBUG: argv[0]="cupsfilter"
>>> DEBUG: argv[1]="1"
>>> DEBUG: argv[2]="administrator"
>>> DEBUG: argv[3]="my_document.rtf"
>>> DEBUG: argv[4]="1"
>>> DEBUG: argv[5]=""
>>> DEBUG: argv[6]="/Users/administrator/Desktop/my_document.rtf"
>>> DEBUG: envp[0]="<CFProcessPath>"
>>> DEBUG: envp[1]="CONTENT_TYPE=text/rtf"
>>> DEBUG: envp[2]="CUPS_DATADIR=/usr/share/cups"
>>> DEBUG: envp[3]="CUPS_FONTPATH=/usr/share/cups/fonts"
>>> DEBUG: envp[4]="CUPS_SERVERBIN=/usr/libexec/cups"
>>> DEBUG: envp[5]="CUPS_SERVERROOT=/private/etc/cups"
>>> DEBUG: envp[6]="LANG=en_US.UTF8"
>>> DEBUG: envp[7]="PATH=/usr/libexec/cups/filter:/usr/bin:/usr/sbin:/bin:/usr/bin"
>>> DEBUG: envp[8]="PPD=/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/Generic.ppd"
>>> DEBUG: envp[9]="PRINTER_INFO=cupsfilter"
>>> DEBUG: envp[10]="PRINTER_LOCATION=Unknown"
>>> DEBUG: envp[11]="PRINTER=cupsfilter"
>>> DEBUG: envp[12]="RIP_MAX_CACHE=128m"
>>> DEBUG: envp[13]="USER=administrator"
>>> DEBUG: envp[14]="CHARSET=utf-8"
>>> DEBUG: envp[15]="FINAL_CONTENT_TYPE=application/pdf"
>>> INFO: nstexttopdf (PID 19583) started.
>>> DEBUG: nstexttopdf - opened PPD file "/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/Generic.ppd"...
>>> INFO: nstexttopdf (PID 19583) exited with no errors.
>>> $
>>> 
>>> 
>>> [Yale Pathology Logo]
>>> Brian Paquin
>>> Help Desk Support Yale Pathology ITS
>>> ---------------------------------------------------
>>> 310 Cedar St. BML B50
>>> New Haven, CT 06520
>>> 203-785-3691-office
>>> 203-785-2403-fax
>>> 
>>> _______________________________________________
>>> cups mailing list
>>> cups at cups.org
>>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.cups.org_mailman_listinfo_cups&d=CwICAg&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=jc-EqZyK6fWys6oTdMgtt9CjzHj-k5sGu3EHT7qx4Jg&m=9ixrvVBhuj1vy3zbPL5nYKmHcC_lkZouG_bawTN0874&s=7j1g_vRmy_DZouHXpBYlJXU7iyrQPYLA8oFa0uw14qs&e= 
>> _______________________________________________
>> cups mailing list
>> cups at cups.org
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.cups.org_mailman_listinfo_cups&d=CwICAg&c=-dg2m7zWuuDZ0MUcV7Sdqw&r=jc-EqZyK6fWys6oTdMgtt9CjzHj-k5sGu3EHT7qx4Jg&m=9ixrvVBhuj1vy3zbPL5nYKmHcC_lkZouG_bawTN0874&s=7j1g_vRmy_DZouHXpBYlJXU7iyrQPYLA8oFa0uw14qs&e= 
> _______________________________________________
> cups mailing list
> cups at cups.org
> https://lists.cups.org/mailman/listinfo/cups

_________________________________________________________
Michael Sweet, Senior Printing System Engineer




More information about the cups mailing list