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

Exported PDF does not include images #820

Closed
mdev88 opened this Issue May 12, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@mdev88
Copy link

mdev88 commented May 12, 2018

Hello, I'm not sure if there is a problem with my installation of HackMD, but when I export as PDF, all the images appear as "broken image" icons.

captura de pantalla_2018-05-12_11-46-45

This happens with external images and images uploaded by me in HackMD as well.

Any ideas?

Thanks!

@SISheogorath

This comment has been minimized.

Copy link
Contributor

SISheogorath commented May 12, 2018

Can you provide a document to reproduce it?

Seems to be working when I use our features page: https://hackmd-ce.herokuapp.com/features#

@mdev88

This comment has been minimized.

Copy link
Author

mdev88 commented May 12, 2018

Thanks for the quick reply!

Here you go: https://pad.tttdevs.com/GGO87DrASlKPEh6Nq6kzbg#

@SISheogorath

This comment has been minimized.

Copy link
Contributor

SISheogorath commented May 12, 2018

Okay, after a quick test, this is caused by relative links that are created on upload.

Not sure how to fix it yet, but at least we know what's wrong. This only happens when filesystem is used as upload method.

@SISheogorath SISheogorath added bug and removed needs info labels May 12, 2018

@mdev88

This comment has been minimized.

Copy link
Author

mdev88 commented May 12, 2018

Allright! If you need anything else just let me know.

@jackycute

This comment has been minimized.

Copy link
Member

jackycute commented May 13, 2018

I think maybe convert the img src starts with / to file:/// might help.

fbartels added a commit to fbartels/cloudron-hackmd that referenced this issue Jun 7, 2018

disable pdf export until hackmdio/codimd#820 is fixed
Signed-off-by: Felix Bartels <felix@host-consultants.de>
@zeigerpuppy

This comment has been minimized.

Copy link

zeigerpuppy commented Oct 15, 2018

I continue to have an issue with generated PDFs not showing images (using latest v1.2.1 built with docker-compose).

For an example see: https://codimd.greenant.net/tDha9czKRXm30iW-dqOHFg#

The image URLs appears to be generated properly (as a full URL with https://) but there is no image visible in the PDF.

my relevant environment variables are:

      - CMD_DOMAIN=codimd.greenant.net
      - CMD_PROTOCOL_USESSL=true
      - CMD_USECDN=false
      - CMD_URL_ADDPORT=false
      - CMD_IMAGE_UPLOAD_TYPE=filesystem
@SISheogorath

This comment has been minimized.

Copy link
Contributor

SISheogorath commented Oct 15, 2018

@zeigerpuppy can you check that wget -O- https://codimd.greenant.net/tDha9czKRXm30iW-dqOHFg/download from inside the container results in the markdown of your instance printed out to your cli?

My current guess why it fails in your case is that your container doesn't have access to the outside address of your reverse proxy.

@zeigerpuppy

This comment has been minimized.

Copy link

zeigerpuppy commented Oct 15, 2018

Thanks @SISheogorath, that was the issue!

I have now set my internal DNS server to redirect to the local web proxy (internal address) and now the PDF export works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.