Hi friends, I am from Bolivia and my English is not too good,
I'm on an internship in a Bank and I have the labor to download o convert 
to PDF a bitstream.
i´m working with the api rest of dspace
with this request i obtein this response but i dont know what to do




            HttpClient client = new DefaultHttpClient();
            HttpGet request = new HttpGet(
"http://10.3.11.134:8080/rest/items/1?expand=bitstreams";);
            request.addHeader("Content-Type", "application/json");
            request.addHeader("Accept", "application/json");
            request.addHeader("rest-dspace-token", jLabel1.getText());


            HttpResponse response = client.execute(request);
            BufferedReader rd = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
            String line = "";
            while ((line = rd.readLine()) != null) {                       
         
                System.out.println(line);
            }
        } catch (Exception ex) {
            System.out.println(ex);
        }        


*{"id":1,"name":"DEP.DE CHEQ.AJENOS - RET.DE CAM. - CONCEPTO: DEP. A LA LB. 
150104101 PAGO PREDIARIOS - DEP.: MINISTERIO DE GOBIERNO  -  PROCEDENCIA: 
BANCO UNION S.A. -  CHEQUE: 
50063","handle":"123456789/7","type":"item","link":"/rest/items/1","expand":["metadata","parentCollection","parentCollectionList","parentCommunityList","all"],"lastModified":"2016-08-18
 
15:02:43.085","parentCollection":null,"parentCollectionList":null,"parentCommunityList":null,"bitstreams":[{"id":1,"name":"20150102_04B_0001.pdf","handle":null,"type":"bitstream","link":"/rest/bitstreams/1","expand":["parent","policies","all"],"bundleName":"ORIGINAL","description":null,"format":"Adobe
 
PDF","mimeType":"application/pdf","sizeBytes":444206,"parentObject":null,"retrieveLink":"/bitstreams/1/retrieve","checkSum":{"value":"44e3d8da8a02c07c75e72cc5a395cdea","checkSumAlgorithm":"MD5"},"sequenceId":1,"policies":null},{"id":2,"name":"20150102_04B_0001.txt","handle":null,"type":"bitstream","link":"/rest/bitstreams/2","expand":["parent","policies","all"],"bundleName":"ORIGINAL","description":null,"format":"Text","mimeType":"text/plain","sizeBytes":6620,"parentObject":null,"retrieveLink":"/bitstreams/2/retrieve","checkSum":{"value":"2805e15b78a302204deacbd0d26bdca4","checkSumAlgorithm":"MD5"},"sequenceId":2,"policies":null}],"archived":"true","withdrawn":"false"}*



with this request i obtain the bitstream that i want to download.

HttpClient client = new DefaultHttpClient();
            HttpGet request = new HttpGet(
"http://10.3.11.134:8080/rest/bitstreams/1/retrieve";);
//            request.addHeader("Content-Type", "application/json");
//            request.addHeader("Accept", "application/json");
            request.addHeader("rest-dspace-token", jLabel1.getText());
            HttpResponse response = client.execute(request);
            BufferedReader rd = new BufferedReader(new InputStreamReader(
response.getEntity().getContent()));
            String line = "";
            while ((line = rd.readLine()) != null) {                       
         
                System.out.println(line);
            }
        } catch (Exception ex) {
            System.out.println(ex);
        }   


And I get 

%PDF-1.0
%����
%3.4
6 0 obj
<</BitsPerComponent 8/ColorSpace/DeviceGray/Filter/DCTDecode/Height 1860/
Length 333573/Name/ImagePart_4022/Subtype/Image/Type/XObject/Width 2432>>
stream
����
  (     1#% (:3=<9387@H\N@DWE78PmQW_bghg>Mqypdx\egc��

%&
'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������
  



19 0 obj
<</Length 20 0 R>>
stream
0 0 0 rg
0 0 0 RG
q
1 0 0 1 0 0 cm
583 0 0 446 0 0 cm
/ImagePart_4022 Do
/OPBaseFont1 6.5 Tf
(Nc ^:,;.rui n. [r-2r il[t-ilt )Tj
1 -0 0 1 238.55 47.9 Tm
2000 Tz
(\t)Tj
1 -0 0 1 256.001 47.7 Tm
118.04 Tz
(-d )Tj
1 -0 0 1 13.324 18.15 Tm
88.34 Tz
/OPBaseFont1 13 Tf
(1:0 LO L 40 20 1 1: 2 100000 2 9 3 7 16 �)Tj
1 -0 0 1 224.974 18.15 Tm
83.2 Tz
(1)Tj
1 -0 0 1 231.041 18.15 Tm
105.16 Tz
(00 500 )Tj
1 -0 0 1 306.076 19.1 Tm
114.44 Tz
('00 3 5 500000. )Tj
ET
endstream
endobj
24 0 obj
4870
endobj
21 0 obj
<</Font<</OPBaseFont0 7 0 R/OPBaseFont1 8 0 R/OPBaseFont2 9 0 R/OPBaseFont3 
10 0 R/OPBaseFont4 11 0 R/OPBaseFont5 12 0 R>>/ProcSet 3 0 
R/XObject<</ImagePart_4022 
6 0 R>>>>
endobj
22 0 obj
[19 0 R]
endobj
1 0 obj
<</Contents 22 0 R/MediaBox[0 0 583 446]/Parent 2 0 R/Resources 21 0 R/
Rotate 0/Type/Page>>
endobj
14 0 obj
<</Dest[13 0 R/XYZ 0 190 null]/Parent 4 0 R/Prev 5 0 R/Title(Page 2)>>
endobj
4 0 obj
<</Count 2/First 5 0 R/Last 14 0 R/Type/Outlines>>
endobj
27 0 obj
<</Outlines 4 0 R/Pages 2 0 R/Type/Catalog>>
endobj
25 0 obj
<</Font<</OPBaseFont0 7 0 R/OPBaseFont1 8 0 R/OPSUFont0 16 0 R>>/ProcSet 3 
0 R/XObject<</ImagePart_4023 15 0 R>>>>
endobj
26 0 obj
[23 0 R]
endobj
13 0 obj
<</Contents 26 0 R/MediaBox[0 0 428 190]/Parent 2 0 R/Resources 25 0 R/
Rotate 0/Type/Page>>
endobj
2 0 obj
<</Count 2/Kids[1 0 R 13 0 R]/Type/Pages>>
endobj
xref
0 28
0000000000 65535 f
0000442925 00000 n
0000443510 00000 n
0000437721 00000 n
0000443119 00000 n
0000334542 00000 n
0000000020 00000 n
0000333773 00000 n
0000333911 00000 n
0000334047 00000 n
0000334184 00000 n
0000334319 00000 n
0000334464 00000 n
0000443402 00000 n
0000443032 00000 n
0000334628 00000 n
0000422265 00000 n
0000422102 00000 n
0000422447 00000 n
0000422577 00000 n
0000437699 00000 n
0000442712 00000 n
0000442900 00000 n
0000437769 00000 n
0000442691 00000 n
0000443246 00000 n
0000443377 00000 n
0000443185 00000 n
trailer
<</Info 18 0 R/Root 27 0 R/Size 28>>
startxref
443568
%%EOF
 the code that i obtein is largger so i cut and i only past parts.

What i have to do?

Please

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-community.
For more options, visit https://groups.google.com/d/optout.

Reply via email to