a-jsonobject-text-must-begin-with-at-1-character-2-line-1-in-java

0
I am retrieving PDF file from different server and the response coming as below and when try to convert response content to JSONObject  i am getting an error like below. How to convert this data to JSON Object, please help me %PDF-1.7 %���� 1 0 obj <</Type/Catalog/Pages 2 0 R/Lang(en-IN) /StructTreeRoot 10 0 R/MarkInfo<</Marked true>>/Metadata 20 0 R/ViewerPreferences 21 0 R>> endobj 2 0 obj <</Type/Pages/Count 1/Kids[ 3 0 R] >> endobj 3 0 obj <</Type/Page/Parent 2 0 R/Resources<</Font<</F1 5 0 R>>/ExtGState<</GS7 7 0 R/GS8 8 0 R>>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/MediaBox[ 0 0 595.2 841.92] /Contents 4 0 R/Group<</Type/Group/S/Transparency/CS/DeviceRGB>>/Tabs/S/StructParents 0>> endobj 4 0 obj <</Filter/FlateDecode/Length 172>> stream x���; �0��@����M�J�t�êP�Qp�Z����Ag�v���}�Ȳ�-�(�QT%�����XbK )i5�'��3�9+:΂��R�"tgΔ+R-IGHc+C���^�K1��2�1�)5�����"|�AXo�_{qD��v� g�) %�o�Qd����-��6d endstream endobj 5 0 obj <</Type/Font/Subtype/TrueType/Name/F1/BaseFont/BCDEEE+Calibri/Encoding/WinAnsiEncoding/FontDescriptor 6 0 R/FirstChar 32/LastChar 106/Widths 18 0 R>> endobj 6 0 obj <</Type/FontDescriptor/FontName/BCDEEE+Calibri/Flags 32/ItalicAngle 0/Ascent 750/Descent -250/CapHeight 750/AvgWidth 521/MaxWidth 1743/FontWeight 400/XHeight 250/StemV 52/FontBBox[ -503 -250 1240 750] /FontFile2 19 0 R>> endobj 7 0 obj <</Type/ExtGState/BM/Normal/ca 1>> endobj 8 0 obj <</Type/ExtGState/BM/Normal/CA 1>> endobj 9 0 obj <</��>>
asked
1 answers
1

If I read this correctly you want to convert a PDF to JSON? That will never work. What you could to is retrieve the metadata with a Java action. See for instance this URL: https://dzone.com/articles/get-or-set-pdf-metadata-in-java
Regards,

Ronald

 

answered