Comments (3)
These look like different issues to me.
- The conformancelevel could be read from the source document, that's a good idea, feel free to implement.
- ignoreA1Errors is not meaningless because if it's used at the right place the PDFBox validity check will not take place. This check is expensive (maybe a bit, in terms of computing time) and necessary: I did receive bug reports where people tried to convert ordinary PDFs (non-archivable ones) to PDF/A-3 with my library which would be incredibly difficult to implement (we don't know any open source software except Ghostscript which could even try). So I do want those guys to get exceptions and I do want the possibility to switch those checks off for those who know what they are doing (e.g. in Gnuaccounting I export PDF/A from OpenOffice which in my experience simple don't need additional checks).
- I'm not yet sure why you introduced a factory?
- Method chaining is a nice idea, I would merge an according request. My priority, however, would be providing a alternative to the getter based API in the first place. The few calls to the exporter is only a fraction of the work which is later needed to implement IZUGFeRDExportableTransaction, IZUGFeRDExportableProduct, IZUGFeRDExportableContact, and IZUGFeRDExportableItem, a setter based API could be a good way to e.g. set defaults without having to implement null-returning methods.
from mustangproject.
I did not mean that ignoreA1Errors
or setConformanceLevel
is always meaningless. It is only meaningless in the snippet I posted above: The methods ignoreA1Errors
and setConformanceLevel
need to be called BEFORE calling PDFmakeA3compliant
. If you mix up the order and call PDFmakeA3compliant
first and THEN call ignoreA1Errors
or setConformanceLevel
, then that call is meaningless. Thus my intention was to change the API so that these methods are only available during the time it makes sense to call them (before calling PDFmakeA3compliant
). They are all still there.
There are two reasons why I introduced a factory:
- So that
ignoreA1Errors
orsetConformanceLevel
(and the like) are only available in the factory. As a result I get what I described above: The methods that configure PDF-A1 to PDF-A3 conversion behaviour are only available on the factory and because the methodcreateFromPDFA1
returns an instance ofZUGFeRDExporter
it feels intuitive that further calls on the factory will have no effect on the created exporter anymore. Also it will be impossible to call methods on the exporter (such asPDFattachZugferdFile
), before the PDF was created/imported (which would also be an illegal action). - I wanted to simplify the code. When I first read through the class
ZUGFeRDExporter
I thought "oh, that is a big complicated class", because a big class has also a big context to consider. However I noticed that e.g. the methodsignoreA1Errors
orsetConformanceLevel
do something that is only meaningful for converting PDF documents from A1 to A3. Extracting these methods into a factory results in a factory that can be read quickly and is easy to understand, because it is short and it is apparent which methods interact with which properties etc.
For the method chaining part: Great to hear that you are open to also accept a configurable implementation of IZUGFeRDExportableTransaction
etc. I'd be happy to also create a pull request for that. However that would be a completely different topic then the one discussed in this ticket so far.
from mustangproject.
I merged your merge requests, I hope that solves that issue. Git still reported merge errors but eclipse merge tool didn't. In the next weeks I'll have a look if the library still works as intended :-)
from mustangproject.
Related Issues (20)
- print version of xml report
- update EN16931 validation
- FreeSans.ttf at two locations in the library.jar HOT 1
- 404 for example PDF HOT 2
- PDF Document ( ZugferdDev.de ) Link broken factur-x HOT 2
- Empty Element in Document HOT 1
- How to add a discount? HOT 3
- Allow tradeparty electronic address with leitwegid like setEmail HOT 1
- Problem with Validation of X-Rechnung HOT 2
- X-Rechnung direct-debit missing mandatory field BT-90 HOT 3
- BuyerTradeParty HOT 1
- Jakarta Support HOT 7
- Upgrade to PDFBox 3 HOT 7
- Where can I find the invoice totals lines? HOT 3
- The use of SpecifiedTradeSettlementPaymentMeans several times HOT 4
- PDF generation from XML requires FreeSans.ttf HOT 2
- ClassCastException: ZUGFeRDExporterFromA3 cannot be cast to ZUGFeRDExporterFromPDFA
- Runden bei Negativwerten HOT 4
- CLI: action combine: --ignorefileextension to ignore PDF/A input file errors dosen't work HOT 1
- Zugferd importer does not recognize XRechnung Zugferd Profile HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mustangproject.