Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image in PDF #369

Closed
pinggit opened this issue Dec 10, 2015 · 26 comments
Closed

image in PDF #369

pinggit opened this issue Dec 10, 2015 · 26 comments
Assignees
Labels

Comments

@pinggit
Copy link

pinggit commented Dec 10, 2015

whenever I run

asciidoctor -r asciidoctor-pdf -b pdf mydoc.txt

I got this:

asciidoctor: WARNING: allow-uri-read is not enabled; cannot embed remote image: https://cloud.githubusercontent.com/assets/2038044/11644558/09c7e630-9d1b-11e5-8f8d-d14493859d07.png

this is same with or without

:data-uri:

it looks this is related to the image that I wanted to insert into PDF

image::https://cloud.githubusercontent.com/assets/2038044/11644558/09c7e630-9d1b-11e5-8f8d-d14493859d07.png[]

this image insertion has no issue in HTML rendering, how to make it work in PDF?

@mojavelinux
Copy link
Member

You need to pass the allow-uri-read attribute to the command:

asciidoctor -r asciidoctor-pdf -b pdf -a allow-uri-read mydoc.txt

This is required anytime you are reading content from a URI.

@mojavelinux mojavelinux added this to the support milestone Dec 10, 2015
@mojavelinux mojavelinux self-assigned this Dec 10, 2015
@pinggit
Copy link
Author

pinggit commented Dec 10, 2015

it doesn't work...

ping@ubuntu47-3:~$ asciidoctor -r asciidoctor-pdf -b pdf -a allow-uri-read
/living\ files/mydoc.txt --trace
/var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/temporary_path.rb:5:in
unlink': No such file or directory - /tmp/image-20151210-9412-4rvb6e.png ( rrno::ENOENT) from /var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/temporary_path.rb:5:in unlink'
from
/var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:2457:in
unlink_tmp_file' from /var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:892:in convert_image'
from
/var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:98:in
convert' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:71:in convert'
from
/var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in
block in content' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in map'
from
/var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in
content' from /var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:114:in convert_content_for_block'
from
/var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:325:in
convert_section' from /var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:98:in convert'
from
/var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:71:in
convert' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in block in content'
from
/var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in
map' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in content'
from
/var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:114:in
convert_content_for_block' from /var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:325:in convert_section'
from
/var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:98:in
convert' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:71:in convert'
from
/var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in
block in content' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in map'
from
/var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/abstract_block.rb:80:in
content' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/document.rb:1104:in content'
from
/var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:114:in
convert_content_for_block' from /var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:165:in convert_document'
from
/var/lib/gems/1.9.1/gems/asciidoctor-pdf-1.5.0.alpha.10/lib/asciidoctor-pdf/converter.rb:98:in
convert' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/document.rb:1044:in convert'
from
/var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor.rb:1514:in
convert' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/cli/invoker.rb:94:in block in invoke!'
from
/var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/cli/invoker.rb:86:in
each' from /var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/lib/asciidoctor/cli/invoker.rb:86:in invoke!'
from
/var/lib/gems/1.9.1/gems/asciidoctor-1.5.3/bin/asciidoctor:14:in <top (required)>' from /usr/local/bin/asciidoctor:23:inload'
from /usr/local/bin/asciidoctor:23:in `

'
ping@ubuntu47-3:$ cd /tmp/
ping@ubuntu47-3:/tmp$ ls
file563qKX file9csAsb fileGzYtkk filemVHKeu fileX12pDi tmux-1000
v7Lglu4 vD9dz6X vFVdRUw vpc5VaP vs3J7EU
file8W5Xgz fileBKU75H fileJVQOgr fileTgwavx orbit-ping v2woOA0
va6OG4l vduR3Wi vhE6qo0 vpMXHkX xsession-ping

On Wed, Dec 9, 2015 at 11:31 PM, Dan Allen notifications@github.com wrote:

You need to pass the allow-uri-read attribute to the command:

asciidoctor -r asciidoctor-pdf -b pdf -a allow-uri-read mydoc.txt

This is required anytime you are reading content from a URI.


Reply to this email directly or view it on GitHub
#369 (comment)
.

@mojavelinux
Copy link
Member

This happens because you are using Ruby 1.9. Please use Ruby 2 or above. I'll try to fix it for Ruby 1.9, but it's really not a supported version.

@mojavelinux
Copy link
Member

Ruby 1.9 will sometimes delete a tmp file sooner than when the process exits. I've added a guard for this.

@mojavelinux mojavelinux modified the milestones: v1.5.0.beta.1, support Dec 10, 2015
mojavelinux added a commit that referenced this issue Dec 10, 2015
resolves #369 don't fail to delete tmp file
@pinggit
Copy link
Author

pinggit commented Dec 11, 2015

hi Dan:

I just installed ruby via this steps:

https://gorails.com/setup/ubuntu/14.04

ping@ubuntu47-3:~$ ruby -v

but still I got errors below:

ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
ping@ubuntu47-3:~$ asciidoctor -r asciidoctor-pdf -b pdf -a allow-uri-read
~/living\ files/d2ipe-mx-check.txt
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not
find asciidoctor (>= 0) amongst [bundler-unload-1.0.2, executable-hook)
        from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
        from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
        from /usr/local/bin/asciidoctor:22:in `<main>'
