aboutsummaryrefslogtreecommitdiffstats
path: root/lib/attachment_to_html
Commit message (Collapse)AuthorAgeLines
* Use a relative path in call to pdftohtml.Louise Crow2015-05-11-2/+2
| | | | | | | | 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.
* Handle the expected case where conversion fails and returns nil.Louise Crow2015-04-02-1/+2
|
* Set binary mode to false in call to pdftohtmlLouise Crow2015-02-13-2/+1
| | | | | We want the HTML to be encoding in the default encoding so that it can be combined with other strings.
* Add charset to view-as-html templateGareth Rees2014-08-19-0/+1
|
* Handle converting empty RTF fileshotfix/0.18.0.3Gareth Rees2014-06-06-0/+2
| | | | Fixes https://github.com/mysociety/alaveteli/issues/1563
* Remove obsolete requireLouise Crow2014-05-15-2/+0
|
* Work around bug#77932 in pdftohtmlGareth Rees2014-05-06-0/+11
| | | | | | | | | Sometimes pdftohtml will generate thousands of images when converting an image embedded in a PDF. This causes a request spike when a user tries to view the converted PDF as HTML. See https://bugs.freedesktop.org/show_bug.cgi?id=77932 for the bug report.
* Dynamically inject AttachmentToHTML::View contentGareth Rees2014-04-07-2/+21
|
* Remove redundant AttachmentToHTML::HTMLGareth Rees2014-04-07-15/+0
|
* Update AttachmentToHTML for new View classGareth Rees2014-04-07-6/+7
|
* Simpler AttachmentToHTML::Adapters::CouldNotConvert interfaceGareth Rees2014-04-07-29/+15
|
* Simpler AttachmentToHTML::Adapters::GoogleDocsViewer interfaceGareth Rees2014-04-07-30/+13
|
* Simpler AttachmentToHTML::Adapters::RTF interfaceGareth Rees2014-04-07-46/+16
| | | | | | | | | | | TODO: We really should be testing the full output of RTF#body, but we currently want to remain consistent with Adapters::PDF as many methods are shared between the Adapters. A more correct spec might be: expected = %Q(<font size=3><font color="#000000">thisisthebody</font></font>) adapter.body.should == expected
* Simpler AttachmentToHTML::Adapters::PDF interfaceGareth Rees2014-04-07-46/+16
| | | | | | | | | | | TODO: We really should be testing the full output of PDF#body, but inconsistencies between pdftohtml prevent sensible means of doing this. For example: adapter.body.should == %Q(\n<A name=1></a>thisisthebody<br/>\n<hr>\n) Fails because some versions (correctly!) use lower case tag names.
* Simpler AttachmentToHTML::Adapters::Text interfaceGareth Rees2014-04-07-41/+20
|
* Add an AttachmentToHTML::View to deal with renderingGareth Rees2014-04-07-0/+41
|
* Work around a bug in unrtfGareth Rees2014-04-01-1/+12
|
* Get attachment body outside of chdirGareth Rees2014-04-01-24/+36
|
* Add AttachmentToHTML libraryGareth Rees2014-03-28-0/+516
Extracts the attachment processing from FoiAttachment#body_to_html AttachmentToHTML contains adapters which convert - text/plain - application/pdf - application/rtf Results are returned as an AttachmentHTML::HTML instance which contains the raw HTML and other metadata about the conversion.