diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-05-11 16:07:17 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-05-11 16:07:17 +0100 |
commit | bd629d2b4e886bdad3d7959d9a2b529f0eb8d2b5 (patch) | |
tree | 12b46467781b83a9acb02db468eec69db3662ac6 /lib | |
parent | 5e2f00176f73736929fde4e1ab09f594ba5252cf (diff) |
Use a relative path in call to pdftohtml.
pdftohtml will use the file path as the basis for generating the
image links in the generated HTML, so we want them to be relative,
not absolute. Ruby 1.9 tempfile.path will generate an absolute
path when given the current directory as the tmpdir, whilst 2.0
and 1.8 will use a relative one.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/attachment_to_html/adapters/pdf.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/attachment_to_html/adapters/pdf.rb b/lib/attachment_to_html/adapters/pdf.rb index 3c18e9d4a..a010b0342 100644 --- a/lib/attachment_to_html/adapters/pdf.rb +++ b/lib/attachment_to_html/adapters/pdf.rb @@ -71,10 +71,10 @@ module AttachmentToHTML @converted ||= Dir.chdir(tmpdir) do tempfile = create_tempfile(text) - html = AlaveteliExternalCommand.run("pdftohtml", "-nodrm", "-zoom", "1.0", "-stdout", "-enc", "UTF-8", - "-noframes", tempfile.path, :timeout => 30, :binary_output => false + "-noframes", "./#{File.basename(tempfile.path)}", + :timeout => 30, :binary_output => false ) cleanup_tempfile(tempfile) |