Project

General

Profile

Actions

Patch #5629

closed

Wrap text fields properly in PDF

Added by Hugo Ferreira about 14 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Toshi MARUYAMA
Category:
PDF export
Target version:
Start date:
2010-06-01
Due date:
% Done:

100%

Estimated time:

Description

This patch fixes wrapping problems with text fields (subject and custom text and long text fields) when generating a PDF.

The main fixes were:

Single Issue:
  • wrap subject in both the page title and in the table cell
  • the description was not being printed
  • wrap journal details indicating what changed
Issues List:
  • wrap text in all cells of the table, regardless of type
  • give custom "text" and "long text" fields the same width weight as the subject

Files

wrap_text_fields_in_pdf_r3764.patch (7.38 KB) wrap_text_fields_in_pdf_r3764.patch Patch for wrap text fields in PDF Hugo Ferreira, 2010-06-01 13:47
sandbox-1.pdf (3.15 KB) sandbox-1.pdf Example PDF export of a "Single Issue" Hugo Ferreira, 2010-06-01 13:47
export.pdf (4.42 KB) export.pdf Example PDF export of an "Issues List" Hugo Ferreira, 2010-06-01 13:47
issue5629_wrap_text_fields_in_pdf_r4213.patch (7.17 KB) issue5629_wrap_text_fields_in_pdf_r4213.patch Patch updated for Redmine 1.0.2 Hugo Ferreira, 2010-09-29 02:08
issue5629_wrap_text_fields_in_pdf_r4784.patch (7.46 KB) issue5629_wrap_text_fields_in_pdf_r4784.patch Patch updated for Redmine v1.1.1 (r4784) Hugo Ferreira, 2011-02-01 14:53
chinese.rb.patch (364 Bytes) chinese.rb.patch Jun NAITOH, 2011-04-30 07:39
before_chinese.rb.patch.png (53.5 KB) before_chinese.rb.patch.png Jun NAITOH, 2011-04-30 07:39
after_chinese.rb.patch.png (53.1 KB) after_chinese.rb.patch.png Jun NAITOH, 2011-04-30 07:39

Related issues

Related to Redmine - Defect #61: Broken character encoding in pdf exportClosedToshi MARUYAMA

Actions
Related to Redmine - Defect #7386: NoMethodError on pdf exportClosed2011-01-20

Actions
Has duplicate Redmine - Defect #4686: When exporting to PDF, text should wrap and honor newlines, instead of being constrained to one lineClosed2010-01-28

Actions
Actions #1

Updated by David Le Dieu about 14 years ago

Thanks for addressing this Hugo - it will certainly be a nice improvement. I am trying to run the patch but get the following output...

bash-4.1$ patch p0 < wrap_text_fields_in_pdf_r3764.patch
patching file patch
Hunk #1 FAILED at 87.
Hunk #2 FAILED at 100.
Hunk #3 FAILED at 122.
Hunk #4 FAILED at 140.
Hunk #5 FAILED at 159.
Hunk #6 FAILED at 174.
Hunk #7 FAILED at 185.
Hunk #8 FAILED at 194.
Hunk #9 FAILED at 247.
Hunk #10 FAILED at 286.
10 out of 10 hunks FAILED -
saving rejects to file patch.rej

Any idea what I might be doing wrong? I am running the latest bitnami redmine stack if that gives you any clues.

Actions #2

Updated by Hugo Ferreira almost 14 years ago

Eric, can't you check this patch I've just updated for v1.0.2?
Would it be possible to get it in while it is still up-to-date with the latest version of the "lib/redmine/export/pdf.rb" file?

Actions #3

Updated by Hugo Ferreira almost 14 years ago

David Le Dieu wrote:

Any idea what I might be doing wrong? I am running the latest bitnami redmine stack if that gives you any clues.

Not really sure, but most likely at the time the bitnami version had already moved past the v0.9.4 against which the patch was made.

This new version tested successfully against Redmine v1.0.2 (r4213) so you can try it again on that version, although I believe the bitnami is still at v1.0.1 and considering that the patched file was changed from v1.0.1 to v1.0.2 I'm not sure it'll update successfully.

Actions #4

Updated by Eric Davis over 13 years ago

  • Assignee deleted (Eric Davis)
Actions #5

Updated by Michael P over 13 years ago

Hi,
is this patch still working for V1.1.0?

Actions #6

Updated by Michael P over 13 years ago

  • Assignee set to Hugo Ferreira
Actions #7

Updated by Hugo Ferreira over 13 years ago

Nope, it does not apply successfully to the latest v1.1.1, since there was a small change made in r4736 that touched one of the lines of the patch.

I'm attaching a new patch that works on the latest r4784: "issue5629_wrap_text_fields_in_pdf_r4784.patch"

Actions #8

Updated by Hugo Ferreira over 13 years ago

Now, who can pick this up and commit it to trunk?
(before the main code moves yet again and invalidates this patch… it's been 8 months, already!)

Actions #9

Updated by Etienne Massip over 13 years ago

  • Category set to PDF export
Actions #10

Updated by Toshi MARUYAMA about 13 years ago

  • % Done changed from 100 to 50
Actions #11

Updated by Toshi MARUYAMA about 13 years ago

  • Status changed from Resolved to New
  • Assignee changed from Hugo Ferreira to Toshi MARUYAMA
Actions #12

Updated by Toshi MARUYAMA about 13 years ago

  • Status changed from New to Closed
  • Target version set to 1.2.0
  • % Done changed from 50 to 100

Committed in r5604, thanks.

Actions #13

Updated by Jun NAITOH about 13 years ago

I found the bug of the Automatic line break in Chinese PDF of r5604.
This is FPDF original bug. (Japanse and Korean don't have this problem)

I wrote patch.

Actions #14

Updated by Toshi MARUYAMA about 13 years ago

  • Status changed from Reopened to Closed

Note 13 patch is committed in r5605, thanks.

Actions #15

Updated by Hugo Ferreira about 13 years ago

Thanks for the prompt reply Toshi.
Congrats for the excellent work; things feel much lively around here lately.

Actions

Also available in: Atom PDF