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

Cannot produce PDF using imagesdir having a URL #467

Closed
rodneyFinlay opened this issue Jun 15, 2016 · 3 comments
Closed

Cannot produce PDF using imagesdir having a URL #467

rodneyFinlay opened this issue Jun 15, 2016 · 3 comments
Assignees
Labels

Comments

@rodneyFinlay
Copy link

rodneyFinlay commented Jun 15, 2016

I need to embed images in the PDF from a central repository referenced by a URL pointed to the base location. During the invocation to asciidoctor-pdf I'm getting the below error:
undefined local variable or method `image_base_uri' for #Asciidoctor::Pdf::Converter:0x007fef9402fba8
Did you mean? image_page
Use --trace for backtrace

All documentation seems to agree that if the base URL is in the imagesdir attribute that the image:: block should simply embed the image at that position.

Excerpt from adoc file:

:imagesdir: http://upload.wikimedia.org/wikipedia/commons

image::3/35/Tux.svg[Tux,250,350]


Attempting to build using: asciidoctor-pdf -r asciidoctor-diagram -a allow-uri-read $1

using version 1.5.4 of asciidoctor-pdf

mojavelinux added a commit to mojavelinux/asciidoctor-pdf that referenced this issue Jun 23, 2016
- fix use of invalid variable name
- autoload OpenURI before reading image
- fix duplicate forward slash in resolved path
@mojavelinux mojavelinux self-assigned this Jun 23, 2016
@mojavelinux
Copy link
Member

Oops, it looks like I made several errors when programming this behavior. Thanks for bringing this to my attention! I've issued a fix as PR #468.

Even with this fix, you still need to use the https version of the URL since the wikimedia server does not support a redirect to https (at least not when using the built-in Ruby HTTP client):

:imagesdir: https://upload.wikimedia.org/wikipedia/commons

image::3/35/Tux.svg[Tux,250,350]

@mojavelinux mojavelinux added this to the v1.5.0.alpha.12 milestone Jun 23, 2016
@rodneyFinlay
Copy link
Author

Great news. Thanks for addressing this problem. When is v1.5 due to go to beta / GA?

@mojavelinux
Copy link
Member

I'm not sure about beta, but I'm trying to get another alpha out asap. I've just been very busy lately, but it's going to happen any day now.

fapdash pushed a commit to vogellacompany/asciidoctor-pdf that referenced this issue Dec 13, 2016
…or#468)

- fix use of invalid variable name
- autoload OpenURI before reading image
- fix duplicate forward slash in resolved path
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

2 participants