SVG Error - Undefined method `clear' for nil:NilClass

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

SVG Error - Undefined method `clear' for nil:NilClass

weezair
I have an issue where asciidoctor-pdf fails to compile an .adoc with a custom theme.  The compile seems to fail due to the theme's reference if an .svg for page-background-image:

page:
  background-image: image:background.svg[]

It fails with the following error:

undefined method `clear' for nil:NilClass

I'm running this on a mac asciidoctor 2.0.10 with asciidoctor-pdf 1.5.0.rc.3.  When I run a trace I get:

Traceback (most recent call last):
        16: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
        15: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
        14: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/asciidoctor-pdf:23:in `<main>'
        13: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/asciidoctor-pdf:23:in `load'
        12: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/bin/asciidoctor-pdf:27:in `<top (required)>'
        11: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `invoke!'
        10: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `each'
         9: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:128:in `block in invoke!'
         8: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `convert_file'
         7: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `open'
         6: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `block in convert_file'
         5: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:118:in `convert'
         4: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:951:in `convert'
         3: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/converter.rb:129:in `convert'
         2: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/converter.rb:186:in `convert_document'
         1: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/converter.rb:2573:in `layout_title_page'
/Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/ext/pdf-core/page.rb:46:in `reset_content': undefined method `clear' for nil:NilClass (NoMethodError)

When I replace the background.svg with a background.png file, no issues.

Interesting part is that the theme is already referencing a foreground.svg under page-foreground-image and it works fine.

I went and checked the background.svg multiple times, compared it to and even replaced it with the foreground.svg, and no luck.  I tried different export .svg setting from the graphics app (Affinity Designer), even made sure the settings were the same for foreground and background files, again no luck.  

Any ideas?

_*Thanks*_.
Reply | Threaded
Open this post in threaded view
|

Re: SVG Error - Undefined method `clear' for nil:NilClass

mojavelinux
Administrator
Please file an issue at https://github.com/asciidoctor/asciidoctor-pdf and I'll have a look. Also, please provide a copy of the SVG so that I can investigate.

Best,

-Dan

On Sun, Feb 9, 2020 at 11:50 AM weezair [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I have an issue where asciidoctor-pdf fails to compile an .adoc with a custom theme.  The compile seems to fail due to the theme's reference if an .svg for page-background-image:

page:
  background-image: image:background.svg[]

It fails with the following error:

undefined method `clear' for nil:NilClass

I'm running this on a mac asciidoctor 2.0.10 with asciidoctor-pdf 1.5.0.rc.3.  When I run a trace I get:

Traceback (most recent call last):
        16: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
        15: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
        14: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/asciidoctor-pdf:23:in `<main>'
        13: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/asciidoctor-pdf:23:in `load'
        12: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/bin/asciidoctor-pdf:27:in `<top (required)>'
        11: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `invoke!'
        10: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `each'
         9: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:128:in `block in invoke!'
         8: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `convert_file'
         7: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `open'
         6: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `block in convert_file'
         5: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:118:in `convert'
         4: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:951:in `convert'
         3: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/converter.rb:129:in `convert'
         2: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/converter.rb:186:in `convert_document'
         1: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/converter.rb:2573:in `layout_title_page'
/Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/ext/pdf-core/page.rb:46:in `reset_content': undefined method `clear' for nil:NilClass (NoMethodError)

When I replace the background.svg with a background.png file, no issues.

Interesting part is that the theme is already referencing a foreground.svg under page-foreground-image and it works fine.

I went and checked the background.svg multiple times, compared it to and even replaced it with the foreground.svg, and no luck.  I tried different export .svg setting from the graphics app (Affinity Designer), even made sure the settings were the same for foreground and background files, again no luck.  

Any ideas?

