Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

getDocContentType and PDFGenerator

Avatar

Level 2

Hello!

Can somebody share some insight how we do determine the contentType of a document variable. Where does this info come from?

Additionally with ES2 Lc PDF Gen can now determine the document type. Is the service using the same method?
And if I use Assembler to pass in a list of office documents as a source how does it work here? To my impression it seems to take the file extension only cause I could fool it by renaming a spreadsheet to excel.doc and it got confused.

Regards

Gunther

2 Replies

Avatar

Level 10

Gunther,

You can use an xPath expression like the following : getDocContentType(/process_data/@myDoc)and put the result into a string.

Jasmin

Avatar

Level 2

Hi!

I know this. This was not my question: I need to understand how PDFGen / Assembler do determine the content type. I do not know what it really does in the background i.e. going for the extension or the mimetype or both or is ther more behind the scenes?

Can somebody answer this question or do we have to go back to engineering on this?