coldnew / org-ioslide

Export org-mode to Google I/O HTML5 slide.
273 stars 38 forks source link

Add PDF exporter support #8

Open coldnew opened 9 years ago

coldnew commented 9 years ago

I try deck2pdf, but it give me following error, maybe rewrite my own exporter by clojure ?

Ccoldnew@Rosia ~/tmp/org-ioslide $ JAVA_OPTS=-Xmx2G  ~/ramdisk/deck2pdbuild/distributions/deck2pdf-0.2-SNAPSHOT/bin/deck2pdf --profile=googlehtml5 template.html a.pdf
Exported slide 1
Error while executing the following code:
curSlide == slideEls.length-1
netscape.javascript.JSException: ReferenceError: Can't find variable: curSlide
    at com.sun.webkit.dom.JSObject.fwkMakeException(JSObject.java:128)
    at com.sun.webkit.WebPage.twkExecuteScript(Native Method)
    at com.sun.webkit.WebPage.executeScript(WebPage.java:1410)
    at javafx.scene.web.WebEngine.executeScript(WebEngine.java:934)
    at me.champeau.deck2pdf.GroovyProfile.executeJS(GroovyProfile.java:65)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:952)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:1131)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1087)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:730)
    at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)
    at groovy.lang.Script.invokeMethod(Script.java:78)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:407)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:346)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
    at Script1$_run_closure1.doCall(Script1.groovy:4)
    at Script1$_run_closure1.doCall(Script1.groovy)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:272)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.Closure.call(Closure.java:423)
    at groovy.lang.Closure.call(Closure.java:417)
    at me.champeau.deck2pdf.GroovyProfile.isLastSlide(GroovyProfile.java:86)
    at me.champeau.deck2pdf.Browser$1.handle(Browser.java:128)
    at me.champeau.deck2pdf.Browser$1.handle(Browser.java:111)
    at javafx.animation.Animation.impl_finished(Animation.java:1134)
    at javafx.animation.AnimationAccessorImpl.finished(AnimationAccessorImpl.java:49)
    at com.sun.scenario.animation.shared.SingleLoopClipEnvelope.timePulse(SingleLoopClipEnvelope.java:103)
    at javafx.animation.Animation.impl_timePulse(Animation.java:1104)
    at javafx.animation.Animation$1$1.run(Animation.java:187)
    at javafx.animation.Animation$1$1.run(Animation.java:185)
    at java.security.AccessController.doPrivileged(Native Method)
    at javafx.animation.Animation$1.timePulse(Animation.java:185)
    at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:346)
    at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:269)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:475)
    at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:460)
    at com.sun.javafx.tk.quantum.QuantumToolkit$13.run(QuantumToolkit.java:327)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
coldnew commented 9 years ago

I have little clojure code to test javafx webview on org-ioslide, but it can't render MathJax well, so maybe another alternative, like testing phantomjs or nodewebkit.

coldnew commented 9 years ago

Though phantomjs is a bit slow, it may be do this job. Current develop branch for pdf generator is at features/pdfgen branch.

kuanyui commented 9 years ago

+1

buster commented 9 years ago

+1 Sounds like exactly what i want! :)