プロジェクト

全般

プロフィール

Vote #65333

完了

Export all wiki pages to PDF

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

ステータス:
Closed
優先度:
低め
担当者:
-
カテゴリ:
Wiki_1
対象バージョン:
開始日:
2009/06/08
期日:
進捗率:

0%

予定工数:
category_id:
1
version_id:
40
issue_org_id:
3463
author_id:
5900
assigned_to_id:
1
comments:
67
status_id:
5
tracker_id:
2
plus1:
34
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Hi,

I would like to export Wiki-Pages to a PDF or DOC-Format. This request is a little bit similar to #3228

I also request, to export a whole wiki into a single page. It could be a multipage-documentation as a handout or something else.

Thanks,

Michael


journals

+1

This is one of the features I miss the most. A good PDF export of selected Wiki Pages would really be very very useful so that a separate documentation does not have to be created somewhere else.
--------------------------------------------------------------------------------
+1

this would be a very nice feature, making wiki's even more useful.
--------------------------------------------------------------------------------
+1

It's very useful feature.
--------------------------------------------------------------------------------
+1

i really would like to have this one...
--------------------------------------------------------------------------------
+1

Very useful for me.
--------------------------------------------------------------------------------
+1. Nice because we are still working with people who likes paper...
--------------------------------------------------------------------------------
how can one vote? by watching it? or by doing +1?
--------------------------------------------------------------------------------
+1
I am doing telecon and meeting minutes with the wiki. But sometimes minutes need to be distributed to circles outside our workgroup. Exactly then a pdf export would be great. To just have really 'paper' versions only when it's absolutely necessary.
--------------------------------------------------------------------------------
+1 Extremely useful feature
--------------------------------------------------------------------------------
+1
it would be very nice to allow export wiki in single/multiple document(s) *starting from current page with all children included*
so, it allows to export whole wiki, and also allows to handle single page export.

multiple documents f.e. can be provided in archive.
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
Maybe this could help - http://github.com/mbleigh/princely
--------------------------------------------------------------------------------
+1
As stated multiple times above, it would also be nice to have the images inline and to be able to select which wiki pages to include in the PDF generation. And while we're at it, it would also be nice to be able to store "profiles" for exports. This way we could define that for the profile "User Documentation" we would always export the wiki pages UserDoc1 and UserDoc2 but not DevDoc1 for instance.
--------------------------------------------------------------------------------
Tiago Alves wrote:
> +1
> As stated multiple times above, it would also be nice to have the images inline and to be able to select which wiki pages to include in the PDF generation. And while we're at it, it would also be nice to be able to store "profiles" for exports. This way we could define that for the profile "User Documentation" we would always export the wiki pages UserDoc1 and UserDoc2 but not DevDoc1 for instance.

+1
Nice idea
--------------------------------------------------------------------------------
+1

Maybe rtf is easier than doc.

--------------------------------------------------------------------------------
+1
Wouldn't this feature be a good candidate for release 1.0?...
--------------------------------------------------------------------------------
+1

Our redmine server is self-hosting:
# The server installation itself is a working copy of the self-hosted GIT repository.
# All documentation and knowledge of the server goes into the server project's wiki.
# All server issues goes into the server project's issue list.
# Etc...

Replicating or recovering the server simply is a question of cloning the GIT repository. Until the server is back up and running however, the wiki with all the knowledge is unavailable. While recovering the server an off-line viewable PDF of the wiki pages would be DAMN handy!
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1 We use the wiki for documentation, but we have a need to 'export' a wiki to pdf to provide instructions to users who can't access the system (offsite or offline)
--------------------------------------------------------------------------------
+1 on this. I use this for user docs, and would be really helpful if I can sent them out as a PDF as well.
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1 and made a small donation.

