8 ms·
Earlier this year I was working on hybrid PDFs[1] that embed a full XML invoice. Standardized and promoted by the German and French.[2] One more thing to hide.
by m3nu 8y ago
Earlier this year I was working on hybrid PDFs[1] that embed a full XML invoice. Standardized and promoted by the German and French.[2] One more thing to hide.
1: https://github.com/invoice-x/factur-x-ng https://github.com/invoice-x/factur-x-ng
2: http://fnfe-mpe.org/factur-x/factur-x_en/ http://fnfe-mpe.org/factur-x/factur-x_en/
- masa331 8y agoThis is actually pretty cool. I'v been working in an accounting company and i'v been thinking about such thing a lot lately. Is Factur-X used in practice in Germany and France? Do you know about some other similar things?
- m3nu 8y agoThe lower-level library is used in Odoo ERP for example. Possibly others, as there are a few implementations[1] (mostly Java). This is lots of work because you need to create the XML yourself. I tried to make mappings between simple keywords and the XPaths of different XML standards (there are a bunch)[2] So in theory you could just give a few keywords and get the full XML. Currently this is on hold, but if someone has a use case and wants to contribute, I'd be happy to continue working on it. I also provide this other library[3] that extracts some essential data from PDFs. The plan is to use them together to automatically build the XML from just the PDF. 1: https://www.invoice-x.org/related/ https://www.invoice-x.org/related/ 2: https://www.invoice-x.org/standards/ https://www.invoice-x.org/standards/ 3: https://github.com/invoice-x/invoice2data https://github.com/invoice-x/invoice2data
- masa331 8y agoThank you! I will look into these. I know the problems. As i was working in the accounting firm i was dealing with imports/exports from various accounting softwares a lot. In fact i'm currently working on an app which can convert between them as my side project.
- Leace 8y agoAs far as I understand this the "standard" is the XML that is being embedded inside PDF, so you need a small tool to extract the XML from the PDF and then you've got the standard XML invoice. The PDF is just for nice presentation. I did a similar approach of using XML Stylesheets (XSL) to render the standard invoice as HTML when opened, this also looked nice.
- IshKebab 8y agoIs the PDF rendered from the XML? If not that sounds mad.
- codetrotter 8y agoMad how? PDF is a notoriously bad format to extract data from, but great for visually representing the data to humans. XML is human unfriendly but good for structuring data so that software can read it. Embedding the machine readable XML representation of the data in the PDF ensures that both representations of the data are available always.
- btgeekboy 8y agoI think OP is concerned about conflicting data - the visual representation may not match the XML data.
- leovander 8y ago...the visual representation may not match the XML data Hopefully OP doesn't learn about how his medical history is possibly passed around. https://en.wikipedia.org/wiki/Continuity_of_Care_Document https://en.wikipedia.org/wiki/Continuity_of_Care_Document
- askvictor 8y agoGiven that it's possible to have javascript in a PDF as well, it wouldn't be too hard to have a bit of code that verifies the XML matches the human-readable version. Or, failing that, some sort of crypto signature to check both to see things haven't been tampered with.
- josefx 8y agoAs far as I can tell the standard prohibits PDF files with any dynamic content, including javascript. Also there is no point in embedding the verification code in the PDF if you don't trust its contents.
- 8y ago
- deleted 8y ago[deleted]
- tonyedgecombe 8y agoI seem to remember JDEdwards marked up their PDF output in a way that made it easy to parse out the data.