From 709c59547ef1c914db62669d31844c41236d276c Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Thu, 12 Jul 2012 16:46:04 +0400 Subject: [PATCH] Allow PDF downloading. --- README | 2 +- app/controllers/redmine_embedded_controller.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README b/README index 536e64e..ac03e6b 100644 --- a/README +++ b/README @@ -2,6 +2,6 @@ Fork of Embedded plugin (http://www.redmine.org/wiki/redmine/PluginEmbedded). Correct style and search for all Doxygen versions. Setup: Index files: index.html -Valid extensions: html png gif js css +Valid extensions: html png gif js css pdf Default template: doxygen. Menu caption: Doxygen diff --git a/app/controllers/redmine_embedded_controller.rb b/app/controllers/redmine_embedded_controller.rb index 737c442..149b131 100644 --- a/app/controllers/redmine_embedded_controller.rb +++ b/app/controllers/redmine_embedded_controller.rb @@ -56,6 +56,9 @@ class RedmineEmbeddedController < ApplicationController elsif path.match('\.js$') raw=File.read(path) send_data raw, :disposition => 'inline', :type => "text/javascript", :streaming => "true" + elsif path.match('\.pdf$') + raw=File.read(path) + send_data raw, :disposition => 'inline', :type => "application/pdf", :streaming => "true" else embed_file path end