Document export to PDF and preferrably HTML (for post-processing) would be really good to have.
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
I have an alpha version for this feature. It's more a proof of concept than a production's plugin but it may give ideas to another developer...
You are welcome if you want to test this plugin/patch but be aware that you need to have knowledges with *LINUX*, *Apache+Passenger*, *WKHTMLTOPDF* and *RUBY* (I didn't make a lot of tests so you may have to adapt the source code to you own needs...)

h1. Introduction

This plugin allows to export WIKI page(s) to .PDF file, using WKHTML2PDF, with images and TOC (need to remove --no-outline from command line)

h1. Setup

h3. 1. Install wkhtml2pdf

via pdfkit:
* gem install pdfkit
* pdfkit --install-wkhtmltopdf

Directly from wkhtml2pdf website
* http://code.google.com/p/wkhtmltopdf/downloads/list

h3. 2. Install plugin

Install redmine_pdf_wiki with:
* cd <redmine directory>/vendor/plugins
* tar xvzf redmine_pdf_wiki.tgz

No DB migration is required...

h3. 3. Patch REDMINE to add link 'Export PDF'

Edit <redmine directory>/app/view/wiki/show.rhtml:
<pre>
<%= f.link_to 'HTML', :url => {:page => @page.title, :version => @content.version} %>
<%= f.link_to 'TXT', :url => {:page => @page.title, :version => @content.version} %>
</pre>
should be
<pre>
<%= f.link_to 'HTML', :url => {:page => @page.title, :version => @content.version} %>
<%= f.link_to 'TXT', :url => {:page => @page.title, :version => @content.version} %>
<%= f.link_to('PDF', :url => {:controller => 'wikitopdf', :action => 'export', :page => @page.title, :id => @project}) %>
</pre>

Then edit <redmine directory>/app/view/wiki/special_page_index.rhtml:
<pre>
<%= f.link_to 'Atom', :url => {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
<%= f.link_to('HTML', :url => {:action => 'special', :page => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
</pre>
should be
<pre>
<%= f.link_to 'Atom', :url => {:controller => 'projects', :action => 'activity', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
<%= f.link_to('HTML', :url => {:action => 'special', :page => 'export'}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
<%= f.link_to('PDF', :url => {:controller => 'wikitopdf', :action => 'export', :id => @project}) if User.current.allowed_to?(:export_wiki_pages, @project) %>
</pre>

h3. 4 Configure Passenger

If you are using Apache + Passenger, you have to change passenger settings to add:
* PassengerUseGlobalQueue on

If you are using another web server configuration, you may have to configure something to allow a web request to recursively call your web server (if you have a blank page that takes an infinite time to be loaded...)

h3. 5. Restart your web server

h3. 6. Configure REDMINE with your web browser

If everything is OK, you should see WikiToPdf plugin plugin in the plugin list (Administration -> Plugins)
Then, you have to configure the plugin:
* command line to run wkhtmltopdf (default value should be OK in most cases)
* temporary directory where .pdf files will be generated. You should clean it periodicaly (using crontab, for example)

h1. History

0.0.1: Initial release
--------------------------------------------------------------------------------
Arnaud Martel wrote:
> I have an alpha version for this feature.

Does it take advantage of the Redmine code that already does this for issues?

I suggested that we do this over at #401. Perhaps this issue should be blocked by that one, until it is complete.
--------------------------------------------------------------------------------
No (see #401 for more details). Wiki pages may contain complex HTML code and/or specific macros (that's why export to pdf is so difficult...)
--------------------------------------------------------------------------------
Arnaud Martel wrote:
> I have an alpha version for this feature.

Thanks for the plugin. I tried with latest version of redmine but get
<pre>
ActionController::MissingFile (Cannot read file /Applications/redmine-1.0.2-0/apps/redmine/tmp/051nhl5kr.pdf):
vendor/plugins/redmine_pdf_wiki/app/controllers/wikitopdf_controller.rb:61:in `to_pdf'
vendor/plugins/redmine_pdf_wiki/app/controllers/wikitopdf_controller.rb:10:in `export'

Rendering /Applications/redmine-1.0.2-0/apps/redmine/public/500.html (500 Internal Server Error)
</pre>

I logged the wkhtmltopdf command launched and executing it manually from a terminal session the pdf is created correctly.

Is there any way to get more verbose logging to identify what's the problem? (sorry, my knoweledge of ruby/rails is quite limited)

Thanks in advance
--------------------------------------------------------------------------------
Jose,

Your wkhtmltopdf command fails (at least when run from redmine).
Check if your web server has read/write access on your temp directory (/Applications/redmine-1.0.2-0/apps/redmine/tmp) and/or try to run the command from a terminal AS your web server.

--------------------------------------------------------------------------------
If your installation uses the _redmine_wiki_permissions_ plugin, in the step 3 of installation you must edit @/vendor/plugins/redmine_wiki_permissions/app/views/wiki/show.rhtml.erb@ too.

Add the line
> <span><%= link_to('PDF', {:controller => 'wikitopdf', :action => 'export', :page => @page.title, :id => @project}) %></span>

after
> <span><%= link_to 'HTML', {:page => @page.title, :export => 'html', :version => @content.version}, :class => 'html' %></span>
> <span><%= link_to 'TXT', {:page => @page.title, :export => 'txt', :version => @content.version}, :class => 'text' %></span>


--------------------------------------------------------------------------------
I have same problem, but downgrading the wkhtmltopdf to 0.99 its works fine.
--------------------------------------------------------------------------------
Christian Raschko made the DocPu-Plugin, which makes this IMHO obsolete:
http://www.redmine.org/plugins/redmine_doc_pu
--------------------------------------------------------------------------------
Are we should DocPu obseletes this feature request? Doesn't it require an admin to export wiki to pdfs? I think ideally any user should be able to click on any wiki and export to PDF. I wonder if Doc-Pu is filling all those needs.
--------------------------------------------------------------------------------
Yes, your absolutly right. DocPu can't do that and is far to complicated and error prone for an plain "click pdf link" to export the site wiki site you see to pdf.
The "post or Arnaud Martel looks very promissing":/issues/3463#note-35 the only thing what is ugly that he doesn't use the hooks to add in the new pdf link in the wiki site. Isn't there a hook, i know that at least for issue list exports there is one, but for wiki site display - dunno ??

Someone knows?
--------------------------------------------------------------------------------
@Arnaud

Can u provide this nice piece of plugin on your "github account":https://github.com/amartel?
Tx for ur contribution!

--------------------------------------------------------------------------------
Hi

I had some issues with this plugin. Patch is below.
Also i made sure that the exported pdf had a useful filename (project name, page name in the pdf filename)

Where can I contribute this code such that every redmine user can now export wiki pages to pdf.
This is just great. This was my last reason to use Jira over Redmine.

Apply the diff to:
redmine_pdf_wiki/app/controllers/wikitopdf_controller.rb

55c55,56
< args << '"' + url_for(:controller => 'wiki', :action => 'index', :id => @page.project, :page => @page.title) + '"'
---
> #args << '"' + url_for(:controller => 'wiki', :action => 'index', :id => @page.project, :page => @page.title) + '"'
> args << '"' + url_for(:controller => 'wiki', :action => 'show', :project_id => @page.project, :id => @page.title) + '"'
61,63c62,64
< send_file pdfname, :filename => "export.pdf",
< :type => 'application/pdf',
< :disposition => 'inline'
---
> export_file_name = @page.project.name + "___" + @page.title + ".pdf"
> send_file pdfname, :filename => export_file_name,
> :type => 'application/pdf'

--------------------------------------------------------------------------------
readable diff

<pre>
55c55,56
< args << '"' + url_for(:controller => 'wiki', :action => 'index', :id => @page.project, :page => @page.title) + '"'
---
> #args << '"' + url_for(:controller => 'wiki', :action => 'index', :id => @page.project, :page => @page.title) + '"'
> args << '"' + url_for(:controller => 'wiki', :action => 'show', :project_id => @page.project, :id => @page.title) + '"'
61,63c62,64
< send_file pdfname, :filename => "export.pdf",
< :type => 'application/pdf',
< :disposition => 'inline'
---
> export_file_name = @page.project.name + "___" + @page.title + ".pdf"
> send_file pdfname, :filename => export_file_name,
> :type => 'application/pdf'
</pre>
--------------------------------------------------------------------------------
Sorry for the delay,

@Terence,
I just created another repo on github to host my plugin: https://github.com/amartel/redmine_pdf_wiki

@Carl,
I have integrated the support for redmine 1.1.x (changing parameters for the wiki controller) but I didn't the generated .pdf filename (@page.project.name and @page.title may contain bad chars for a filename).

Feel free to contribute...
--------------------------------------------------------------------------------
First of all, thank you for this plugin.

For information: The wkhtmltopdf package of Debian squeeze is not compiled against the correct QT libraries, so I have to use the static build.

Unfortunately the plugin only generates a PDF with a 404 error page. The reason is probably due to a wrong URL of the wiki page.

Passed to wkhtmltopdf is the URL:

<pre>https://<server>/wiki/show/<wiki_page>?project_id=<projekt></pre>

The correct URL of the Wiki page is:

<pre>https://<server>/projects/<projekt>/wiki/<wiki_page></pre>

I'm not a Ruby programmer and therefore can not adjust the plugin myself. I think the file @app/controllers/wikitopdf_controller.rb@ has to be modified (probably at line 24 and/or 55).

Thanks in advance.
--------------------------------------------------------------------------------
Excuse me. I had not noticed that the patch (changing parameters for the wiki controller) is already included in the GIT sources. I use the version 1.0.1. So I had only to undo the changes of the patch by Carl.

Tino Naphtali wrote:
> [...]
> Unfortunately the plugin only generates a PDF with a 404 error page. The reason is probably due to a wrong URL of the wiki page.
> [...]
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
+1 -00500-
--------------------------------------------------------------------------------
I think that most use-cases can already be satisfied with the "DocPu plugin":http://www.redmine.org/plugins/redmine_doc_pu
--------------------------------------------------------------------------------
For us docu in to much error prone. We can't get i run for a bigger wiki site (40 sites), there to many probelms with specific macros, locales and latex template details.
Renedering the wiki site as "frameless" html print preview and then converting html to pdf, would be less error prone.
Or ar least docu should come more "configured" and tested.
--------------------------------------------------------------------------------
A'h lovely... Another parallel effort then? This can reasonably easily be made as a plugin. Question is: Should the effort be piled onto fixing / improving DocPu, or by making a new plugin.

We can also make good use of such simplification. Anybody interested in helping to fund the effort?
--------------------------------------------------------------------------------
The way is leardy gone in https://github.com/amartel/redmine_pdf_wiki
--------------------------------------------------------------------------------
Hi everyone:

I'm using Redmine v-1.2.1 and wkhtmltopf v-0.11.0, and i have an issue. When I open the pdf, the title's letters are overlapping. Everything else is ok.
I hope someone can help me, if is needed more info don't doubt in ask .Thx
--------------------------------------------------------------------------------
+1
--------------------------------------------------------------------------------
Feature added in r8734. You can now export all the wiki pages to a single PDF.
The export link is available on the wiki pages index. The PDF contains hierarchical bookmarks for easy navigation:

!wiki_pdf_export.png!
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Great!
--------------------------------------------------------------------------------
Great!

I use the redmine 1.3.2.stable.9237 and I have the pdf export on the wiki pages but I don't have export all wiki pages. How to configure this?

--------------------------------------------------------------------------------
The target version is set to version:1.4.0.
--------------------------------------------------------------------------------
Great, I have to wait just few days. :)

--------------------------------------------------------------------------------
I have updated my redmine to 1.4.3 but the pdf export give me just the first page... Is there anything to Install/configure to have all wiki pages into the pdf file?

--------------------------------------------------------------------------------
Make sure you're using the export link on the wiki page *index*, not on a wiki page.
--------------------------------------------------------------------------------
That's right, thanks.

Is it possible to have in futur version all wiki links clickable in the PDF file ?

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


related_issues

relates,Closed,401,Add pdf export for WIKI page
duplicates,Closed,5000,Export all wiki pages

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

  • カテゴリWiki_1 にセット
  • 対象バージョン1.4.0_40 にセット

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

いいね!0
いいね!0