Expand my Community achievements bar.

Metadata?

Avatar

Level 3
Hello,



I'm currently working on a project involving Reader Extensions, Document Security, Forms and PDFG and I've run into a problem:



The first step of a real complex process is the conversion of a Word document to PDF. This is being done using PDFG and works OK. In Word, some information is being entered automatically and stored as various document properties. This is being converted into PDF metadata or document properties.



I'm now looking for a way to read this information on the server side, using the PDF manipulation API being supplied by ARES or DSS respectively. So far, I haven't been able to find ANY way to get close to accomplishing that.



Is this possible at all, and if so, how can it be done?



Any pointers are welcome ;-)



Kind regards,



Steffen.
2 Replies

Avatar

Level 3
To be more specific: PDFDocument.getXMP() *always* returns exactly nothing, even though the data shows up if it's opened with Acrobat.



What I was trying was to open the PDF, calling getXMP() and the saving the XMPMetadata object into a DataBuffer object.



According to the documentation, this should be supposed to work ...

Avatar

Former Community Member
Here's what I do (My problem is the getBufLength() returns 0 no matter the size. If you're depending on that you're SOL. This method works for me, for the past few years no problems.



XMPMetadata metaData = pdfDocument.getXMP();

DataBuffer db = metaData.save();



FileOutputStream fos = new java.io.FileOutputStream("c:\\metabuffer.txt");

boolean cont = true;

long i = 0;



//what? db.getBufLength() returns 0

while(cont){

try{

fos.write(db.getBytes(i,1));

i = i + 1;

}catch(Exception ex){

cont = false;

}

}