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: Migration to PDFBox 2.0.0
Date Tue, 12 Jan 2016 18:46:53 GMT
Am 12.01.2016 um 18:35 schrieb Romina O. Leon:
> Prior to PDFBox 2.0 parsing the page content was done using
>
> PDStream contents = page.getContents();PDFStreamParser parser = new
> PDFStreamParser(contents.getStream());parser.parse();List<Object>
> tokens = parser.getTokens();
>
> But, the method getContents() from the PDPage Class returns an InputStream,
> which it can't be cast to a PDStream.
>
> And with the example below:
>
> With PDFBox 2.0 the code is reduced to
>
> PDFStreamParser parser = new
> PDFStreamParser(page);parser.parse();List<Object> tokens =
> parser.getTokens();
>
> I still can't get the page content!

What do you mean, getting the page contents? You mention getContents(), 
this returns an inputStream that you can read. Getting the tokens is 
shown in the example you quote. Why do you insist on a PDStream?

Tilman



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


Mime
View raw message