From 44455a1fda37f3d29e55876e85f9f5c3e4be5f9e Mon Sep 17 00:00:00 2001 From: Matti Pastell Date: Thu, 26 Jul 2018 12:42:52 +0300 Subject: [PATCH] Fix generic pdf support --- src/display_methods.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/display_methods.jl b/src/display_methods.jl index 85405eb..debec51 100644 --- a/src/display_methods.jl +++ b/src/display_methods.jl @@ -62,7 +62,7 @@ function Base.display(report::Report, m::MIME"image/svg+xml", data) end function Base.display(report::Report, m::MIME"application/pdf", data) - figname = add_figure(report, m, data, ".pdf") + figname = add_figure(report, data, m, ".pdf") end #Text is written to stdout, called from "term" mode chunks @@ -112,7 +112,11 @@ function add_figure(report::Report, data, m, ext) full_name, rel_name = get_figname(report, chunk, ext = ext) open(full_name, "w") do io - show(io, m, data) + if ext == ".pdf" + write(io, repr(m, data)) + else + show(io, m, data) + end end push!(report.figures, rel_name)