ping@ubuntu47-3:~$ sudo gem install prawn
ERROR:  Error installing prawn:
        prawn requires Ruby version >= 2.0.0.
ping@ubuntu47-3:~$ ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
ping@ubuntu47-3:~$

it just looks like ruby was installed by not recognized by
asciidoctor...any idea?

thanks.

@mojavelinux
Copy link
Member

Please use rvm. Honestly, rvm is the only reasonable way to use Ruby in a reliable way in my opinion. Once you switch to rvm, I swear you'll never have problems using Ruby again.

See https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-ubuntu-14-04-using-rvm

(except install asciidoctor-pdf instead of rails).

@pinggit
Copy link
Author

pinggit commented Dec 11, 2015

thanks Dan.

everything looks great until I got this:

Parsing documentation for mime-types-2.99
Installing ri documentation for mime-types-2.99
Parsing documentation for mail-2.6.3
Installing ri documentation for mail-2.6.3
Parsing documentation for actionmailer-4.2.5
Installing ri documentation for actionmailer-4.2.5
Parsing documentation for arel-6.0.3
Installing ri documentation for arel-6.0.3
Parsing documentation for activemodel-4.2.5
Installing ri documentation for activemodel-4.2.5
Parsing documentation for activerecord-4.2.5
Installing ri documentation for activerecord-4.2.5
Parsing documentation for rails-4.2.5
Installing ri documentation for rails-4.2.5

then I got stuck in here, waited for 20+ minutes and still pending in
here...
is this normal? I'm not sure I will break the whole thing or not if I
interupt it now...

On Thu, Dec 10, 2015 at 9:57 PM, Dan Allen notifications@github.com wrote:

Please use rvm. Honestly, rvm is the only reasonable way to use Ruby in a
reliable way in my opinion. Once you switch to rvm, I swear you'll never
have problems using Ruby again.

See
https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-ubuntu-14-04-using-rvm

(except install asciidoctor-pdf instead of rails).


Reply to this email directly or view it on GitHub
#369 (comment)
.

@pinggit
Copy link
Author

pinggit commented Dec 11, 2015

please ignore, everything works as you said,
PDF images looks super, thanks!!!!

On Thu, Dec 10, 2015 at 10:26 PM, ping song songpingemail@gmail.com wrote:

thanks Dan.

everything looks great until I got this:

Parsing documentation for mime-types-2.99
Installing ri documentation for mime-types-2.99
Parsing documentation for mail-2.6.3
Installing ri documentation for mail-2.6.3
Parsing documentation for actionmailer-4.2.5
Installing ri documentation for actionmailer-4.2.5
Parsing documentation for arel-6.0.3
Installing ri documentation for arel-6.0.3
Parsing documentation for activemodel-4.2.5
Installing ri documentation for activemodel-4.2.5
Parsing documentation for activerecord-4.2.5
Installing ri documentation for activerecord-4.2.5
Parsing documentation for rails-4.2.5
Installing ri documentation for rails-4.2.5

then I got stuck in here, waited for 20+ minutes and still pending in
here...
is this normal? I'm not sure I will break the whole thing or not if I
interupt it now...

On Thu, Dec 10, 2015 at 9:57 PM, Dan Allen notifications@github.com
wrote:

Please use rvm. Honestly, rvm is the only reasonable way to use Ruby in a
reliable way in my opinion. Once you switch to rvm, I swear you'll never
have problems using Ruby again.

See
https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-ubuntu-14-04-using-rvm

(except install asciidoctor-pdf instead of rails).


Reply to this email directly or view it on GitHub
#369 (comment)
.

@mojavelinux
Copy link
Member

Great!

In case it wasn't clear for anyone following along, skip this step:

gem install rails -v rails_version

and replace it with

