Project

General

Profile

Actions

Feature #3463

closed

Export all wiki pages to PDF

Added by Michael Diederich almost 15 years ago. Updated almost 12 years ago.

Status:
Closed
Priority:
Low
Category:
Wiki
Target version:
Start date:
2009-06-08
Due date:
% Done:

0%

Estimated time:
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


Files

redmine_pdf_wiki.tgz (3.82 KB) redmine_pdf_wiki.tgz Arnaud Martel, 2010-10-04 17:33
wiki_pdf_export.png (26.7 KB) wiki_pdf_export.png Jean-Philippe Lang, 2012-01-30 19:45

Related issues

Related to Redmine - Feature #401: Add pdf export for WIKI pageClosedToshi MARUYAMA

Actions
Has duplicate Redmine - Feature #5000: Export all wiki pagesClosed2010-03-05

Actions
Actions #1

Updated by Patrice Bouillet almost 15 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.

Actions #2

Updated by Henrik Jondell almost 15 years ago

+1

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

Actions #3

Updated by Konstantin Ershov almost 15 years ago

+1

It's very useful feature.

Actions #4

Updated by Guillermo Gómez almost 15 years ago

+1

i really would like to have this one...

Actions #5

Updated by Andrey Kostrov over 14 years ago

+1

Very useful for me.

Actions #6

Updated by Benjamin Baroukh over 14 years ago

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

Actions #7

Updated by rupert thurner over 14 years ago

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

Actions #8

Updated by Michael Aye over 14 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.

Actions #9

Updated by Brian FInch over 14 years ago

+1 Extremely useful feature

Actions #10

Updated by Aleksey Timohin over 14 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.

Actions #11

Updated by Philippe Lambert over 14 years ago

+1

Actions #12

Updated by Enderson Maia over 14 years ago

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

Actions #13

Updated by Tiago Alves over 14 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.

Actions #14

Updated by Kamil . over 14 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

Actions #15

Updated by Billy T over 14 years ago

+1

Maybe rtf is easier than doc.

Actions #16

Updated by Eric Voisard about 14 years ago

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

Actions #17

Updated by Pieter Smith about 14 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!

Actions #18

Updated by Yuki Kita about 14 years ago

+1

Actions #19

Updated by minkbear minkbear about 14 years ago

+1

Actions #20

Updated by Yaroslav Matsera almost 14 years ago

+1

Actions #21

Updated by James Rowe almost 14 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)

Actions #22

Updated by Carmen De Vito almost 14 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.

Actions #23

Updated by Kirill Ponomarev almost 14 years ago

+1

Actions #24

Updated by Ben Coleman almost 14 years ago

+1

Actions #26

Updated by Jared Hellman almost 14 years ago

+1

Actions #27

Updated by Michael König almost 14 years ago

+1

Actions #28

Updated by Paul H almost 14 years ago

+1

Actions #29

Updated by Moritz Voss over 13 years ago

+1 and made a small donation.

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

Actions #30

Updated by Terence Mill over 13 years ago

+1

Actions #31

Updated by Mark Bednarski over 13 years ago

+1

Actions #32

Updated by Marton Danoczy over 13 years ago

+1

Actions #33

Updated by Anonymous over 13 years ago

+1

Actions #34

Updated by Anonymous over 13 years ago

+1

Actions #35

Updated by Arnaud Martel over 13 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

Actions #36

Updated by Colan Schwartz over 13 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.

Actions #37

Updated by Arnaud Martel over 13 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...)

Actions #38

Updated by Jose Garcia over 13 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

Actions #39

Updated by Arnaud Martel over 13 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.

Actions #40

Updated by Hugues Romain over 13 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 => Herve Harster}) %></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>

Actions #41

Updated by Eduardo Bento Rocha about 13 years ago

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

Actions #42

Updated by Christian Mayr about 13 years ago

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

Actions #43

Updated by Joshua Villagomez about 13 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.

Actions #44

Updated by Terence Mill about 13 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?

Actions #45

Updated by Terence Mill about 13 years ago

Arnaud Calmettes

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

Actions #46

Updated by Carl D'Halluin about 13 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'

Actions #47

Updated by Carl D'Halluin about 13 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'
Actions #48

Updated by Arnaud Martel about 13 years ago

Sorry for the delay,

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

Carl Malherbe,
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...

Actions #49

Updated by Tino Naphtali about 13 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.

Actions #50

Updated by Tino Naphtali about 13 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.
[...]

Actions #51

Updated by Josh Davidson over 12 years ago

+1

Actions #52

Updated by Lucy Yevseyeva over 12 years ago

+1 00500

Actions #53

Updated by Pieter Smith over 12 years ago

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

Actions #54

Updated by Terence Mill over 12 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.

Actions #55

Updated by Pieter Smith over 12 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?

Actions #56

Updated by Terence Mill over 12 years ago

Actions #57

Updated by Matias Basso over 12 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

Actions #58

Updated by Cassiano Monteiro over 12 years ago

+1

Actions #59

Updated by Jean-Philippe Lang about 12 years ago

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:

Actions #60

Updated by Jean-Philippe Lang about 12 years ago

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

Updated by Terence Mill about 12 years ago

Great!

Actions #62

Updated by Franck Samson about 12 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?

Actions #63

Updated by Etienne Massip about 12 years ago

The target version is set to 1.4.0.

Actions #64

Updated by Franck Samson about 12 years ago

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

Actions #65

Updated by Franck Samson almost 12 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?

Actions #66

Updated by Jean-Philippe Lang almost 12 years ago

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

Actions #67

Updated by Franck Samson almost 12 years ago

That's right, thanks.

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

Actions

Also available in: Atom PDF