Re: Reading a Stream reported as EmbeddedFile

2013-01-11 Thread Andreas Lehmkühler
Hi,


Maruan Sahyoun  hat am 11. Januar 2013 um 11:52
geschrieben:
> Hi,
>
> I have a handling question regarding PDFBox. Im trying to read an object which
> is defined as COSDictionary{(COSName{Filter}:COSArray{[COSName{FlateDecode}]})
> (COSName{Length}:COSInt{477}) (COSName{Type}:COSName{EmbeddedFile}) }
>
> How can I get the content of that object?
Have a look at the ExtractEmbeddedFiles example [1]


> Kind regards
>
> Maruan Sahyoun

BR
Andreas Lehmkühler

[1]
http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractEmbeddedFiles.java?view=log


Re: Reading a Stream reported as EmbeddedFile

2013-01-11 Thread Maruan Sahyoun
Hi Andreas,

maybe I should have been clearer in my question. What I' trying to do is 
reading the XFA part of a form,

where the XFA is part of an array

COSString{xdp:xdp}
COSObject{61, 0}
COSString{config}
COSObject{4, 0}
COSString{template}
COSObject{5, 0}
COSString{datasets}
COSObject{62, 0}
COSString{localeSet}
COSObject{7, 0}
COSString{xmpmeta}
COSObject{8, 0}
COSString{xfdf}
COSObject{9, 0}
COSString{form}
COSObject{63, 0}
COSString{}
COSObject{64, 0}

Now the array acts as as key value pair where the odd entry is the key (e.g. 
xdp:xdp) and the even part is the content of this subsection of the XFA. In my 
sample the content of  is contained in <62,0>. Now this is a stream 
with the following dictionary  
COSDictionary{(COSName{Filter}:COSArray{[COSName{FlateDecode}]}) 
(COSName{Length}:COSInt{477}) (COSName{Type}:COSName{EmbeddedFile}) }

And this is what I'm trying to read. 

The other possible implementation for an XFA form is that the content is not 
splitted into individual parts contained in an array but the whole XFA is 
contained in a single stream.

Plan is to provide a patch to extract the XFA and in another stage to replace 
the XFA with new content so people using pdfbox can extract data from XFA forms 
and prepopulate XFA forms using pdfbox. 


Maruan Sahyoun

Am 11.01.2013 um 13:06 schrieb "Andreas Lehmkühler" :

> Hi,
> 
> 
> Maruan Sahyoun  hat am 11. Januar 2013 um 11:52
> geschrieben:
>> Hi,
>> 
>> I have a handling question regarding PDFBox. Im trying to read an object 
>> which
>> is defined as 
>> COSDictionary{(COSName{Filter}:COSArray{[COSName{FlateDecode}]})
>> (COSName{Length}:COSInt{477}) (COSName{Type}:COSName{EmbeddedFile}) }
>> 
>> How can I get the content of that object?
> Have a look at the ExtractEmbeddedFiles example [1]
> 
> 
>> Kind regards
>> 
>> Maruan Sahyoun
> 
> BR
> Andreas Lehmkühler
> 
> [1]
> http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractEmbeddedFiles.java?view=log



Re: Reading a Stream reported as EmbeddedFile

2013-01-11 Thread Maruan Sahyoun
Hi Andreas,

I found it - thanks for your help.

Kind regards

Maruan Sahyoun

Am 11.01.2013 um 13:21 schrieb Maruan Sahyoun :

> Hi Andreas,
> 
> maybe I should have been clearer in my question. What I' trying to do is 
> reading the XFA part of a form,
> 
> where the XFA is part of an array
> 
> COSString{xdp:xdp}
> COSObject{61, 0}
> COSString{config}
> COSObject{4, 0}
> COSString{template}
> COSObject{5, 0}
> COSString{datasets}
> COSObject{62, 0}
> COSString{localeSet}
> COSObject{7, 0}
> COSString{xmpmeta}
> COSObject{8, 0}
> COSString{xfdf}
> COSObject{9, 0}
> COSString{form}
> COSObject{63, 0}
> COSString{}
> COSObject{64, 0}
> 
> Now the array acts as as key value pair where the odd entry is the key (e.g. 
> xdp:xdp) and the even part is the content of this subsection of the XFA. In 
> my sample the content of  is contained in <62,0>. Now this is a 
> stream with the following dictionary  
> COSDictionary{(COSName{Filter}:COSArray{[COSName{FlateDecode}]}) 
> (COSName{Length}:COSInt{477}) (COSName{Type}:COSName{EmbeddedFile}) }
> 
> And this is what I'm trying to read. 
> 
> The other possible implementation for an XFA form is that the content is not 
> splitted into individual parts contained in an array but the whole XFA is 
> contained in a single stream.
> 
> Plan is to provide a patch to extract the XFA and in another stage to replace 
> the XFA with new content so people using pdfbox can extract data from XFA 
> forms and prepopulate XFA forms using pdfbox. 
> 
> 
> Maruan Sahyoun
> 
> Am 11.01.2013 um 13:06 schrieb "Andreas Lehmkühler" :
> 
>> Hi,
>> 
>> 
>> Maruan Sahyoun  hat am 11. Januar 2013 um 11:52
>> geschrieben:
>>> Hi,
>>> 
>>> I have a handling question regarding PDFBox. Im trying to read an object 
>>> which
>>> is defined as 
>>> COSDictionary{(COSName{Filter}:COSArray{[COSName{FlateDecode}]})
>>> (COSName{Length}:COSInt{477}) (COSName{Type}:COSName{EmbeddedFile}) }
>>> 
>>> How can I get the content of that object?
>> Have a look at the ExtractEmbeddedFiles example [1]
>> 
>> 
>>> Kind regards
>>> 
>>> Maruan Sahyoun
>> 
>> BR
>> Andreas Lehmkühler
>> 
>> [1]
>> http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ExtractEmbeddedFiles.java?view=log
>