GotenbergSharpApiClient
GotenbergSharpApiClient copied to clipboard
using metadata
Hello,
I'm trying add metadata (to set the author of my pdf document). Unfortunately I cannot find the correct way to add the pdf metadata. Could you please advise me how I would be able to add metadata to my request? I have tried to use .SetConversionBehaviors(x => x.AddAdditionalHeaders("metadata", meatadataValue);) but unfortunately this didn't work for me (this gave me json issues). I have also tried to add it as an JObject to prevent json serialization issues, but in that case I got the message "Invalid form data: form field 'extraHttpHeaders' is invalid" I did this with .SetConversionBehaviors(x => x.AddAdditionalHeaders(JObject.FromObject(new { metadata = JObject.FromObject(new { Author = "test" }).ToString(Formatting.None) })))
The documentation of Goterberg gives the following example for adding metadata:
curl
--request POST http://localhost:3000/forms/chromium/convert/url
--form url=https://my.url
--form 'metadata={"Author":"Julien Neuhart","Copyright":"Julien Neuhart","CreationDate":"2006-09-18T16:27:50-04:00","Creator":"Gotenberg","Keywords":["first","second"],"Marked":true,"ModDate":"2006-09-18T16:27:50-04:00","PDFVersion":1.7,"Producer":"Gotenberg","Subject":"Sample","Title":"Sample","Trapped":"Unknown"}'
-o my.pdf