_*Thanks*_.


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/SVG-Error-Undefined-method-clear-for-nil-NilClass-tp7615.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: SVG Error - Undefined method `clear' for nil:NilClass

mojavelinux
Administrator
Good news. I was able to reproduce the problem. I still would like you to file an issue since you discovered it.

Best,

-Dan

On Sun, Feb 9, 2020 at 2:43 PM mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Please file an issue at https://github.com/asciidoctor/asciidoctor-pdf and I'll have a look. Also, please provide a copy of the SVG so that I can investigate.

Best,

-Dan

On Sun, Feb 9, 2020 at 11:50 AM weezair [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I have an issue where asciidoctor-pdf fails to compile an .adoc with a custom theme.  The compile seems to fail due to the theme's reference if an .svg for page-background-image:

page:
  background-image: image:background.svg[]

It fails with the following error:

undefined method `clear' for nil:NilClass

I'm running this on a mac asciidoctor 2.0.10 with asciidoctor-pdf 1.5.0.rc.3.  When I run a trace I get:

Traceback (most recent call last):
        16: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `<main>'
        15: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/ruby_executable_hooks:24:in `eval'
        14: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/asciidoctor-pdf:23:in `<main>'
        13: from /Users/chuck/.rvm/gems/ruby-2.6.3/bin/asciidoctor-pdf:23:in `load'
        12: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/bin/asciidoctor-pdf:27:in `<top (required)>'
        11: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `invoke!'
        10: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:111:in `each'
         9: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/cli/invoker.rb:128:in `block in invoke!'
         8: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `convert_file'
         7: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `open'
         6: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:183:in `block in convert_file'
         5: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/convert.rb:118:in `convert'
         4: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-2.0.10/lib/asciidoctor/document.rb:951:in `convert'
         3: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/converter.rb:129:in `convert'
         2: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/converter.rb:186:in `convert_document'
         1: from /Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/converter.rb:2573:in `layout_title_page'
/Users/chuck/.rvm/gems/ruby-2.6.3/gems/asciidoctor-pdf-1.5.0.rc.3/lib/asciidoctor/pdf/ext/pdf-core/page.rb:46:in `reset_content': undefined method `clear' for nil:NilClass (NoMethodError)

When I replace the background.svg with a background.png file, no issues.

Interesting part is that the theme is already referencing a foreground.svg under page-foreground-image and it works fine.

I went and checked the background.svg multiple times, compared it to and even replaced it with the foreground.svg, and no luck.  I tried different export .svg setting from the graphics app (Affinity Designer), even made sure the settings were the same for foreground and background files, again no luck.  

Any ideas?

_*Thanks*_.


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/SVG-Error-Undefined-method-clear-for-nil-NilClass-tp7615.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux



If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/SVG-Error-Undefined-method-clear-for-nil-NilClass-tp7615p7617.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: SVG Error - Undefined method `clear' for nil:NilClass

weezair
background.svg

Thanks for the feedback.  I've uploaded the svg.



Reply | Threaded
Open this post in threaded view
|

Re: SVG Error - Undefined method `clear' for nil:NilClass

mojavelinux
Administrator
Can you please file an issue as well?

-Dan

On Sun, Feb 9, 2020 at 3:06 PM weezair [via Asciidoctor :: Discussion] <[hidden email]> wrote:
background.svg

Thanks for the feedback.  I've uploaded the svg.






If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/SVG-Error-Undefined-method-clear-for-nil-NilClass-tp7615p7619.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: SVG Error - Undefined method `clear' for nil:NilClass

weezair
Will do.  Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: SVG Error - Undefined method `clear' for nil:NilClass

mojavelinux
Administrator
Thanks! By the way, I have a fix ready to submit.

-Dan

On Sun, Feb 9, 2020, 15:48 weezair [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Will do.  Thanks.


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/SVG-Error-Undefined-method-clear-for-nil-NilClass-tp7615p7621.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML
Reply | Threaded
Open this post in threaded view
|

Re: SVG Error - Undefined method `clear' for nil:NilClass

weezair
In reply to this post by weezair
Issue is posted as SVG Theme - Background Image Error #1546 at https://github.com/asciidoctor/asciidoctor-pdf/issues/1546
Reply | Threaded
Open this post in threaded view
|

Re: SVG Error - Undefined method `clear' for nil:NilClass

weezair
In reply to this post by mojavelinux
Awesome.  Thanks!