pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: Parse dictionary given as a string.
Date Tue, 17 Jan 2017 17:00:58 GMT
Am 17.01.2017 um 17:23 schrieb Christopher Begley:
> Is it possible to use PDFBox to parse a dictionary given as a string? (Possibly generated/originating
from another source)

Why would you want to do that?

You could have a look at BaseParser.java and search for 
parseCOSDictionary(). However this assumes you're in a PDF file, you 
would have to initialize lots of things.

>   For example, if I have:
> <</Type/Page/Parent 2 0 R/Resources<</Font<</F1 6 0 R/F2 9 0 R/F3 11
0 R>>/ExtGState<</GS8 8 0 R>>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/MediaBox[
0 0 612 1008] /Contents 5 0 R/Group<</Type/Group/S/Transparency/CS/DeviceRGB>>/Tabs/S/StructParents

This structure is not complete, i.e. things like "6 0 R" are references 
to other objects.


> Is there a way to take this string and load it into a COSDictionary object and then parse
key/value pairs?
> I've looked at the COSDictionary documentation and there doesn't seem to be any (obvious)
way to do this.
> If PDFBox is not able to do this, does anyone know of any open source parsers out there
that would accomplish this?  Thanks in advance.

To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org

View raw message