Commit graph

82 commits

Author SHA1 Message Date
John MacFarlane
b50927527c PDF: Catch errors in conversion of images and display message.
See #1582.
2014-08-30 18:45:58 -07:00
Matthew Pickering
57bebe26df PDF Writer: Attempts to convert images to pdf renderable formats
Now depends on the JuicyPixels library.

Will attempt to convert an image (gif, tiff, bmp) to png when converting
to pdf.
2014-08-13 00:37:18 +01:00
John MacFarlane
234652a4b8 PDF, Docx, EPUB, and ODT writers now automatically use MediaBag.
The MediaBag is thread through from the reader, with no need
to extract to files.
2014-07-30 14:07:31 -07:00
John MacFarlane
d3cf53a956 Moved withTempDir from PDF to Shared, export from Shared.
API change.
2014-07-30 12:29:04 -07:00
John MacFarlane
9cf5f74e8f PDF writer: Fixed treatment of data uris for images.
Closes #1062.
2014-05-28 10:41:40 -07:00
Albert Krewinkel
8fdbef841d Update copyright notices for 2014, add missing notices 2014-05-09 00:46:08 +02:00
John MacFarlane
d4054444c0 Text.Pandoc.PDF: Ensure that temp directories deleted on Windows.
The PDF is now read as a strict bytestring, ensuring that process
ownership will be terminated, so the temp directory can be deleted.
Closes #1192.
2014-04-05 19:57:42 -07:00
John MacFarlane
3df75bc160 PDF: Changes to error reporting, to handle non-UTF8 error output. 2014-03-19 11:09:36 -07:00
Tim Lin
1aed9208f8 PDF: Use / as path separators in latex input only
Fixes compile error on Windows for 5040f3e
Reverted back to canonical file separators </> in all places except for
arguments to the LaTeX builder and in TEXINPUTS

See #1151.

Note: Temporary directories still fail to be removed in Windows due to
call of ByteString.Lazy.readFile creating process ownership of the
compiled pdf file.
2014-03-10 16:23:57 -07:00
John MacFarlane
5040f3ede0 PDF: Use / as path separators in tempdir on Windows.
This is needed for texlive.
Note that the / is used only in the body of withTempDir,
so when the directory is deleted, the original separators will
be used.

See #1151.
2014-03-10 11:16:50 -07:00
John MacFarlane
c026c16fa6 PDF: Use / as path separators even on Windows.
This seems to be necessary for texlive.
Closes #1151 (again!).
2014-03-09 21:26:25 -07:00
John MacFarlane
19b127b898 PDF: Use ; for TEXINPUTS separator on Windows.
Closes #1151, I hope.  Testing needed.
2014-02-23 20:36:21 -08:00
Henry de Valence
3d70059a48 HLint: use fromMaybe
Replace uses of `maybe x id` with `fromMaybe x`.
2013-12-19 21:07:09 -05:00
John MacFarlane
80c1967e75 PDF: Minor code cleanup. 2013-10-17 13:36:43 -07:00
John MacFarlane
7b975c2bcc PDF: Add suggestion to use --latex-engine=xelatex on encoding error. 2013-08-11 16:16:24 -07:00
John MacFarlane
e279175ea5 Options: Changed writerSourceDir to writerSourceURL (now a Maybe).
Previously we used to store the directory of the first input file,
even if it was local, and used this as a base directory for
finding images in ODT, EPUB, Docx, and PDF.

This has been confusing to many users.  It seems better to look for
images relative to the current working directory, even if the first
file argument is in another directory.

writerSourceURL is set to 'Just url' when the first command-line
argument is an absolute URL.  (So, relative links will be resolved
in relation to the first page.)  Otherwise, 'Nothing'.

The ODT, EPUB, Docx, and PDF writers have been modified accordingly.

Note that this change may break some existing workflows.  If you
have been assuming that relative links will be interpreted relative
to the directory of the first file argument, you'll need to
make that the current directory before running pandoc.

Closes #942.
2013-08-11 15:58:09 -07:00
John MacFarlane
02a125d0aa Use walk, walkM in place of bottomUp, bottomUpM when possible.
They are significantly faster.
2013-08-10 18:45:00 -07:00
John MacFarlane
83f263110f Use pipeProcess in Text.Pandoc.PDF. 2013-08-08 15:15:20 -07:00
John MacFarlane
7102254e24 PDF generation improvements.
* `Text.Pandoc.PDF` exports `makePDF` instead of `tex2pdf`.
  (API change.)
* `makePDF` walks the pandoc AST and checks for the existence of
  images in the local directory.  If they are not found, it attempts
  to find them, either in the directory containing the first source
  file, or at an absolute URL, or at a URL relative to the base URL
  of the first command line argument.
* Closes #917.
2013-07-20 12:14:43 -07:00
John MacFarlane
fd0f8c1a8a Text.Pandoc.PDF: put temporary output directory in TEXINPUTS.
This will help later when we try to download external resources.
We can put them in the temp directory.  See #917.
2013-07-18 21:53:34 -07:00
John MacFarlane
26fefa040a PDF: On Windows, create temdir in working directory.
Reason:  the path to the system temp directory may contain tildes,
which causes problems in LaTeX when the username is more than
eight characters.

Closes #777.
2013-04-26 20:36:06 -07:00
John MacFarlane
29c8f1554b PDF: Run latex at least two times.
This ensures that the PDFs will have hyperlinked bookmarks
(PDF table of contents that can be displayed in the sidebar).
2012-03-19 09:25:33 -07:00
John MacFarlane
1ab21530b4 PDF: run latex 3 times if --toc specified.
Closes #424.
2012-02-19 19:11:40 -08:00
John MacFarlane
12aa83f70e PDF: Only run latex twice if \tableofcontents is present.
Note:  This will pick up on \tableofcontents even if it's
in a verbatim environment.  But the worst that can happen is
that the document takes a bit longer to build.
2012-02-07 22:00:22 -08:00
John MacFarlane
acdbdd7da5 Text.Pandoc.PDF: Simplified tex2pdf.
We no longer try to parse the log file to determine whether latex
needs to be rerun. Instead, we run latex twice -- which should be
enough for table of contents and hyperrefs.

Closes #402.
2012-02-06 12:12:23 -08:00
John MacFarlane
e6e4311ddd pandoc: Better error checking. 2012-01-21 14:18:36 -08:00
John MacFarlane
d7b67f48cd PDF: Use string instead of special TeXProgram type. 2012-01-20 21:36:04 -08:00
John MacFarlane
b4a6c02343 PDF: Better error message. 2012-01-20 19:52:56 -08:00
John MacFarlane
f519f0a1ad PDF: Export TeXProgram type. 2012-01-20 19:13:47 -08:00
John MacFarlane
c9c78344b1 PDF: Removed TeXError type, just return a bytestring. 2012-01-20 19:11:35 -08:00
John MacFarlane
50e16e6855 Fixed -Wall errors in PDF module. 2012-01-20 19:04:08 -08:00
John MacFarlane
9d1118ac1f Added Text.Pandoc.PDF - converts latex to PDF. 2012-01-20 18:57:16 -08:00