Permalink
Browse files

Initial commit. The plan is to add back the functionality that was or…

…iginally in my Merb in Action builder in a more OSS-friendly reusable way.
  • Loading branch information...
0 parents commit 24685fa30aa502c1a29b56ca1b5ecbd43bdc992a Yehuda Katz committed Dec 9, 2009
@@ -0,0 +1,4 @@
+vendor/gems/*
+!vendor/gems/cache/
+bin
+.DS_Store
@@ -0,0 +1,2 @@
+gem "maruku"
+disable_system_gems
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,18 @@
+require "java"
+require "stringio"
+
+require "flying_saucer/jars/itext"
+require "flying_saucer/jars/core-renderer"
+import org.xhtmlrenderer.pdf.ITextRenderer
+
+java.lang.System.set_property("java.awt.headless", "true")
+
+class ITextRenderer
+ def make_pdf(input)
+ io = StringIO.new
+ set_document_from_string input
+ layout
+ create_pdf(io.to_outputstream)
+ io.string
+ end
+end
@@ -0,0 +1,12 @@
+require "flying_saucer/rufo"
+require "maruku"
+
+class Muse
+ def initialize(string, css = "")
+ @string, @css = Maruku.new(string).to_html, css
+ end
+
+ def to_pdf
+ ITextRenderer.new.make_pdf(@string)
+ end
+end
Binary file not shown.
Binary file not shown.

0 comments on commit 24685fa

Please sign in to comment.