fa_princely 1.2.6 → 1.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/princely/pdf_helper.rb +8 -2
- data/princely.gemspec +1 -1
- metadata +3 -3
data/lib/princely/pdf_helper.rb
CHANGED
@@ -36,7 +36,7 @@ module PdfHelper
|
|
36
36
|
|
37
37
|
# Make all paths relative, on disk paths...
|
38
38
|
html_string.gsub!(".com:/",".com/") # strip out bad attachment_fu URLs
|
39
|
-
html_string.gsub!( /src=["']+([^:]+?)["']/i ) { |m| "src=\"#{RAILS_ROOT}/public/" + $1 + '"' } # re-route absolute paths
|
39
|
+
# html_string.gsub!( /src=["']+([^:]+?)["']/i ) { |m| "src=\"#{RAILS_ROOT}/public/" + $1 + '"' } # re-route absolute paths
|
40
40
|
|
41
41
|
# Remove asset ids on images with a regex
|
42
42
|
html_string.gsub!( /src=["'](\S+\?\d*)["']/i ) { |m| 'src="' + $1.split('?').first + '"' }
|
@@ -45,7 +45,13 @@ module PdfHelper
|
|
45
45
|
if filename = options[:filename] || options[:file]
|
46
46
|
prince.pdf_from_string_to_file(html_string, filename)
|
47
47
|
else
|
48
|
-
|
48
|
+
modded={}
|
49
|
+
modded=prince.pdf_from_string(html_string).gsub("Prince 7.1 \\(www.princexml.com\\)","faPDF 0.1 \\(www.homo.at\\)").lines.to_a
|
50
|
+
cut_start=modded.index("/T (www.princexml.com)\n")
|
51
|
+
cut_start-=9
|
52
|
+
16.times { modded.delete_at(cut_start) }
|
53
|
+
modded.join
|
54
|
+
# prince.pdf_from_string(html_string)
|
49
55
|
end
|
50
56
|
end
|
51
57
|
|
data/princely.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fa_princely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 7
|
10
|
+
version: 1.2.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Bleigh
|