gem install asciidoctor-pdf --pre

Also, for my general purpose gemset (when I'm not in a particular project), I like to use the name "runtime". You can combine the create and use into a single command. So what I do is the following:

rvm 2.2@runtime --create

(of course, replace "2.2" with whatever Ruby you install).

@pinggit
Copy link
Author

pinggit commented Dec 11, 2015

thanks Dan.
I think it will be great to include info of installing ruby 2.x in
asciidoc-pdf steps - I bet most people will run into same issues as mine.

On Thu, Dec 10, 2015 at 11:24 PM, Dan Allen notifications@github.com
wrote:

Great!

In case it wasn't clear for anyone following along, skip this step:

gem install rails -v rails_version

and replace it with

gem install asciidoctor-pdf --pre

Also, for my general purpose gemset (when I'm not in a particular
project), I like to use the name "runtime". You can combine the create
and use into a single command. So what I do is the following:

rvm 2.2@runtime --create

(of course, replace "2.2" with whatever Ruby you install).


Reply to this email directly or view it on GitHub
#369 (comment)
.

@mojavelinux
Copy link
Member

We already have a page on asciidoctor.org planned. It's the same for every gem in the ecosystem, so it's better to centralize the instructions and link to it. See asciidoctor/asciidoctor.org#399.

@pinggit
Copy link
Author

pinggit commented Dec 12, 2015

Dan:

I ran into another issue today, this looks related to a system reboot.
everything works fine previously.

ping@ubuntu47-3:$ asciidoctor
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find asciidoctor (>= 0) amongst [bundler-1.8.4, bundler-unload-1.0.2, executable-hooks -1.3.2, gem-wrappers-1.2.7, minitest-5.4.3, power_assert-0.2.2, rubygems-bundler-1.4.4, rvm-1.11.3.9, test-unit-3.0.8] (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:into_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in gem' from /usr/local/bin/asciidoctor:22:in

'
ping@ubuntu47-3:$

I did some research and couldn't find a match. any advice?

@pinggit
Copy link
Author

pinggit commented Dec 12, 2015

please ignore...I just reinstall asciidoctor and asciidoctor-pdf from gem
and everything works again.
I really don't know what happened. I'll monitor this issue on next system
reboot.

regards
ping

On Sat, Dec 12, 2015 at 12:56 PM, ping song songpingemail@gmail.com wrote:

Dan:

I ran into another issue today, this looks related to a system reboot.
everything works fine previously.

ping@ubuntu47-3:$ asciidoctor
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find asciidoctor (>= 0) amongst [bundler-1.8.4, bundler-unload-1.0.2, executable-hooks -1.3.2, gem-wrappers-1.2.7, minitest-5.4.3, power_assert-0.2.2, rubygems-bundler-1.4.4, rvm-1.11.3.9, test-unit-3.0.8] (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:into_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in gem' from /usr/local/bin/asciidoctor:22:in

'
ping@ubuntu47-3:$

I did some research and couldn't find a match. any advice?

@mojavelinux
Copy link
Member

If you are using RVM, you have to remember to run rvm use after restarting your console, or you need to set the default (see rvm.io for details).

As you get used to RVM, you should always check which version you are using by running:

rvm current

If it says "system", you aren't using RVM.

@pinggit
Copy link
Author

pinggit commented Dec 13, 2015

thanks Dan.
these looks new to me...need to take some time to learn these skills.
thanks.

On Sat, Dec 12, 2015 at 2:12 PM, Dan Allen notifications@github.com wrote:

If you are using RVM, you have to remember to run rvm use after
restarting your console, or you need to set the default (see rvm.io for
details).

As you get used to RVM, you should always check which version you are
using by running:

rvm current

If it says "system", you aren't using RVM.


Reply to this email directly or view it on GitHub
#369 (comment)
.

@pinggit
Copy link
Author

pinggit commented Dec 14, 2015

Dan:
it looks the same issue happened again...

I'm working with vim and I have some keybindings in there. so e.g whenever
I hit ,ah it will call asciidoctor and render current file. works perfect.
this is method1.

now the asciidoctor command from vim is still working, but I want to change
some options before run it again (e.g. add -d book) for that I normally hit
ctrl-z to return back to my terminal where vim was started. this is method2.

previously everything works.

but tonight I found the method1 works and method2 broke, again. and I run
gem install asciidoctor again and issue got fixed:

ping@ubuntu47-3:$ asciidoctor living\ files/mydoc.txt
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in to_specs': Could not find asciidoctor (>= 0) amongst [actionmailer-4.2.5, actionpack-4.2.5, actionview-4 5, activejob-4.2.5, activemodel-4.2.5, activerecord-4.2.5, activesupport-4.2.5, arel-6.0.3, builder-3.2.2, bundler-1.8.4, bundler-unload-1.0.2, concurrent- y-1.0.0, erubis-2.7.0, executable-hooks-1.3.2, gem-wrappers-1.2.7, globalid-0.3.6, i18n-0.7.0, loofah-2.0.3, mail-2.6.3, mime-types-2.99, mini_portile2-2.0 minitest-5.4.3, nokogiri-1.6.7, power_assert-0.2.2, rack-1.6.4, rack-test-0.6.3, rails-4.2.5, rails-deprecated_sanitizer-1.0.3, rails-dom-testing-1.0.7, r s-html-sanitizer-1.0.2, railties-4.2.5, rubygems-bundler-1.4.4, rvm-1.11.3.9, sprockets-3.5.2, sprockets-rails-2.3.3, test-unit-3.0.8, thor-0.19.1, thread_ e-0.3.5, tzinfo-1.2.2] (Gem::LoadError) from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:into_spec'
from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in gem' from /usr/local/bin/asciidoctor:22:in

'
ping@ubuntu47-3:$
ping@ubuntu47-3:$ gem install asciidoctor
Fetching: asciidoctor-1.5.3.gem (100%)
Successfully installed asciidoctor-1.5.3
Parsing documentation for asciidoctor-1.5.3
Installing ri documentation for asciidoctor-1.5.3
Done installing documentation for asciidoctor after 7 seconds
1 gem installed
ping@ubuntu47-3:
$
ping@ubuntu47-3:$ asciidoctor living\ files/mydoc.txt
ping@ubuntu47-3:
$

ping@ubuntu47-3:~$ rvm current
ruby-2.2.1

ping@ubuntu47-3:~$ rvm use
Using /home/ping/.rvm/gems/ruby-2.2.1

same thing goes asciidoctor-pdf:

ping@ubuntu47-3:~$ asciidoctor -r asciidoctor-pdf -b pdf -a allow-uri-read
living\ files/mydoc.txt
asciidoctor: FAILED: 'asciidoctor-pdf' could not be loaded
Use --trace for backtrace

I'm sure reinstall asciidoctor-pdf gem will be it, but just wondering what
is the problem here? I didn't restart my terminal. anyone else had same
issues on ubuntu ?

b.t.w I'm running ssh and GNU screen, then tmux on screen. I
disconnect/reconnect constantly to my document work...

On Sat, Dec 12, 2015 at 10:51 PM, ping song songpingemail@gmail.com wrote:

thanks Dan.
these looks new to me...need to take some time to learn these skills.
thanks.

On Sat, Dec 12, 2015 at 2:12 PM, Dan Allen notifications@github.com
wrote:

If you are using RVM, you have to remember to run rvm use after
restarting your console, or you need to set the default (see rvm.io for
details).

As you get used to RVM, you should always check which version you are
using by running:

rvm current

If it says "system", you aren't using RVM.


Reply to this email directly or view it on GitHub
#369 (comment)
.

@istvanrath
Copy link

I can still reproduce this with alpha.13:

var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/formatted_text/inline_image_renderer.rb:42:in `unlink': No such file or directory @ unlink_internal - /tmp/image-20161005-19247-1ggstx9.png (Errno::ENOENT)
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/formatted_text/inline_image_renderer.rb:42:in `render_behind'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/box.rb:558:in `block in draw_fragment_underlays'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/box.rb:557:in `each'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/box.rb:557:in `draw_fragment_underlays'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/box.rb:277:in `draw_fragment'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/wrap.rb:148:in `block in format_and_draw_fragment'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/arranger.rb:245:in `block in apply_font_size'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/font.rb:101:in `font_size'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/prawn_ext/extensions.rb:282:in `font_size'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/arranger.rb:245:in `apply_font_size'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/arranger.rb:167:in `block in apply_font_settings'
    from /var/lib/gems/2.3.0/gems/pdf-core-0.6.1/lib/pdf/core/text.rb:204:in `character_spacing'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/arranger.rb:160:in `apply_font_settings'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/arranger.rb:136:in `apply_color_and_font_settings'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/wrap.rb:147:in `format_and_draw_fragment'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/wrap.rb:95:in `block in print_line'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/wrap.rb:93:in `each'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/wrap.rb:93:in `print_line'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/wrap.rb:61:in `wrap'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/formatted_text/inline_image_arranger.rb:15:in `wrap'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/box.rb:223:in `block (4 levels) in render'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/font.rb:101:in `font_size'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/prawn_ext/extensions.rb:282:in `font_size'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/box.rb:216:in `block (3 levels) in render'
    from /var/lib/gems/2.3.0/gems/pdf-core-0.6.1/lib/pdf/core/text.rb:182:in `text_rendering_mode'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/box.rb:211:in `block (2 levels) in render'
    from /var/lib/gems/2.3.0/gems/pdf-core-0.6.1/lib/pdf/core/text.rb:204:in `character_spacing'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/box.rb:210:in `block in render'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/font.rb:207:in `save_font'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text/formatted/box.rb:209:in `render'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text.rb:376:in `fill_formatted_text_box'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text.rb:356:in `draw_remaining_formatted_text_on_new_pages'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text.rb:216:in `formatted_text'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/text.rb:167:in `text'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:2483:in `typeset_text'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:1845:in `layout_prose'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:818:in `convert_content_for_list_item'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:811:in `convert_outline_list_item'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:757:in `block (2 levels) in convert_outline_list'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:754:in `each'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:754:in `block in convert_outline_list'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/document/bounding_box.rb:286:in `indent'
    from /var/lib/gems/2.3.0/gems/prawn-2.1.0/lib/prawn/document.rb:486:in `indent'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:753:in `convert_outline_list'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:740:in `convert_ulist'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:103:in `convert'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/abstract_block.rb:71:in `convert'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/list.rb:30:in `convert'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/abstract_block.rb:80:in `block in content'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/abstract_block.rb:80:in `map'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/abstract_block.rb:80:in `content'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:119:in `convert_content_for_block'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:358:in `convert_section'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:103:in `convert'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/abstract_block.rb:71:in `convert'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/abstract_block.rb:80:in `block in content'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/abstract_block.rb:80:in `map'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/abstract_block.rb:80:in `content'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/document.rb:1104:in `content'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:119:in `convert_content_for_block'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:177:in `convert_document'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/lib/asciidoctor-pdf/converter.rb:103:in `convert'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/document.rb:1044:in `convert'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor.rb:1503:in `convert'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/cli/invoker.rb:94:in `block in invoke!'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/cli/invoker.rb:86:in `each'
    from /var/lib/gems/2.3.0/gems/asciidoctor-1.5.4/lib/asciidoctor/cli/invoker.rb:86:in `invoke!'
    from /var/lib/gems/2.3.0/gems/asciidoctor-pdf-1.5.0.alpha.13/bin/asciidoctor-pdf:31:in `<top (required)>'
    from /usr/local/bin/asciidoctor-pdf:23:in `load'
    from /usr/local/bin/asciidoctor-pdf:23:in `<main>'

@mojavelinux
Copy link
Member

Doh! It looks like I forgot to apply the fix for inline images. I just committed a fix for it to master.

@mojavelinux
Copy link
Member

@istvanrath I'm curious, can you tell me which version of Ruby you are using. Just run asciidoctor-pdf -v. I still don't understand why Ruby sometimes deletes the temporary file before we can get to it.

@istvanrath
Copy link

Asciidoctor PDF 1.5.0.alpha.13 using Asciidoctor 1.5.4 [http://asciidoctor.org]
Runtime Environment (ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)

@mojavelinux
Copy link
Member

We're using the exact same version of Ruby. That's very strange. Perhaps it has to do with how Ruby is packaged (and somehow the behavior of tempfile is different). How is Ruby installed on your machine?

@mojavelinux
Copy link
Member

Also, if you remove the line that throws the error, does the image appear in your document?

@istvanrath
Copy link

I'm not using rvm, if that's the question. This is a large document with several images, and I'm only having trouble with the ones that are pulled in via remote URIs.

@mojavelinux
Copy link
Member

mojavelinux commented Oct 5, 2016

Yes, I can tell you are not using RVM. I'm just interested to know which distribution of Ruby you are using and on what platform. It's not irregular for packagers to slightly change the behavior of a program in the process of packaging it. I've seen it before. I'd just like to understand which installation might be doing that (so I know what I have to consider when developing).

@istvanrath
Copy link

I'm using Ruby on Ubuntu 16.04 LTS. It was installed via apt-get.

@mojavelinux
Copy link
Member

Thanks! That should help me study why we're getting different behaviors. Regardless, I still put the safeguard in place.

fapdash pushed a commit to vogellacompany/asciidoctor-pdf that referenced this issue Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants