Feature #3463
closedExport all wiki pages to PDF
0%
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
Related issues
Updated by Patrice Bouillet over 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.
Updated by Henrik Jondell over 15 years ago
+1
this would be a very nice feature, making wiki's even more useful.
Updated by Guillermo Gómez over 15 years ago
+1
i really would like to have this one...
Updated by Benjamin Baroukh over 15 years ago
+1. Nice because we are still working with people who likes paper...
Updated by rupert thurner over 15 years ago
how can one vote? by watching it? or by doing +1?
Updated by Michael Aye over 15 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.
Updated by Aleksey Timohin about 15 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.
Updated by Enderson Maia about 15 years ago
Maybe this could help - http://github.com/mbleigh/princely
Updated by Tiago Alves about 15 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.
Updated by Kamil . about 15 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
Updated by Eric Voisard over 14 years ago
+1
Wouldn't this feature be a good candidate for release 1.0?...
Updated by Pieter Smith over 14 years ago
+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!
Updated by James Rowe over 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)
Updated by Carmen De Vito over 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.
Updated by Moritz Voss over 14 years ago
+1 and made a small donation.
Document export to PDF and preferrably HTML (for post-processing) would be really good to have.
Updated by Arnaud Martel about 14 years ago
- File redmine_pdf_wiki.tgz redmine_pdf_wiki.tgz added
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
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
Updated by Colan Schwartz about 14 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.
Updated by Arnaud Martel about 14 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...)
Updated by Jose Garcia about 14 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
Updated by Arnaud Martel about 14 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.
Updated by Hugues Romain about 14 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>
Updated by Eduardo Bento Rocha almost 14 years ago
I have same problem, but downgrading the wkhtmltopdf to 0.99 its works fine.
Updated by Christian Mayr almost 14 years ago
Christian Raschko made the DocPu-Plugin, which makes this IMHO obsolete:
http://www.redmine.org/plugins/redmine_doc_pu
Updated by Joshua Villagomez almost 14 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.
Updated by Terence Mill almost 14 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?
Updated by Terence Mill almost 14 years ago
Can u provide this nice piece of plugin on your github account?
Tx for ur contribution!
Updated by Carl D'Halluin over 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'
Updated by Carl D'Halluin over 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'
Updated by Arnaud Martel over 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...
Updated by Tino Naphtali over 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.
Updated by Tino Naphtali over 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.
[...]
Updated by Pieter Smith about 13 years ago
I think that most use-cases can already be satisfied with the DocPu plugin
Updated by Terence Mill about 13 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.
Updated by Pieter Smith about 13 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?
Updated by Terence Mill about 13 years ago
The way is leardy gone in https://github.com/amartel/redmine_pdf_wiki
Updated by Matias Basso about 13 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
Updated by Jean-Philippe Lang almost 13 years ago
- File wiki_pdf_export.png 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:
Updated by Jean-Philippe Lang almost 13 years ago
- Subject changed from Export (all) Wiki-Pages to PDF/DOC to Export all wiki pages to PDF
Updated by Franck Samson almost 13 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?
Updated by Etienne Massip almost 13 years ago
The target version is set to 1.4.0.
Updated by Franck Samson almost 13 years ago
Great, I have to wait just few days. :)
Updated by Franck Samson over 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?
Updated by Jean-Philippe Lang over 12 years ago
Make sure you're using the export link on the wiki page index, not on a wiki page.
Updated by Franck Samson over 12 years ago
That's right, thanks.
Is it possible to have in futur version all wiki links clickable in the PDF file ?