[Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ?

Added by Bruno Payen about 4 years ago

Hi,
PDF document export (from Wiki and Issues) is correct for text.
PDF document export is correct for Gantt

In Wiki and Issues, inline images (jpg and png attached files) are not displayed in the resulting PDF doc export (only text reference to attachment path shows).
  • Wiki and Issue inline images are OK in Redmine web UI
  • Thumbails are OK in Redmine web UI
  • ImageMagick and RMagick libraries seems correctly installed.
  • Attached images are without Alpha channel
  • No errors in Redmine production.log (Debug mode)

Anybody using 2.3.x using successfully this feature ?
Any idea on what to check on my setup or is this a known 2.3.1 bug or limitation any patch ?
Thank you

Remark: In Wiki HTML export, images are also broken with syntax

 !/attachments/download/xx/myimage.jpg!

Image are displayed if complete URL is given
 !http://myserver/attachments/download/xx/myimage.jpg!

My environment:
Platform Debian 6 (x86 64).
  Redmine version                          2.3.1.stable
  Ruby version                             1.9.3 (x86_64-linux)
  Rails version                            3.2.13
  Environment                              production
  Database adapter                         Mysql2
Redmine plugins:
  no plugin installed

Replies (33)

RE: Image not displayed in exported PDF document (version 2.3.1) ? - Added by Ivan Cenov about 4 years ago

AFAIK, exporting pictures to PDF is not implemented yet.

RE: Image not displayed in exported PDF document (version 2.3.1) ? - Added by Mischa The Evil about 4 years ago

Ivan Cenov wrote:

AFAIK, exporting pictures to PDF is not implemented yet.

This is not true. Inclusion of attached images in PDF export should be working in Redmine >= 1.3.0 (see #3261). OTOH, support for external url images in PDF export isn't supported (and probably won't be anytime soon, see #9693).

RE: Image not displayed in exported PDF document (version 2.3.1) ? - Added by Bruno Payen about 4 years ago

Ivan Cenov wrote:

AFAIK, exporting pictures to PDF is not implemented yet.

Thank you Ivan,
Which Redmine version are you refering to ?
As stated by Mischa seems Redmine >= 1.3.0 supports attached image, see #3261
However i'm using 2.3.1, no success ...

RE: Image not displayed in exported PDF document (version 2.3.1) ? - Added by Bruno Payen about 4 years ago

Mischa The Evil wrote:

Ivan Cenov wrote:

AFAIK, exporting pictures to PDF is not implemented yet.

This is not true. Inclusion of attached images in PDF export should be working in Redmine >= 1.3.0 (see #3261). OTOH, support for external url images in PDF export isn't supported (and probably won't be anytime soon, see #9693).

Thank you Mischa.
I'm using attached images only.

Is defect #14178 (PDF API Broken in 2.3.1) fixed in 2.3.2 refer to this issue (description seems not to).

Any idea to investigate why no success in my Redmine 2.3.1 setup ?

RE: Image not displayed in exported PDF document (version 2.3.1) ? - Added by Ivan Cenov about 4 years ago

Mischa The Evil wrote:

Ivan Cenov wrote:

AFAIK, exporting pictures to PDF is not implemented yet.

This is not true. Inclusion of attached images in PDF export should be working in Redmine >= 1.3.0 (see #3261). OTOH, support for external url images in PDF export isn't supported (and probably won't be anytime soon, see #9693).

Mischa The Evil, you are right. It was my impression that this did not work. Some time ago I tested and it did not work, obviously this was before it had been implemented. I tested without plugins now, then with all plugins that I use and it works (my Redmine is up-to-day trunk).

Here is a list of plugins I use and that do not disturb picture exporting in PDF:

clipboard_image_paste
projects_tree_view
redmine_apijs
redmine_code_review
redmine_didyoumean
redmine_favourite_projects
redmine_information
redmine_issue_checklist
redmine_issue_detailed_tabs_time
redmine_landing_page
redmine_local_avatars
redmine_pastebin
redmine_plugin_views_revisions
redmine_stealth
redmine_theme_changer
redmine_user_issues
redmine_wiki_gchart_formula
redmine_wiki_lists
redmine_xls_export
redmine_youtube
sidebar_hide
wiking
wiki_issue_fields

@ Bruno Payen: see your plugins. May be some of them prevent this to work?

RE: Image not displayed in exported PDF document (version 2.3.1) ? - Added by Bruno Payen about 4 years ago

Ivan Cenov wrote:

Mischa The Evil, you are right. It was my impression that this did not work. Some time ago I tested and it did not work, obviously this was before it had been implemented. I tested without plugins now, then with all plugins that I use and it works (my Redmine is up-to-day trunk).

Here is a list of plugins I use and that do not disturb picture exporting in PDF:
[...]

@ Bruno Payen: see your plugins. May be some of them prevent this to work?

No plugins ... And no errors in production.log (debug mode) ....
I'don't know how to trace the PDF conversion process to understand what is wrong in my 2.3.1 setup ?

RE: Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by Mischa The Evil about 4 years ago

The only known issues with image to PDF conversion I know of are:
  • does not support 16 bit depth PNG's
  • does not support alpha channel PNG's

For certainty: are you using correct syntax? The examples in the initial post seem to include an superfluous ). If this is actually part of the filename... :/

RE: Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by Bruno Payen about 4 years ago

Mischa The Evil wrote:

The only known issues with image to PDF conversion I know of are:
  • does not support 16 bit depth PNG's
  • does not support alpha channel PNG's

OK , so it's my setup ...

For certainty: are you using correct syntax? The examples in the initial post seem to include an superfluous ). If this is actually part of the filename... :/

Yes i do.
Syntax is OK. Typos are only in the examples.
Any idea on how to trace the PDF export process ?
Nothing in debug mode ...

RE: Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by Ivan Cenov about 4 years ago

Mischa The Evil wrote:

The only known issues with image to PDF conversion I know of are:
  • does not support 16 bit depth PNG's
  • does not support alpha channel PNG's

For certainty: are you using correct syntax? The examples in the initial post seem to include an superfluous ). If this is actually part of the filename... :/

If the attachment is attached to the wiki page that embed it,

!myimage.jpg!

should be enough.

RE: Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by Bruno Payen about 4 years ago

Bingo ! Short syntax did it for attached images (Wiki and Issues):

!myimage.jpg!

Thank you Ivan and Mischa for solving this.

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by Jürgen Depicker about 3 years ago

I'm sorry, but how can this be considered solved, if images are not exported when referred to in other valid textile formats?

I quote from http://www.redmine.org/projects/redmine/wiki/RedmineTextFormatting

Inline images

!image_url! displays an image located at image_url (textile syntax)
!>image_url! right floating image
!image_url(Image title)! displays an image with an alt/title attribute
!image_url!:URL displays an image located at image_url with link URL added
If you have an image attached to your wiki page, it can be displayed inline using its filename: !attached_image.png!

It also seems that only jpg files are in the PDF; pngs are not included, even when referenced by filename.

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by li an about 3 years ago

Sorry, I try the simple syntax, still does not work, can you help with it?

in my wiki page, image is shown as "!agilemilestone.jpg!" I have put the wiki page and plugin I installed in the attachment.

I exported pdf directly, the font seems strange and image not displayed.

I try another complex way, modifying image quote way in the wiki page as !http://xxx/download/xx/myimage.jpg!

exported html to the local place of my pc, only if I login redmine, then open the html the image can be shown, if redmine is logged out, the image in the html cannot be shown. And I want to mention, whatever redmine is login or not, if image quote way is "!myimage.jpg!", exported html can not display the image.

Then I keeping redmine logging in, and use wkhtmltopdf to print redmine wiki exported html to pdf, the command is like "wkhtmltopdf C:\Users\xx\AppData\Local\Temp\design.html design.pdf", pdf file does not show image.----SDD.pdf I attached.

So now there is no way to solve the image not shown in pdf format, and I think it is so ugly even if no image only English texts are directly using wiki-pdf button.

Is there good way to solve the 2 problems?

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by sebastien lemaitre about 3 years ago

Hi,

I have exactly the same problem. Even the online demonstration, I noticed this problem.

Environment:
Redmine version 2.2.3.stable
Ruby version 1.8.7 (x86_64-linux)
Rails version 3.2.12
Environment production
Database adapter MySQL
Redmine plugins:
redmine_people 0.1.6

Thanks

li an wrote:

Sorry, I try the simple syntax, still does not work, can you help with it?

in my wiki page, image is shown as "!agilemilestone.jpg!" I have put the wiki page and plugin I installed in the attachment.

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by li an about 3 years ago

Is anyone who solve problem when using wiki to export pdf attach images? It is very urgent issue for me, hope to get some help, thanks a lot!

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by li an about 3 years ago

Finally,

I tested much and found for wiki exported documents with image dispalyed:

1.export to pdf: image shall be quoted like , make sure the simple syntax, and the image format is png, jpg fails to be displayed.
2.export to html: image shall be quoted like


!http://xxxx...//image.png!

is unvalid for displaying.

image format can be jpg and png.

But if you want the exported html with image can be displayed, make sure redmine is logged in, if it is logged out, image in the html can not be displayed.

Now I can not find a way to dispaly html with image without redmine logging limit, if anybody knows, it is very nice to post it.

And also I can not find a way to transfer html to pdf with image displaying, maybe the same issue that image is need access of redmine.

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by Mischa The Evil about 3 years ago

Fwiw: upcoming Redmine 2.6.0 release will contain lots of fixes and improvements to PDF export. See eg. #17570.

Kind regards,

Mischa.

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by Toshi MARUYAMA about 3 years ago

!http://xxxx...//image.png!

is not work because of #9693.

You should use

!image.png!

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by li an about 3 years ago

Yes, you are right, I tested, only

!image.png!

works.

That limits image format and image quote way.

If image is external link, it canot work.

So if there is such image externally, I think the way is to save it and upload to redmine... then quote like

!image.png!

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by li an about 3 years ago

It is great news!I have some questions:

1.all the attachments of #17570 are included in redmine 2.6,right?
2.I am using redmine 2.3.2, many plug-in are installed, if update to redmine 2.6, plug-ins may have problems,If there is plug-in not working well under 2.6 redmine, can I just keep redmine 2.3.2, and download the attachments of #17570, make the files replace original files in redmine 2.3.2 to fix pdf export issues?

e.g.replace config/locales/zh.yml with config_localse_r13333 in #17570.

Mischa The Evil wrote:

Fwiw: upcoming Redmine 2.6.0 release will contain lots of fixes and improvements to PDF export. See eg. #17570.

Kind regards,

Mischa.

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by li an about 3 years ago

Hi,

I summarize of wiki pdf displaying image steps:

1.image format:png
2.image should be uploaded at the current wiki page, that means if you add an image in "files" or "documents" of the project, although wiki is in the same project, you can not dispaly image in "files" or "documents"
3.image quote way:!image.png!

If all 3 are followed, wiki-pdf can show image normally.

Toshi MARUYAMA wrote:

[...]
is not work because of #9693.

You should use
[...]

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by sebastien lemaitre about 3 years ago

li an wrote:

Hi,

I summarize of wiki pdf displaying image steps:

Hi

Thanks for your help. I must be an idiot because everybody says that pdf export is ok, but not for me.
Nor on my personnel redmine or my plateforme test http://ccvi.m.redmine.org/projects/test/wiki/Wiki, export image doesn't work.

On http://ccvi.m.redmine.org/projects/test/wiki/Wiki I have used !a.png! syntax. I converted this image in png from photoshop.

What is wrong ?

1.image format:png
2.image should be uploaded at the current wiki page, that means if you add an image in "files" or "documents" of the project, although wiki is in the same project, you can not dispaly image in "files" or "documents"
3.image quote way:!image.png!

If all 3 are followed, wiki-pdf can show image normally.

Toshi MARUYAMA wrote:

[...]
is not work because of #9693.

You should use
[...]

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by Jun NAITOH almost 3 years ago

sebastien lemaitre wrote:

Thanks for your help. I must be an idiot because everybody says that pdf export is ok, but not for me.
Nor on my personnel redmine or my plateforme test http://ccvi.m.redmine.org/projects/test/wiki/Wiki, export image doesn't work.

I checked this PNG img file.

  • log/production.log
    pdf: Image: error: TCPDF error: 16-bit depth not supported: /opt/Redmine/redmine.d/redmine-2.4.6/files/2014/10/141015134901_a.png
    

16bit PNG image is not supported before Redmine 2.5.x.
16bit PNG image was supported by Redmine 2.6.

please see #14599 #17570

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by sebastien lemaitre almost 3 years ago

Hi Jun and very thanks for your help!

I was confident but unfortunately this is not possible even in 8 bits. I turned into 8 bit image and has added two more images. None is exported. I'll think to migrate my version of Redmine.

Jun NAITOH wrote:

I checked this PNG img file.

  • log/production.log
    [...]

16bit PNG image is not supported before Redmine 2.5.x.
16bit PNG image was supported by Redmine 2.6.

please see #14599 #17570

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by Jun NAITOH almost 3 years ago

sebastien lemaitre wrote:

I was confident but unfortunately this is not possible even in 8 bits. I turned into 8 bit image and has added two more images. None is exported. I'll think to migrate my version of Redmine.

The image display in PDF export requires RMagick library.
and, 8bit/16bit alpha channel PNG image is not supported before Redmine 2.5.x.

before Redmine 2.5.x. support Image formats on PDF export

  • 8bit PNG image support. (use RMagick liblary)
  • 16bit PNG image not support.
  • 8bit/16bit alpha channel PNG image not support.
  • JPEG image support. (use RMagick liblary)
  • GIF image support. (use RMagick liblary)

Redmine 2.6 support Image formats on PDF export

  • 8bit PNG image support without RMagick liblary.
  • 16bit PNG image support. (use RMagick liblary)
  • 8bit/16bit alpha channel PNG image support. (use RMagick liblary)
  • JPEG image support. (use RMagick liblary)
  • GIF image support. (use RMagick liblary)

RE: [Solved] Image not displayed in exported PDF document (Redmine version 2.3.1) ? - Added by li an almost 3 years ago

Sorry, but I tested gif and jpg cannot be displayed, only 8 bit PNG can be displayed. My redmine is 2.3.2.

And I think if 8bit png can be displayed, rmagick is ok, I checked gemfile.lock, there is rmagick included.

Jun NAITOH wrote:

sebastien lemaitre wrote:

I was confident but unfortunately this is not possible even in 8 bits. I turned into 8 bit image and has added two more images. None is exported. I'll think to migrate my version of Redmine.

The image display in PDF export requires RMagick library.
and, 8bit/16bit alpha channel PNG image is not supported before Redmine 2.5.x.

before Redmine 2.5.x. support Image formats on PDF export

  • 8bit PNG image support. (use RMagick liblary)
  • 16bit PNG image not support.
  • 8bit/16bit alpha channel PNG image not support.
  • JPEG image support. (use RMagick liblary)
  • GIF image support. (use RMagick liblary)

Redmine 2.6 support Image formats on PDF export

  • 8bit PNG image support without RMagick liblary.
  • 16bit PNG image support. (use RMagick liblary)
  • 8bit/16bit alpha channel PNG image support. (use RMagick liblary)
  • JPEG image support. (use RMagick liblary)
  • GIF image support. (use RMagick liblary)

1 2 (1-25/33)