Skip to content

Commit

Permalink
Release 0.23: Reduce PDF file size with flateEncode()
Browse files Browse the repository at this point in the history
  • Loading branch information
alexis-via committed Jul 25, 2020
1 parent 74e4d40 commit 2ecd6f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ A video tutorial that shows how to install and use this LibreOffice extension is
Release notes
=============

* Version 0.23 dated July 26th 2020:

* Reduce Factur-X PDF file size via the use of flateEncode()

* Version 0.22 dated January 11th 2020:

* New icon for the extension and for the menu entry

* Version 0.21 dated January 8th 2020:

* Add german translation and invoice sample (contributed by Jochen Staerk)
Expand Down
2 changes: 1 addition & 1 deletion extension/description.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
xmlns:d="http://openoffice.org/extensions/description/2006">

<identifier value="com.akretion.factur-x" />
<version value="0.22" />
<version value="0.23" />
<platform value="all" />
<display-name>
<name lang="en">Factur-X Invoice Generator</name>
Expand Down
3 changes: 3 additions & 0 deletions extension/package/libreoffice_facturx_macro.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ def _filespec_additional_attachments(
})
file_entry = DecodedStreamObject()
file_entry.setData(file_bin)
file_entry = file_entry.flateEncode()
file_mimetype = mimetypes.guess_type(filename)[0]
if not file_mimetype:
file_mimetype = 'application/octet-stream'
Expand Down Expand Up @@ -709,6 +710,7 @@ def _facturx_update_metadata_add_attachment(
})
file_entry = DecodedStreamObject()
file_entry.setData(facturx_xml_str) # here we integrate the file itself
file_entry = file_entry.flateEncode()
file_entry.update({
NameObject("/Type"): NameObject("/EmbeddedFile"),
NameObject("/Params"): params_dict,
Expand Down Expand Up @@ -766,6 +768,7 @@ def _facturx_update_metadata_add_attachment(
metadata_xml_str = _prepare_pdf_metadata_xml(facturx_level, pdf_metadata)
metadata_file_entry = DecodedStreamObject()
metadata_file_entry.setData(metadata_xml_str)
metadata_file_entry = metadata_file_entry.flateEncode()
metadata_file_entry.update({
NameObject('/Subtype'): NameObject('/XML'),
NameObject('/Type'): NameObject('/Metadata'),
Expand Down
Binary file modified factur-x_macro.oxt
Binary file not shown.

0 comments on commit 2ecd6f9

Please sign in to comment.