AnsweredAssumed Answered

Updating pdf from javascript

Question asked by stebans on May 19, 2008
Latest reply on May 19, 2010 by pmonks

I would like to add some info onto pdf files, updating their metadata and adding a cover page for example. I'm using the iText library ( As far as I know, IText expects accessing the file, or an InputStream, or a byte[]. I thought this could be easily solved, but I'm not able to access the pdf file. So what are the solutions for loading pdf file from JS scripts as "document.content" is only good for text content?  Therefore, the only way I see is using document.url. Unfortunately, accessing the content needs authentication, and without authentication, only the login page is returned.

Could anybody suggest a way to authenticate from within JS Script for accessing content, with simple authentication or maybe using session ticket (I need a way to save content back to document, but that's another question!) -or another way to do it?

Another side question about javascript is how to load a config file (eg an xml file present in alfresco/extension/myFile.xml). Is it possible to use the "classpath:" value (no success as of now)?

Thanks for any help,
best regards,