Feature #3261

support attachment images in PDF export

Added by Timo Kosig over 8 years ago. Updated about 3 years ago.

Status:ClosedStart date:2009-04-29
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

100%

Category:PDF export
Target version:1.3.0
Resolution:Fixed

Description

When an issue is exported to PDF by using the "PDF" link at the end of the page the inline images which are attached to the issue and displayed on screen are not on the printout.

Only the wiki syntax for displaying the image is printed out like:

!attached_image!

Ideally the PDF export would contain those images as well so that any explanations of bugs which are supported by the images don't become incomprehensible.

See this issue as an example:
With inline images: http://www.redmine.org/issues/3100
No inline images: http://www.redmine.org/issues/3100.pdf

It would be great to get this as a feature as we use the PDF export a lot to give bug reports with screenshots back to external developers.

pdf_export_image_support.patch Magnifier (19 KB) Jun NAITOH, 2011-10-23 16:19

sample_test.txt Magnifier (162 Bytes) Jun NAITOH, 2011-10-23 16:19

sample_cats.jpg (176 KB) Jun NAITOH, 2011-10-23 16:19

sample_ice.gif (84.5 KB) Jun NAITOH, 2011-10-23 16:19

beer.png (202 KB) Jun NAITOH, 2011-10-23 16:25

pdf_export_image_support_jruby_test_fix.patch Magnifier (18.9 KB) Jun NAITOH, 2011-10-29 08:08

pdf-image-r7742.diff Magnifier (23.8 KB) Toshi MARUYAMA, 2011-11-06 11:57

pdf-image-r7788.diff Magnifier (22.8 KB) Toshi MARUYAMA, 2011-11-12 12:35

pdf-image-r7810.diff Magnifier (6.66 KB) Toshi MARUYAMA, 2011-11-15 01:53

pdf-external-url.diff Magnifier (830 Bytes) Toshi MARUYAMA, 2011-11-29 23:29


Related issues

Related to Redmine - Feature #69: Textilized description in PDF Closed
Related to Redmine - Feature #401: Add pdf export for WIKI page Closed
Related to Redmine - Defect #9533: Redmine Wiki Gchart LaTeX-style Formula plugin and PDF ex... Closed 2011-11-06
Related to Redmine - Feature #9693: support external url images in PDF Reopened

Associated revisions

Revision 7786
Added by Toshi MARUYAMA about 6 years ago

