Feature #3463

Export all wiki pages to PDF

Added by Michael Diederich about 8 years ago. Updated about 5 years ago.

Status:ClosedStart date:2009-06-08
Priority:LowDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:Wiki
Target version:1.4.0
Resolution:Fixed

Description

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

redmine_pdf_wiki.tgz (3.82 KB) Arnaud Martel, 2010-10-04 17:33

wiki_pdf_export.png (26.7 KB) Jean-Philippe Lang, 2012-01-30 19:45


Related issues

Related to Redmine - Feature #401: Add pdf export for WIKI page Closed
Duplicated by Redmine - Feature #5000: Export all wiki pages Closed 2010-03-05

Associated revisions

Revision 8734
Added by Jean-Philippe Lang over 5 years ago

Adds export of all wiki pages to a PDF file (#3463).

History

#1 Updated by Patrice Bouillet about 8 years ago

+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.

#2 Updated by Henrik Jondell about 8 years ago

+1

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

#3 Updated by Konstantin Ershov about 8 years ago

+1

It's very useful feature.

#4 Updated by Guillermo Gómez about 8 years ago

+1

i really would like to have this one...

#5 Updated by Andrey Kostrov almost 8 years ago

+1

Very useful for me.

#6 Updated by Benjamin Baroukh almost 8 years ago

+1. Nice because we are still working with people who likes paper...

#7 Updated by rupert thurner almost 8 years ago

how can one vote? by watching it? or by doing +1?

#8 Updated by Michael Aye almost 8 years ago

+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.

#9 Updated by Brian FInch almost 8 years ago

+1 Extremely useful feature

#10 Updated by Aleksey Timohin almost 8 years ago

+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.

#11 Updated by Philippe Lambert over 7 years ago

+1

#12 Updated by Enderson Maia over 7 years ago

Maybe this could help - http://github.com/mbleigh/princely

#13 Updated by Tiago Alves over 7 years ago

+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.

#14 Updated by Kamil . over 7 years ago

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

#15 Updated by Billy T over 7 years ago

+1

Maybe rtf is easier than doc.

#16 Updated by Eric Voisard over 7 years ago

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

#17 Updated by Pieter Smith over 7 years ago

+1

Our redmine server is self-hosting:
  1. The server installation itself is a working copy of the self-hosted GIT repository.
  2. All documentation and knowledge of the server goes into the server project's wiki.
  3. All server issues goes into the server project's issue list.
  4. 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!

#18 Updated by Yuki Kita over 7 years ago

+1

#19 Updated by minkbear minkbear over 7 years ago

+1

#20 Updated by Yaroslav Matsera about 7 years ago

+1

#21 Updated by James Rowe about 7 years ago

+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)

#22 Updated by Carmen De Vito about 7 years ago

+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.

#23 Updated by Kirill Ponomarev about 7 years ago

+1

#24 Updated by Ben Coleman about 7 years ago

+1

#26 Updated by Jared Hellman about 7 years ago

+1

#27 Updated by Michael König about 7 years ago

+1

#28 Updated by Paul H about 7 years ago

+1

#29 Updated by Moritz Voss almost 7 years ago

+1 and made a small donation.

Document export to PDF and preferrably HTML (for post-processing) would be really good to have.

#30 Updated by Terence Mill almost 7 years ago

+1

#31 Updated by Mark Bednarski almost 7 years ago

+1

#32 Updated by Marton Danoczy almost 7 years ago

+1

#33 Updated by Jan Wedekind almost 7 years ago

+1

#34 Updated by Anonymous almost 7 years ago

+1

#35 Updated by Arnaud Martel almost 7 years ago

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...)

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)

Setup

1. Install wkhtml2pdf

via pdfkit:
  • gem install pdfkit
  • pdfkit --install-wkhtmltopdf
Directly from wkhtml2pdf website

2. Install plugin

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

No DB migration is required...

3. Patch REDMINE to add link 'Export PDF'

Edit <redmine directory>/app/view/wiki/show.rhtml:

    <%= f.link_to 'HTML', :url => {:page => @page.title, :version => @content.version} %>
    <%= f.link_to 'TXT', :url => {:page => @page.title, :version => @content.version} %>

should be
    <%= 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}) %>

Then edit <redmine directory>/app/view/wiki/special_page_index.rhtml:

    <%= 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) %>

should be
    <%= 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) %>

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...)

5. Restart your web server

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)

History

0.0.1: Initial release

#36 Updated by Colan Schwartz almost 7 years ago

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.

#37 Updated by Arnaud Martel almost 7 years ago

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...)

#38 Updated by Jose Garcia almost 7 years ago

Arnaud Martel wrote:

I have an alpha version for this feature.

Thanks for the plugin. I tried with latest version of redmine but get

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)

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

#39 Updated by Arnaud Martel almost 7 years ago

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.

#40 Updated by Hugues Romain over 6 years ago

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>

#41 Updated by Eduardo Bento Rocha over 6 years ago

I have same problem, but downgrading the wkhtmltopdf to 0.99 its works fine.

#42 Updated by Christian Mayr over 6 years ago

Christian Raschko made the DocPu-Plugin, which makes this IMHO obsolete:
http://www.redmine.org/plugins/redmine_doc_pu

#43 Updated by Joshua Villagomez over 6 years ago

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.

#44 Updated by Terence Mill over 6 years ago

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 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?

#45 Updated by Terence Mill over 6 years ago

@Arnaud

Can u provide this nice piece of plugin on your github account?
Tx for ur contribution!

#46 Updated by Carl D'Halluin over 6 years ago

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'

#47 Updated by Carl D'Halluin over 6 years ago

readable diff

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'

#48 Updated by Arnaud Martel over 6 years ago

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...

#49 Updated by Tino Naphtali over 6 years ago

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:

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

The correct URL of the Wiki page is:

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

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.

#50 Updated by Tino Naphtali over 6 years ago

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.
[...]

#51 Updated by Josh Davidson almost 6 years ago

+1

#52 Updated by Lucy Yevseyeva almost 6 years ago

+1 00500

#53 Updated by Pieter Smith almost 6 years ago

I think that most use-cases can already be satisfied with the DocPu plugin

#54 Updated by Terence Mill almost 6 years ago

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.

#55 Updated by Pieter Smith almost 6 years ago

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?

#57 Updated by Matias Basso over 5 years ago

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

#58 Updated by Cassiano Monteiro over 5 years ago

+1

#59 Updated by Jean-Philippe Lang over 5 years ago

  • File wiki_pdf_export.png added
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 1.4.0
  • Resolution set to Fixed

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:

#60 Updated by Jean-Philippe Lang over 5 years ago

  • Subject changed from Export (all) Wiki-Pages to PDF/DOC to Export all wiki pages to PDF

#61 Updated by Terence Mill over 5 years ago

Great!

#62 Updated by Franck Samson over 5 years ago

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?

#63 Updated by Etienne Massip over 5 years ago

The target version is set to 1.4.0.

#64 Updated by Franck Samson over 5 years ago

Great, I have to wait just few days. :)

#65 Updated by Franck Samson about 5 years ago

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?

#66 Updated by Jean-Philippe Lang about 5 years ago

Make sure you're using the export link on the wiki page index, not on a wiki page.

#67 Updated by Franck Samson about 5 years ago

That's right, thanks.

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

Also available in: Atom PDF