プロジェクト

全般

プロフィール

Vote #81576

完了

PDF rendering improvements when exporting an issue or a list of issues

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
PDF export_39
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
39
version_id:
155
issue_org_id:
35683
author_id:
40856
assigned_to_id:
107353
comments:
14
status_id:
5
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Two PDF generation improvements:

  1. Currently, when rendering an issue PDF, macros are only expanded in the description, but not when rendering custom fields with fulltext formatting enabled. The patch changes the behaviour so that formatted full-width custom fields are rendered in the same way the description is rendered, fully interpreting macros. The behaviour for rendering normal-width custom fields is unchanged, probably it is better to leave it as is due to space constraints.
  2. Thumbnail macro output was not rendered properly (in the issue description and elsewhere) because the thumbnail image file could not be retrieved - the second patch extends @get_image_filename@ to check for thumbnail URLs and retrieve the proper file path in that case.

Both patches were initially developed for "Planio":https://plan.io/redmine-hosting .


journals

Nice improvements.
--------------------------------------------------------------------------------
Setting the target version to 5.0.0.
--------------------------------------------------------------------------------
One more patch (based on the first two) which introduces the full rendering of last notes, description and formatted full width custom fields for the tabular issues list PDF export.
--------------------------------------------------------------------------------
Jens Krämer wrote:
> One more patch (based on the first two) [...]

Jens, I have only read the patch, but it seems to contain an error/typo. Shouldn't:

<pre><code class="diff">
diff --git a/lib/redmine/export/pdf/issues_pdf_helper.rb b/lib/redmine/export/pdf/issues_pdf_helper.rb
index 98c7347ab..f55c80f5c 100644
--- a/lib/redmine/export/pdf/issues_pdf_helper.rb
+++ b/lib/redmine/export/pdf/issues_pdf_helper.rb
@@ -232,14 +225,7 @@ module Redmine
if journal.notes?
pdf.ln unless journal.details.empty?
pdf.SetFontStyle('', 8)
- text =
- textilizable(
- journal, :notes,
- :only_path => false,
- :edit_section_links => false,
- :headings => false,
- :inline_attachments => false
- )
+ text = pdf_format_text(issue, :description)
pdf.RDMwriteFormattedCell(190, 5, '', '', text, issue.attachments, "")
end
pdf.ln
</code></pre>

actually be:

<pre><code class="diff">
diff --git a/lib/redmine/export/pdf/issues_pdf_helper.rb b/lib/redmine/export/pdf/issues_pdf_helper.rb
index 98c7347ab..f55c80f5c 100644
--- a/lib/redmine/export/pdf/issues_pdf_helper.rb
+++ b/lib/redmine/export/pdf/issues_pdf_helper.rb
@@ -232,14 +225,7 @@ module Redmine
if journal.notes?
pdf.ln unless journal.details.empty?
pdf.SetFontStyle('', 8)
- text =
- textilizable(
- journal, :notes,
- :only_path => false,
- :edit_section_links => false,
- :headings => false,
- :inline_attachments => false
- )
+ text = pdf_format_text(journal, :notes)
pdf.RDMwriteFormattedCell(190, 5, '', '', text, issue.attachments, "")
end
pdf.ln
</code></pre>

If so, then I think @pdf_format_text@ would be better defined as something along the lines of:

<pre><code class="diff">
diff --git a/lib/redmine/export/pdf/issues_pdf_helper.rb b/lib/redmine/export/pdf/issues_pdf_helper.rb
index 98c7347ab..f55c80f5c 100644
--- a/lib/redmine/export/pdf/issues_pdf_helper.rb
+++ b/lib/redmine/export/pdf/issues_pdf_helper.rb
@@ -375,6 +368,15 @@ module Redmine
pdf.output
end

+ def pdf_format_text(object, attribute)
+ textilizable(object, attribute,
+ :only_path => false,
+ :edit_section_links => false,
+ :headings => false,
+ :inline_attachments => false
+ )
+ end
+
def is_cjk?
case current_language.to_s.downcase
when 'ja', 'zh-tw', 'zh', 'ko'
</code></pre>

--------------------------------------------------------------------------------
you're completely right, I attached an updated patch.
--------------------------------------------------------------------------------
Here it is, for real.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Jens, thanks for the update. I've removed the faulty files to keep it clear.

@committers: the correct order of the patchset is:
# attachment:0001-render-formatted-full-width-custom-fields-in-the-sam.patch
# attachment:0001-retrieve-filenames-of-thumbnails-when-rendering-a-PD.patch
# attachment:0001-interpret-thumbnail-macro-in-description-notes-and-f.patch
--------------------------------------------------------------------------------
All three patches committed, thanks for the nice improvements.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,34709,No Images in PDF export of issue list (with option show description)

Admin Redmine さんが3年以上前に更新

  • カテゴリPDF export_39 にセット
  • 対象バージョン5.0.0_155 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0