pdf: add logger at vendor/plugins/rfpdf/lib/tcpdf.rb (#3261)

Contributed by Jun NAITOH.

Revision 7806
Added by Toshi MARUYAMA about 6 years ago

improve rmagick feature of rfpdf plugin for PDF inline images (#3261)

Contributed by Jun NAITOH.

Revision 7810
Added by Toshi MARUYAMA about 6 years ago

move Changeset#to_utf8 logic to lib/redmine/codeset_util.rb for common use (#3261)

Revision 7827
Added by Toshi MARUYAMA about 6 years ago

pdf: lib: set image scale at issue_to_pdf method (#3261)

wiki_to_pdf method has already done.

Contributed by Jun NAITOH.

Revision 7907
Added by Toshi MARUYAMA almost 6 years ago

add unit application helper test to use latest image file (#3261)

Revision 7908
Added by Toshi MARUYAMA almost 6 years ago

move logic to use latest image file attachment to class method for common use (#3261)

Revision 7912
Added by Toshi MARUYAMA almost 6 years ago

pdf: lib: add the method to return attachment from filename and encoding (#3261)

Revision 7913
Added by Toshi MARUYAMA almost 6 years ago

pdf: lib: add "attachments" parameter at RDMwriteHTMLCell method (#3261)

Contributed by Jun NAITOH.

Revision 7914
Added by Toshi MARUYAMA almost 6 years ago

pdf: lib: prepare to use rfpdf plug-in rmagick feature (#3261)

Contributed by Jun NAITOH.

Revision 7915
Added by Toshi MARUYAMA almost 6 years ago

pdf: add the new feature to include attachment images (#3261)

Contributed by Jun NAITOH.

History

#1 Updated by Alex Last over 7 years ago

I don't see any images in exported PDF files

#2 Updated by Werner Marcus over 7 years ago

+1

#3 Updated by armroe armroe about 7 years ago

can this be possible?

#4 Updated by Mister Vince over 6 years ago

+1

#5 Updated by Toshi MARUYAMA over 6 years ago

  • Category changed from Issues to PDF export

#6 Updated by Terence Mill over 6 years ago

+1

#7 Updated by Robert Gröber over 6 years ago

+1
Exported pdf files have no value without the releated images!

#8 Updated by Torgrim Brochmann over 6 years ago

+1

#9 Updated by Steve Chen about 6 years ago

This issue is too important to everyone.
+1

#10 Updated by Steve Chen about 6 years ago

There's another way to solve this one...
Is it possible to make a detour like export html or msg file can use imagea within contents...
It might be give more simple implementations...

sorry for my poor engilsh.

#11 Updated by Jun NAITOH about 6 years ago

I implemented include inline images in issue PDF export.

  • need to rmagick.
    • I tested rmagick 2.13.1(Cent OS 6) and 2.12.0(Windows XP)
  • support image format : jpeg,png,gif (Extension is required.)
  • support attachment image file.
    !bar.jpg!
    
  • support remote URI image file.
    !http://www.redmine.org/bar.jpg!
    
  • support Percent-encoding (URL encoding) URI image file.
  • not support relative server path.
    !/foo/bar.jpg!
    
  • not support alignment.
    !>bar.jpg!
    
  • sorry, I am not test on JRuby environment. (but I think to work on JRuby environment without unit test.)

#12 Updated by Jun NAITOH about 6 years ago

#13 Updated by Jun NAITOH about 6 years ago

Sorry, I mistake upload "sample_beer.png" file. please use "beer.png" file.

#14 Updated by Toshi MARUYAMA about 6 years ago

  • Assignee set to Toshi MARUYAMA

#15 Updated by Jun NAITOH about 6 years ago

sorry, I am not test on JRuby environment. (but I think to work on JRuby environment without unit test.)

I tested on JRuby 1.6.2(CentOS 6.0), today. but, I couldn't work RMagick on JRuby...
Sorry, I think that PDF export function with image can't support to JRuby. Because I think to don't work RMagick on JRuby.

  • I rewrote unit test (test_rdm_pdf_iconv_cannot_convert_from_cp932) for JRuby.
    (This unit test is not related to RMagick.)
  • Deleted RAILS_DEFAULT_LOGGER for Rails 3.x compatibility. (change to Rails.logger)

The new patch (pdf_export_image_support_jruby_test_fix.patch) for trunk attached.

#16 Updated by Toshi MARUYAMA about 6 years ago

This is a full patch for r7742.
r7742 has a #401 feature.

#17 Updated by Toshi MARUYAMA about 6 years ago

This is a full patch for r7788.

#18 Updated by Etienne Massip about 6 years ago

Won't r7806 break if RMagick is not available?

#19 Updated by Etienne Massip about 6 years ago

Etienne Massip wrote:

Won't r7806 break if RMagick is not available?

Ok, it won't.

#20 Updated by Toshi MARUYAMA about 6 years ago

  • Subject changed from Include inline images in issue PDF export to Include inline images in PDF export

#21 Updated by Toshi MARUYAMA about 6 years ago

This is a full patch for r7810.

#22 Updated by Toshi MARUYAMA almost 6 years ago

This is a patch for external url support.

#23 Updated by Toshi MARUYAMA almost 6 years ago

  • Subject changed from Include inline images in PDF export to support attachment images in PDF export
  • % Done changed from 90 to 100

#24 Updated by Toshi MARUYAMA almost 6 years ago

  • Status changed from New to Closed
  • Resolution set to Fixed

I created new issue #9693 for external url images.

#25 Updated by André vS almost 6 years ago

Hi Toshi,

this Issue seems to be current in the actual stable-version 1.3.1.
When i try to export this issue to pdf the images aren't inline: http://www.redmine.org/issues/3100

#26 Updated by Toshi MARUYAMA almost 6 years ago

André vS wrote:

Hi Toshi,

this Issue seems to be current in the actual stable-version 1.3.1.
When i try to export this issue to pdf the images aren't inline: http://www.redmine.org/issues/3100

www.redmine.org is not upgraded.

#27 Updated by André vS almost 6 years ago

Ah, i see! Thank you for your reply.
It doesn't seem to be working in my local installation (1.3.1).
Even if use the "masked" format; link enclosed by "!"

I'm using debian squeeze, having the actual version of imagemagick installed.

#28 Updated by Toshi MARUYAMA almost 6 years ago

You need to install rmagick.
On Redmine 1.3-stable, run "gem install rmagick".

#29 Updated by André vS almost 6 years ago

I've installed debian-packages imagemagick and (libmagickcore-dev or libmagickwand-dev).
One of libmagickcore-dev or libmagickwand-dev is required, otherwise gem install rmagick will fail.
rmagick is installed and active, as i can see under "administration" -> "Information"

But still it's not working for me. PDF-Exports come without images, but HTML-Exports do.

#30 Updated by Gergo Nyiro over 5 years ago

Hello folks,

I use redmine 1.0.1 from debian stable repo.
Is it possible to create a patch for that version?
Thanks for your help in advance.

#31 Updated by Miodrag Milic over 3 years ago

I still don't see images in Redmine version 2.4

#32 Updated by li an about 3 years ago

Hi, redmine wiki can export pdf, but if there is image attached in the wiki, exported pdf cannot show the image, is it solved? I am using bitnami redmine 2.3.2, I cannot find solution about this, it is very urgent for us, for we are deciding if we can manage doc on redmine wiki, if pdf cannot show image, it is useless.

Hope to ge reply. Thanks.

Jun NAITOH wrote:

I implemented include inline images in issue PDF export.

  • need to rmagick.
    • I tested rmagick 2.13.1(Cent OS 6) and 2.12.0(Windows XP)
  • support image format : jpeg,png,gif (Extension is required.)
  • support attachment image file.
    [...]
  • support remote URI image file.
    [...]
  • support Percent-encoding (URL encoding) URI image file.
  • not support relative server path.
    [...]
  • not support alignment.
    [...]
  • sorry, I am not test on JRuby environment. (but I think to work on JRuby environment without unit test.)

#33 Updated by sebastien lemaitre about 3 years ago

Hi,

Same problem. Images (png, jpg) with the inline syntax are not displayed in pdf export. It's a pity, so i use chrome or firefox plugins like "Print Friendly & PDF" but it is not convenient.

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

#34 Updated by Toshi MARUYAMA about 3 years ago

li an wrote:

I am using bitnami redmine 2.3.2, I cannot find solution about this,

You should contact bitnami team.

Do not post to closed issue with target version.

#35 Updated by li an about 3 years ago

Hi, Sebastien,

I exported wiki page with html, and the image in the wiki page is such format "!https://xxx/redmine/attachments/download/xxx/f.png!", when exported html and saved to the local place of the 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 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.

Is any way to transfer html with pdf with image displayed....?

sebastien lemaitre wrote:

Hi,

Same problem. Images (png, jpg) with the inline syntax are not displayed in pdf export. It's a pity, so i use chrome or firefox plugins like "Print Friendly & PDF" but it is not convenient.

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

#36 Updated by li an about 3 years ago

Sorry, I wont' post under this closed issue later. But I do think it is not bitnami issue, redmine 2.3,2.2,2.4 does not solve that issue.

Toshi MARUYAMA wrote:

li an wrote:

I am using bitnami redmine 2.3.2, I cannot find solution about this,

You should contact bitnami team.

Do not post to closed issue with target version.

#37 Updated by sebastien lemaitre about 3 years ago

Hi li,

Sorry but I don't know. Your solution seems me more complicate than mine but why not.

li an wrote:

Hi, Sebastien,

I exported wiki page with html, and the image in the wiki page is such format "!https://xxx/redmine/attachments/download/xxx/f.png!", when exported html and saved to the local place of the 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 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.

Is any way to transfer html with pdf with image displayed....?

sebastien lemaitre wrote:

Hi,

Same problem. Images (png, jpg) with the inline syntax are not displayed in pdf export. It's a pity, so i use chrome or firefox plugins like "Print Friendly & PDF" but it is not convenient.

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

#38 Updated by sebastien lemaitre about 3 years ago

Hi Toshi,

Like Li sorry to re-post a closed issue but I think too that it is not a problem about bitnami. I use a turnkey machine. Even the online demonstration, I noticed this problem.

Toshi MARUYAMA wrote:

li an wrote:

I am using bitnami redmine 2.3.2, I cannot find solution about this,

You should contact bitnami team.

Do not post to closed issue with target version.

#39 Updated by Toshi MARUYAMA about 3 years ago

You should use

!image.png!
syntax.

Again, Do not post to closed issue with target version.

Also available in: Atom PDF