techprimate / TPPDF

TPPDF is a simple-to-use PDF builder for iOS and macOS written in Swift
https://techprimate.github.io/TPPDF/
MIT License
731 stars 124 forks source link

Custom PDF Metadata fields #60

Closed marbetschar closed 4 years ago

marbetschar commented 6 years ago

Is it possible while using TPPDF to read/write extended PDF metadata? I'm thinking of adding support for ZUGFeRD standard for invoicing. Here an example of how the code may look like in Java:

https://konik.io/docs/

philprime commented 6 years ago

At the moment the these metadata keys are available.

Can you create a summary of what metadata key/value types you need to to support your functionality? Maybe we need to create a custom PDF metadata engine which manipulates the bytes of the created PDF file

marbetschar commented 6 years ago

I see. ZUGFeERD is a Standard for processing invoices automatically. That said at it‘s core is a simple XML specification which is embedded within a PDF.

I‘m aware that as of now there are a multitude of such standards available. Therefore, from a TPPDF point of view it may be enough to allow read/write any custom meta data through a Data attribute...?

philprime commented 6 years ago

Looks like we need to find a way of changing the metadata of the generated PDF file. I do not know the PDF specification enough to know, but I do know there is no way to add any other metadata other than the before mentioned auxilliary keys.

marbetschar commented 6 years ago

Got it. Isn't a high priority on my end as of now. Just wanted to know if this is already possible.

philprime commented 6 years ago

I just found this method in the documentation:

CGContext.addDocumentMetadata(_:)

Do you think we can create the XML metadata using this method on the PDF context?

philprime commented 4 years ago

Is still a relevant issue? Otherwise I will close this for now and we will take a look at PDF Metadata if there is a actual use-case to work with.

philprime commented 4 years ago

Closed due to inactivity