Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch: PDF/A instead of "normal PDF" #13

Open
RolfWojtech opened this issue Jul 31, 2015 · 0 comments
Open

Patch: PDF/A instead of "normal PDF" #13

RolfWojtech opened this issue Jul 31, 2015 · 0 comments
Assignees

Comments

@RolfWojtech
Copy link

Today one of our customers rejected our invoice and demanded on in PDF/A form ( https://en.wikipedia.org/wiki/PDF/A )

So I took the time to figure out how to output PDF/A in aeroo docs by passing the SelectPdfVersion=1 to OpenOffice/Libreoffice.. The result is the following patch:

--- /srv/odoo/aeroo_docs/DocumentConverter.py.org       2015-07-31 15:39:20.300000000 +0200
+++ /srv/odoo/aeroo_docs/DocumentConverter.py   2015-07-31 15:39:38.188000000 +0200
@@ -195,6 +195,8 @@
         if filter_name == 'Text - txt - csv (StarCalc)':
             properties.update({"FilterOptions": CSVFilterOptions})
         props = self._toProperties(**properties)
+        if filter_name == 'writer_pdf_Export':
+            props += ( PropertyValue( "FilterData", 0, uno.Any("[]com.sun.star.beans.PropertyValue", self._toProperties(SelectPdfVersion = 1), ), 0 ), )
         try:
             #url = uno.systemPathToFileUrl(path) #when storing to filesystem
             self.document.storeToURL('private:stream', props)

A similar patch works for report_aeroo_ooo/DocumentConverter.py

155a156,161
>         outputproperties = self._toProperties(OutputStream = outputStream, FilterName = filter_name, FilterOptions=CSVFilterOptions)
>         if filter_name == 'writer_pdf_Export':
>             outputproperties += ( PropertyValue( "FilterData", 0, uno.Any("[]com.sun.star.beans.PropertyValue", self._toProperties(SelectPdfVersion = 1), ), 0 ), )
157c163
<             self.document.storeToURL('private:stream', self._toProperties(OutputStream = outputStream, FilterName = filter_name, FilterOptions=CSVFilterOptions))

---
>             self.document.storeToURL('private:stream', outputproperties)
163a170
>

I am not sure if I will find the time for a proper pull request for this feature, especially because Aeroo Docs as a generic server cannot really output PDF/A by default. However for use in conjunction with OpenERP/Odoo, PDF/A clearly makes more sense and I wanted to share this in case somebody else needs it or maybe alistek wants to include the idea one way or another

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants