Asciidoctorj-pdf target directory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Asciidoctorj-pdf target directory

patrickm
Hello,
I'm experimenting with Asciidoctorj-pdf but I'm not able to set the destination dir of generated pdfs... (1.6 SNAPSHOT)

...
Options options = new Options ();
options.setBackend ("pdf") ;
options.setDestinationDir ("/tmp/");
            
asciidoctor.renderFile (f, options) ; 
...

How to specify the destination directory ? All my pdfs are generated in the source directories....
Thanks

Patrick
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctorj-pdf target directory

abelsromero
Hi Patrick,

Instead of setDestinationDir, try using toDir.

cheers,
Reply | Threaded
Open this post in threaded view
|

Re: Asciidoctorj-pdf target directory

patrickm
hello,
By using

options.setToDir ("/tmp");
or
options.setToDir ("tmp");

I get:

SEVERE: (IOError) target directory does not exist: /tmp
Exception in thread "main" org.asciidoctor.internal.AsciidoctorCoreException: org.jruby.exceptions.RaiseException: (IOError) target directory does not exist: /tmp
	at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:539)
	at org.asciidoctor.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:511)
	at org.asciidoctor.internal.JRubyAsciidoctor.renderFile(JRubyAsciidoctor.java:265)
	at org.asciidoctor.internal.JRubyAsciidoctor.renderFile(JRubyAsciidoctor.java:350)
...
	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:497)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: org.jruby.exceptions.RaiseException: (IOError) target directory does not exist: /tmp
	at RUBY.convert(/mnt/d2/repository/org/asciidoctor/asciidoctorj/1.6.0-SNAPSHOT/asciidoctorj-1.6.0-SNAPSHOT.jar!/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1489)
	at RUBY.convert_file(/mnt/d2/repository/org/asciidoctor/asciidoctorj/1.6.0-SNAPSHOT/asciidoctorj-1.6.0-SNAPSHOT.jar!/gems/asciidoctor-1.5.2/lib/asciidoctor.rb:1562)
	at RUBY.convertFile(<script>:68)
	at org.jruby.gen.InterfaceImpl1111357250.convertFile(org/jruby/gen/InterfaceImpl1111357250.gen:13)

Obviously, /tmp exist and is writable...