# Export cdf does not work in MathKernel command line

I am using Mathematica through command line MathKernel. I am not trying to draw any graphics in the console. But I should be able to export things a CDF. Why can't I export a CDF through command line ? Why do we need a graphical font end to export a CDF ? Is there any way around ? Interestingly Show did not throw error. However silently suppressed the circle.

In[1]:= TabView[{Show[Graphics[Circle[]]]}]

Out[1]= TabView[{-Graphics-}]

In[2]:= Export["/tmp/file.cdf", TabView[{Show[Graphics[Circle[]]]}]]

FrontEndObject::notavail: A front end is not available; certain operations require a front end.

Export::errelem: The Export element NotebookObject
contains a malformed data structure and could not be exported to CDF format.

Out[2]= \$Failed


I am actually trying to do the same through WSTP and getting the same result. So I was curious to check whether same happens with MathKernel or not.

• Have you tried using UsingFrontEnd @ Export[..]? – Carl Woll Nov 3 '17 at 21:25
• What's that ? Never seen any thing like this. Will tomorrow and let you know. But what does it mean ? – Neel Basu Nov 3 '17 at 21:26
• ?UsingFrontEnd UsingFrontEnd[expr] evaluates expr, making use of a front end if necessary. >> – Carl Woll Nov 3 '17 at 21:31
• I think the issue is that you are typing CDF when you mean PDF (as you have in the title). If you change /tmp/file.cdf to /tmp/file.pdf everything works fine (Mathematica 11.1, Windows 7). – JimB Nov 3 '17 at 23:59
• Sorry that was a typo – Neel Basu Nov 4 '17 at 5:45