Patch #5629

Wrap text fields properly in PDF

Added by Hugo Ferreira over 7 years ago. Updated over 6 years ago.

Status:ClosedStart date:2010-06-01
Priority:NormalDue date:
Assignee:Toshi MARUYAMA% Done:

100%

Category:PDF export
Target version:1.2.0

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

wrap_text_fields_in_pdf_r3764.patch Magnifier - Patch for wrap text fields in PDF (7.38 KB) Hugo Ferreira, 2010-06-01 13:47

sandbox-1.pdf - Example PDF export of a "Single Issue" (3.15 KB) Hugo Ferreira, 2010-06-01 13:47

export.pdf - Example PDF export of an "Issues List" (4.42 KB) Hugo Ferreira, 2010-06-01 13:47

issue5629_wrap_text_fields_in_pdf_r4213.patch Magnifier - Patch updated for Redmine 1.0.2 (7.17 KB) Hugo Ferreira, 2010-09-29 02:08

issue5629_wrap_text_fields_in_pdf_r4784.patch Magnifier - Patch updated for Redmine v1.1.1 (r4784) (7.46 KB) Hugo Ferreira, 2011-02-01 14:53

chinese.rb.patch Magnifier (364 Bytes) Jun NAITOH, 2011-04-30 07:39

before_chinese.rb.patch.png (53.5 KB) Jun NAITOH, 2011-04-30 07:39

after_chinese.rb.patch.png (53.1 KB) Jun NAITOH, 2011-04-30 07:39


Related issues

Related to Redmine - Defect #61: Broken character encoding in pdf export Closed
Related to Redmine - Defect #7386: NoMethodError on pdf export Closed 2011-01-20
Duplicated by Redmine - Defect #4686: When exporting to PDF, text should wrap and honor newline... Closed 2010-01-28

Associated revisions

Revision 5604
Added by Toshi MARUYAMA over 6 years ago

Wrap long text fields properly in PDF exports (#5629).

Contributed by Hugo Ferreira.

Revision 5605
Added by Toshi MARUYAMA over 6 years ago

PDF: fix automatic line break in Chinese PDF (#5629).

Contributed by Jun NAITOH.

History

#1 Updated by David Le Dieu about 7 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.

#2 Updated by Hugo Ferreira about 7 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?

#3 Updated by Hugo Ferreira about 7 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.

#4 Updated by Eric Davis almost 7 years ago

  • Assignee deleted (Eric Davis)

#5 Updated by Michael P over 6 years ago

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

#6 Updated by Michael P over 6 years ago

  • Assignee set to Hugo Ferreira

#7 Updated by Hugo Ferreira over 6 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"

#8 Updated by Hugo Ferreira over 6 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!)

#9 Updated by Etienne Massip over 6 years ago

  • Category set to PDF export

#10 Updated by Toshi MARUYAMA over 6 years ago

  • % Done changed from 100 to 50

#11 Updated by Toshi MARUYAMA over 6 years ago

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

#12 Updated by Toshi MARUYAMA over 6 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.

#13 Updated by Jun NAITOH over 6 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.

#14 Updated by Toshi MARUYAMA over 6 years ago

  • Status changed from Reopened to Closed

Note 13 patch is committed in r5605, thanks.

#15 Updated by Hugo Ferreira over 6 years ago

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

Also available in: Atom PDF