Age | Commit message (Collapse) | Author |
|
Out of platform/java and into the platform/android/example.
|
|
Java has a convention that 'toString' should return a printable
version of an object. We cannot both support this, and support
a sane naming of functions to interpret pdf objects that begins
with 'to'. Instead use 'as'.
This means we have 'asBoolean', 'asInteger', 'asString' which
expect to work just on pdf objects of the required type. 'toString'
continues to work on all types and gives a printable version.
We split 'toByteString' into 2 separate functions, one for acting
on strings (asByteString) and one for acting on names (asByteName)
more nicely mirroring the C level functions (pdf_to_string and
pdf_to_name).
For simplicity of use, we add asString and asName functions that
return using java Strings rather than byte arrays. There are
potential encoding issues with these, but then there are throughout
our string handling at the moment, so we will deal with those in a
followup commit.
We also update the internal workings of several functions so
that they never return NULL pointers, but rather return the null
object. To avoid repeatedly creating new null objects we introduce
a global static PDFObject.Null object.
This is important as we want get("SomethingNonexistent") to return a
valid java object, so we can safely do things like:
get("Foo").get("Bar").get("Baz").asInteger()
without having to error check at every stage.
Update DocViewActivity to call the new versions.
|
|
Put them in the PDF name space and separate words with underscores.
Remove redundant namespace prefixes in java constants.
Device.FLAG_MASK rather than Device.FZ_DEVFLAG_MASK.
Use namespace for PDF annotation flag enum.
|
|
|
|
Page_getSeparation() does the corresponding conversion.
|
|
|
|
This commit puts in the UI for drawing with color
and line thickness. But it does not yet save this to
the document.
|
|
|
|
Previously all exceptions thrown by the library would be converted
into checked exceptions, but there was no sensible response to
expect from a client.
|
|
|
|
|
|
|
|
|
|
The JNI implementation is taken from core.textAsHtml() in the old
viewer.
|
|
|
|
|
|
added TextBlock, TextLine, TextSpan and TextChar inner classes to StructuredText.
Calling StructuredText.getBlocks() returns an array of TextBlocks, which in turn
contains an array of TextLines, etc.
|
|
|
|
Added methods:
* PDFDocument.hasUnsavedChanges()
* PDFDocument.canBeSavedIncrementally()
The interface for PDFDocument.save() now returns
the number of errors encountered while saving.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is for easy of use, in addition to accepting Buffer.
|
|
These are meant to make it easy to interact with mupdf's Buffer
object in a normal Java fashion.
|
|
|
|
|
|
|